Interface SchemaRegistry

All Superinterfaces:
DebugDumpable, DefinitionsStore, GlobalDefinitionsStore, PrismContextSensitive
All Known Implementing Classes:
AxiomEnabledSchemaRegistry, SchemaRegistryImpl

public interface SchemaRegistry extends PrismContextSensitive, DebugDumpable, GlobalDefinitionsStore
Maintains system-wide schemas.
  • Method Details

    • get

      static SchemaRegistry get()
    • getNamespacePrefixMapper

      DynamicNamespacePrefixMapper getNamespacePrefixMapper()
      Returns:
      System-wide "standard prefixes" registry.
    • staticNamespaceContext

      PrismNamespaceContext staticNamespaceContext()
    • registerInvalidationListener

      void registerInvalidationListener(SchemaRegistry.InvalidationListener listener)
    • getDefaultNamespace

      String getDefaultNamespace()
    • initialize

      void initialize() throws SAXException, IOException, SchemaException
      Throws:
      SAXException
      IOException
      SchemaException
    • getJavaxSchema

      Schema getJavaxSchema()
    • getJavaxSchemaValidator

      Validator getJavaxSchemaValidator()
    • getPrismSchema

      PrismSchema getPrismSchema(String namespace)
    • getSchemas

      Collection<PrismSchema> getSchemas()
    • getSchemaDescriptions

      Collection<SchemaDescription> getSchemaDescriptions()
    • getCompileTimePackages

      Collection<Package> getCompileTimePackages()
    • locateItemDefinition

      ItemDefinition locateItemDefinition(@NotNull @NotNull QName itemName, @Nullable @Nullable ComplexTypeDefinition complexTypeDefinition, @Nullable @Nullable Function<QName,ItemDefinition> dynamicDefinitionResolver)
    • resolveUnqualifiedTypeName

      QName resolveUnqualifiedTypeName(QName type) throws SchemaException
      Throws:
      SchemaException
    • qualifyTypeName

      QName qualifyTypeName(QName typeName) throws SchemaException
      Throws:
      SchemaException
    • determineParentDefinition

      ComplexTypeDefinition determineParentDefinition(@NotNull @NotNull ComplexTypeDefinition child, @NotNull @NotNull ItemPath rest)
    • determineReferencedObjectDefinition

      PrismObjectDefinition determineReferencedObjectDefinition(@NotNull @NotNull QName targetTypeName, ItemPath rest)
    • getCompileTimeClassForObjectType

      Class<? extends ObjectType> getCompileTimeClassForObjectType(QName objectType)
    • getCompileTimeClassForObjectTypeRequired

      @NotNull default @NotNull Class<? extends ObjectType> getCompileTimeClassForObjectTypeRequired(@NotNull @NotNull QName objectType)
    • findItemDefinitionByElementName

      ItemDefinition findItemDefinitionByElementName(QName elementName, @Nullable @Nullable List<String> ignoredNamespaces)
    • determineCompileTimeClass

      <T> Class<T> determineCompileTimeClass(QName typeName)
    • getCompileTimeClass

      <T> Class<T> getCompileTimeClass(QName xsdType)
    • findSchemaByCompileTimeClass

      PrismSchema findSchemaByCompileTimeClass(@NotNull @NotNull Class<?> compileTimeClass)
    • determineTypeForClass

      QName determineTypeForClass(Class<?> clazz)
      Tries to determine type name for any class (primitive, complex one). Does not use schemas (TODO explanation)
      Parameters:
      clazz -
      Returns:
    • determineTypeForClassRequired

      @NotNull default @NotNull QName determineTypeForClassRequired(Class<?> clazz)
    • applyDefinition

      <C extends Containerable> void applyDefinition(PrismContainer<C> container, Class<C> type) throws SchemaException
      This method will try to locate the appropriate object definition and apply it.
      Parameters:
      container -
      type -
      Throws:
      SchemaException
    • applyDefinition

      <C extends Containerable> void applyDefinition(PrismContainer<C> prismObject, Class<C> type, boolean force) throws SchemaException
      Throws:
      SchemaException
    • applyDefinition

      <T extends Objectable> void applyDefinition(ObjectDelta<T> objectDelta, Class<T> type, boolean force) throws SchemaException
      Throws:
      SchemaException
    • applyDefinition

      <C extends Containerable, O extends Objectable> void applyDefinition(PrismContainerValue<C> prismContainerValue, Class<O> type, ItemPath path, boolean force) throws SchemaException
      Throws:
      SchemaException
    • applyDefinition

      <C extends Containerable> void applyDefinition(PrismContainerValue<C> prismContainerValue, QName typeName, ItemPath path, boolean force) throws SchemaException
      Throws:
      SchemaException
    • findItemDefinitionByFullPath

      <T extends ItemDefinition> T findItemDefinitionByFullPath(Class<? extends Objectable> objectClass, Class<T> defClass, QName... itemNames) throws SchemaException
      Throws:
      SchemaException
    • findSchemaByNamespace

      PrismSchema findSchemaByNamespace(String namespaceURI)
    • findSchemaDescriptionByNamespace

      SchemaDescription findSchemaDescriptionByNamespace(String namespaceURI)
    • findSchemaByPrefix

      PrismSchema findSchemaByPrefix(String prefix)
    • findSchemaDescriptionByPrefix

      SchemaDescription findSchemaDescriptionByPrefix(String prefix)
    • determineDefinitionFromClass

      PrismObjectDefinition determineDefinitionFromClass(Class type)
    • getValueMetadataDefinition

      @NotNull @NotNull PrismContainerDefinition<?> getValueMetadataDefinition()
    • hasImplicitTypeDefinition

      boolean hasImplicitTypeDefinition(@NotNull @NotNull QName itemName, @NotNull @NotNull QName typeName)
    • resolveGlobalItemDefinition

      ItemDefinition resolveGlobalItemDefinition(QName itemName, @Nullable @Nullable ComplexTypeDefinition complexTypeDefinition)
    • determineClassForType

      <T> Class<T> determineClassForType(QName type)
    • determineClassForTypeRequired

      default <T> Class<T> determineClassForTypeRequired(QName type, Class<T> expected)
    • determineClassForTypeRequired

      default <T> Class<T> determineClassForTypeRequired(QName type)
    • determineClassForItemDefinition

      Class<?> determineClassForItemDefinition(ItemDefinition<?> itemDefinition)
    • selectMoreSpecific

      <ID extends ItemDefinition> ID selectMoreSpecific(ID def1, ID def2) throws SchemaException
      Throws:
      SchemaException
    • selectMoreSpecific

      QName selectMoreSpecific(@Nullable @Nullable QName type1, @Nullable @Nullable QName type2) throws SchemaException
      Selects the type that is more specific of the two. For example, if the input is `FocusType` and `UserType`, the output is `UserType`. Returns `null` if there's no such type. Limitations/specific handling: - Assumes both types have compile-time representation. May return `null` if that's not true. - The treatment of `PolyStringType` vs `String` is rather strange. Should be reviewed. FIXME
      Throws:
      SchemaException
    • isContainerable

      boolean isContainerable(QName typeName)
      Returns:
      true if the typeName corresponds to statically-typed class that is Containerable. TODO The utility of this method is questionable. Reconsider its removal/update.
    • findTypeDefinitionsByElementName

      @NotNull <TD extends TypeDefinition> @NotNull Collection<TD> findTypeDefinitionsByElementName(@NotNull @NotNull QName name, @NotNull @NotNull Class<TD> clazz)
    • isList

      @NotNull @NotNull SchemaRegistry.IsList isList(@Nullable @Nullable QName xsiType, @NotNull @NotNull QName elementName)
      Checks whether element with given (declared) xsi:type and name can be a heterogeneous list.
      Returns:
      YES if it is a list, NO if it's not, MAYBE if it probably is a list but some further content-based checks are needed
    • compareDefinitions

      <ID extends ItemDefinition> SchemaRegistry.ComparisonResult compareDefinitions(@NotNull ID def1, @NotNull ID def2) throws SchemaException
      Returns:
      null means we cannot decide (types are different, and no compile time class for def1 and/or def2)
      Throws:
      SchemaException
    • isAssignableFrom

      boolean isAssignableFrom(@NotNull @NotNull Class<?> superType, @NotNull @NotNull QName subType)
      BEWARE: works only with statically-defined types!
    • isAssignableFrom

      boolean isAssignableFrom(@NotNull @NotNull QName superType, @NotNull @NotNull QName subType)
      BEWARE: works only with statically-defined types!
    • isAssignableFromGeneral

      @Experimental boolean isAssignableFromGeneral(@NotNull @NotNull QName superType, @NotNull @NotNull QName subType)
      Crawls through the type definition tree. May be slower.
    • unifyTypes

      QName unifyTypes(QName type1, QName type2)
      Returns most specific common supertype for these two. If any of input params is null, it means it is ignored. FIXME is the implementation correct regarding this spec? E.g. for `UserType` and `RoleType` it should return `FocusType` but it returns `null` instead!
      Returns:
      null if unification cannot be done (or if both input types are null)
    • createAdHocDefinition

      ItemDefinition<?> createAdHocDefinition(QName elementName, QName typeName, int minOccurs, int maxOccurs)