Class SchemaRegistryImpl
java.lang.Object
com.evolveum.midpoint.prism.impl.schema.SchemaRegistryImpl
- All Implemented Interfaces:
DefinitionsStore
,GlobalDefinitionsStore
,SchemaLookup
,SchemaRegistry
,SchemaRegistryState
,DebugDumpable
- Direct Known Subclasses:
AxiomEnabledSchemaRegistry
public class SchemaRegistryImpl
extends Object
implements DebugDumpable, SchemaRegistry, SchemaLookup
Registry and resolver of schema files and resources.
- Author:
- Radovan Semancik
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.evolveum.midpoint.prism.schema.SchemaLookup
SchemaLookup.Aware, SchemaLookup.Based, SchemaLookup.Mutable
Nested classes/interfaces inherited from interface com.evolveum.midpoint.prism.schema.SchemaRegistry
SchemaRegistry.ComparisonResult, SchemaRegistry.InvalidationListener
Nested classes/interfaces inherited from interface com.evolveum.midpoint.prism.schema.SchemaRegistryState
SchemaRegistryState.DerivationKey<R>, SchemaRegistryState.IsList
-
Field Summary
Modifier and TypeFieldDescriptionprotected PrismContext
A prism context this schema registry is part of.Fields inherited from interface com.evolveum.midpoint.util.DebugDumpable
INDENT_STRING
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription<O extends Objectable>
voidapplyDefinition
(ObjectDelta<O> objectDelta, Class<O> compileTimeClass, boolean force) <C extends Containerable>
voidapplyDefinition
(PrismContainer<C> container, Class<C> type) This method will try to locate the appropriate object definition and apply it.<C extends Containerable>
voidapplyDefinition
(PrismContainer<C> container, Class<C> compileTimeClass, boolean force) <C extends Containerable,
O extends Objectable>
voidapplyDefinition
(PrismContainerValue<C> prismContainerValue, Class<O> compileTimeClass, ItemPath path, boolean force) <C extends Containerable>
voidapplyDefinition
(PrismContainerValue<C> prismContainerValue, QName typeName, ItemPath path, boolean force) <ID extends ItemDefinition>
SchemaRegistry.ComparisonResultcompareDefinitions
(ID def1, ID def2) createAdHocDefinition
(QName elementName, QName typeName, int minOccurs, int maxOccurs) void
debugDump
(int indent) Class<?>
determineClassForItemDefinition
(ItemDefinition<?> itemDefinition) <T> Class<T>
determineClassForType
(QName type) <T> Class<T>
<T> Class<T>
determineCompileTimeClassInternal
(QName type, boolean cacheAlsoNegativeResults) determineDefinitionFromClass
(Class compileTimeClass) determineParentDefinition
(@NotNull ComplexTypeDefinition child, @NotNull ItemPath rest) determineReferencedObjectDefinition
(@NotNull QName targetTypeName, ItemPath rest) determineTypeForClass
(Class<?> clazz) Tries to determine type name for any class (primitive, complex one).boolean
findItemDefinitionByElementName
(QName elementName, @Nullable List<String> ignoredNamespaces) <T extends ItemDefinition>
TfindItemDefinitionByFullPath
(Class<? extends Objectable> objectClass, Class<T> defClass, QName... itemNames) <ID extends ItemDefinition>
IDfindItemDefinitionByType
(@NotNull QName typeName, @NotNull Class<ID> definitionClass) Looking up item definition by type name.<ID extends ItemDefinition>
@NotNull List<ID>findItemDefinitionsByCompileTimeClass
(@NotNull Class<?> compileTimeClass, @NotNull Class<ID> definitionClass) Looking up item definitions by compile-time class.<ID extends ItemDefinition>
@NotNull List<ID>findItemDefinitionsByElementName
(@NotNull QName elementName, @NotNull Class<ID> definitionClass) Looking up item definitions by element name.<O extends Objectable>
PrismObjectDefinition<O>findObjectDefinitionByCompileTimeClass
(@NotNull Class<O> compileTimeClass) <O extends Objectable>
PrismObjectDefinition<O>findObjectDefinitionByType
(@NotNull QName typeName) findSchemaByCompileTimeClass
(@NotNull Class<?> compileTimeClass) findSchemaByNamespace
(String namespaceURI) findSchemaDescriptionByNamespace
(String namespaceURI) findSchemaDescriptionByPrefix
(String prefix) <TD extends TypeDefinition>
TDfindTypeDefinitionByCompileTimeClass
(@NotNull Class<?> compileTimeClass, @NotNull Class<TD> definitionClass) <TD extends TypeDefinition>
TDfindTypeDefinitionByType
(@NotNull QName typeName, @NotNull Class<TD> definitionClass) <TD extends TypeDefinition>
@NotNull Collection<? extends TD>findTypeDefinitionsByType
(@NotNull QName typeName, @NotNull Class<TD> definitionClass) getAllSubTypesByTypeDefinition
(List<TypeDefinition> typeDefinitions) File[]
Class<? extends ObjectType>
getCompileTimeClassForObjectType
(QName objectType) <R,
E extends Exception>
RgetDerivedObject
(SchemaRegistryState.DerivationKey<R> derivationKey, CheckedFunction<SchemaRegistryState, R, E> mapping) Returns derived value specific to this schema context state, supplied derivation key and mapping.Don't use it for edit of mapper.org.apache.commons.collections4.MultiValuedMap<String,
SchemaDescription> getPrismSchema
(String namespace) @NotNull PrismContainerDefinition<?>
boolean
hasImplicitTypeDefinition
(@NotNull QName itemName, @NotNull QName typeName) Answers the question: "If the receiver would get itemName without any other information, will it be able to derive suitable typeName from it?" If not, we have to provide explicit type definition for serialization.void
This can be used to read additional schemas even after the registry was initialized.boolean
isAssignableFrom
(@NotNull Class<?> superClass, @NotNull QName subType) BEWARE: works only with statically-defined types!boolean
isAssignableFrom
(@NotNull QName superType, @NotNull QName subType) BEWARE: works only with statically-defined types!boolean
isAssignableFromGeneral
(@NotNull QName superType, @NotNull QName subType) Crawls through the type definition tree.boolean
isContainerable
(QName typeName) @NotNull SchemaRegistryState.IsList
Checks whether element with given (declared) xsi:type and name can be a heterogeneous list.protected void
void
loadPrismSchemaResource
(String resourcePath) locateItemDefinition
(@NotNull QName itemName, @Nullable QName explicitTypeName, @Nullable ComplexTypeDefinition complexTypeDefinition, @Nullable Function<QName, ItemDefinition> dynamicDefinitionProvider) protected void
parseAdditionalSchemas
(SchemaRegistryState schemaRegistryStateLocale) qualifyTypeName
(QName typeName) void
registerDynamicSchemaExtensions
(Map<String, Element> dynamicSchemaExtensions) void
void
registerPrismDefaultSchemaResource
(String resourcePath, String usualPrefix, Package compileTimeClassesPackage) Must be called before call to initialize()void
registerPrismSchema
(InputStream input, String sourceDescription) void
registerPrismSchemaFile
(File file) void
registerPrismSchemaResource
(String resourcePath, String usualPrefix) Must be called before call to initialize()void
registerPrismSchemaResource
(String resourcePath, String usualPrefix, Package compileTimeClassesPackage) Must be called before call to initialize()void
registerPrismSchemaResource
(String resourcePath, String usualPrefix, Package compileTimeClassesPackage, boolean prefixDeclaredByDefault) Must be called before call to initialize()void
registerPrismSchemasFromDirectory
(File directory) void
registerPrismSchemasFromDirectory
(File directory, @NotNull Collection<String> extensionFilesToIgnore) protected void
registerPrismSchemasFromWsdl
(String resourcePath, List<SchemaDescriptionImpl> descriptions, List<Package> compileTimeClassesPackages) void
registerPrismSchemasFromWsdlResource
(String resourcePath, List<Package> compileTimeClassesPackages) void
registerSchema
(Node node, String sourceDescription) Must be called before call to initialize()void
registerSchemaResource
(String resourcePath, String usualPrefix) Must be called before call to initialize()void
registerStaticNamespace
(String ns, String prefix, boolean declaredByDefault) void
registerWsdlSchemaFile
(File file) void
reload()
resolveGlobalItemDefinition
(QName itemName, @Nullable ComplexTypeDefinition complexTypeDefinition) resolverFor
(SchemaContextDefinition schemaContextDefinition) <T extends SchemaLookup.Based>
TschemaSpecific
(@NotNull Class<T> type) Returns schema-specific service<ID extends ItemDefinition>
IDselectMoreSpecific
(ID def1, ID def2) selectMoreSpecific
(QName type1, QName type2) Selects the type that is more specific of the two.void
setCatalogFiles
(File[] catalogFiles) void
setCatalogResourceName
(String catalogResourceName) void
setDefaultNamespace
(String defaultNamespace) Must be called before call to initialize()void
setNamespacePrefixMapper
(DynamicNamespacePrefixMapper namespacePrefixMapper) Must be called before call to initialize()void
setPrismContext
(@NotNull PrismContext prismContext) void
setValueMetadataTypeName
(QName typeName) Must be called before call to initialize()unifyTypes
(QName type1, QName type2) Returns most specific common supertype for these two.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.evolveum.midpoint.util.DebugDumpable
debugDump, debugDumpLazily, debugDumpLazily
Methods inherited from interface com.evolveum.midpoint.prism.schema.GlobalDefinitionsStore
findComplexTypeDefinitionByCompileTimeClass, findComplexTypeDefinitionByType, findContainerDefinitionByCompileTimeClass, findContainerDefinitionByElementName, findContainerDefinitionByType, findItemDefinitionByCompileTimeClass, findItemDefinitionByElementName, findItemDefinitionByElementName, findItemDefinitionByType, findItemDefinitionsByElementName, findObjectDefinitionByElementName, findPropertyDefinitionByElementName, findReferenceDefinitionByElementName, findSimpleTypeDefinitionByType, findTypeDefinitionByType, findTypeDefinitionsByElementName, findTypeDefinitionsByType
Methods inherited from interface com.evolveum.midpoint.prism.schema.SchemaRegistry
determineClassForTypeRequired, determineClassForTypeRequired, determineJavaClassForType, determineTypeForClassRequired, getCompileTimeClass, getCompileTimeClassForObjectTypeRequired
-
Field Details
-
prismContext
A prism context this schema registry is part of. Should be non-null.
-
-
Constructor Details
-
SchemaRegistryImpl
public SchemaRegistryImpl()
-
-
Method Details
-
getNamespacePrefixMapper
Don't use it for edit of mapper. For editing of mapper usecustomizeNamespacePrefixMapper(java.util.function.Consumer<com.evolveum.midpoint.prism.xml.DynamicNamespacePrefixMapper>)
- Specified by:
getNamespacePrefixMapper
in interfaceSchemaRegistryState
-
customizeNamespacePrefixMapper
- Specified by:
customizeNamespacePrefixMapper
in interfaceSchemaRegistry
-
setNamespacePrefixMapper
Must be called before call to initialize() -
registerInvalidationListener
- Specified by:
registerInvalidationListener
in interfaceSchemaRegistry
-
setPrismContext
-
getEntityResolver
-
getParsedSchemas
-
getBuiltinSchemaResolver
-
getCatalogFiles
-
setCatalogFiles
-
getCatalogResourceName
-
setCatalogResourceName
-
getDefaultNamespace
- Specified by:
getDefaultNamespace
in interfaceSchemaRegistry
-
setDefaultNamespace
Must be called before call to initialize() -
registerSchemaResource
Must be called before call to initialize()- Throws:
SchemaException
-
registerPrismSchemaResource
public void registerPrismSchemaResource(String resourcePath, String usualPrefix) throws SchemaException Must be called before call to initialize()- Throws:
SchemaException
-
registerWsdlSchemaFile
- Throws:
SchemaException
FileNotFoundException
-
registerPrismSchemasFromWsdlResource
public void registerPrismSchemasFromWsdlResource(String resourcePath, List<Package> compileTimeClassesPackages) throws SchemaException - Throws:
SchemaException
-
registerPrismSchemasFromWsdl
protected void registerPrismSchemasFromWsdl(String resourcePath, List<SchemaDescriptionImpl> descriptions, List<Package> compileTimeClassesPackages) throws SchemaException - Throws:
SchemaException
-
registerPrismSchemaResource
public void registerPrismSchemaResource(String resourcePath, String usualPrefix, Package compileTimeClassesPackage) throws SchemaException Must be called before call to initialize()- Throws:
SchemaException
-
registerPrismSchemaResource
public void registerPrismSchemaResource(String resourcePath, String usualPrefix, Package compileTimeClassesPackage, boolean prefixDeclaredByDefault) throws SchemaException Must be called before call to initialize()- Throws:
SchemaException
-
registerPrismDefaultSchemaResource
public void registerPrismDefaultSchemaResource(String resourcePath, String usualPrefix, Package compileTimeClassesPackage) throws SchemaException Must be called before call to initialize()- Throws:
SchemaException
-
registerSchema
Must be called before call to initialize()- Throws:
SchemaException
-
registerPrismSchemaFile
- Throws:
IOException
SchemaException
-
registerPrismSchema
- Throws:
SchemaException
-
loadPrismSchemaFileDescription
- Throws:
SchemaException
IOException
-
registerPrismSchemasFromDirectory
- Throws:
IOException
SchemaException
-
registerPrismSchemasFromDirectory
public void registerPrismSchemasFromDirectory(File directory, @NotNull @NotNull Collection<String> extensionFilesToIgnore) throws IOException, SchemaException - Throws:
IOException
SchemaException
-
loadPrismSchemaResource
- Throws:
SchemaException
-
reload
- Specified by:
reload
in interfaceSchemaRegistry
- Throws:
SchemaException
-
initialize
This can be used to read additional schemas even after the registry was initialized.- Specified by:
initialize
in interfaceSchemaRegistry
- Throws:
SAXException
IOException
SchemaException
-
parseAdditionalSchemas
protected void parseAdditionalSchemas(SchemaRegistryState schemaRegistryStateLocale) throws SchemaException - Throws:
SchemaException
-
getJavaxSchema
- Specified by:
getJavaxSchema
in interfaceSchemaRegistryState
-
getJavaxSchemaValidator
- Specified by:
getJavaxSchemaValidator
in interfaceSchemaRegistry
-
getCompileTimePackages
- Specified by:
getCompileTimePackages
in interfaceSchemaRegistryState
-
debugDump
- Specified by:
debugDump
in interfaceDebugDumpable
-
applyDefinition
public <C extends Containerable> void applyDefinition(PrismContainer<C> container, Class<C> type) throws SchemaException Description copied from interface:SchemaRegistry
This method will try to locate the appropriate object definition and apply it.- Specified by:
applyDefinition
in interfaceSchemaRegistry
- Throws:
SchemaException
-
applyDefinition
public <C extends Containerable> void applyDefinition(PrismContainer<C> container, Class<C> compileTimeClass, boolean force) throws SchemaException - Specified by:
applyDefinition
in interfaceSchemaRegistry
- Throws:
SchemaException
-
applyDefinition
public <O extends Objectable> void applyDefinition(ObjectDelta<O> objectDelta, Class<O> compileTimeClass, boolean force) throws SchemaException - Specified by:
applyDefinition
in interfaceSchemaRegistry
- Throws:
SchemaException
-
applyDefinition
public <C extends Containerable,O extends Objectable> void applyDefinition(PrismContainerValue<C> prismContainerValue, Class<O> compileTimeClass, ItemPath path, boolean force) throws SchemaException - Specified by:
applyDefinition
in interfaceSchemaRegistry
- Throws:
SchemaException
-
applyDefinition
public <C extends Containerable> void applyDefinition(PrismContainerValue<C> prismContainerValue, QName typeName, ItemPath path, boolean force) throws SchemaException - Specified by:
applyDefinition
in interfaceSchemaRegistry
- Throws:
SchemaException
-
findItemDefinitionsByCompileTimeClass
@NotNull public <ID extends ItemDefinition> @NotNull List<ID> findItemDefinitionsByCompileTimeClass(@NotNull @NotNull Class<?> compileTimeClass, @NotNull @NotNull Class<ID> definitionClass) Description copied from interface:GlobalDefinitionsStore
Looking up item definitions by compile-time class. So, for example having AssignmentType.class we try to find a definition of "assignment" item. BEWARE. This method is unsound. There might be many items of AssignmentType.class.- Specified by:
findItemDefinitionsByCompileTimeClass
in interfaceGlobalDefinitionsStore
-
findItemDefinitionByType
@Nullable public <ID extends ItemDefinition> ID findItemDefinitionByType(@NotNull @NotNull QName typeName, @NotNull @NotNull Class<ID> definitionClass) Description copied from interface:GlobalDefinitionsStore
Looking up item definition by type name. So, for example having c:AssignmentType we try to find a definition of "assignment" item. BEWARE. This method is unsound. There might be many items with c:AssignmentType type.- Specified by:
findItemDefinitionByType
in interfaceGlobalDefinitionsStore
-
findItemDefinitionsByElementName
@NotNull public <ID extends ItemDefinition> @NotNull List<ID> findItemDefinitionsByElementName(@NotNull @NotNull QName elementName, @NotNull @NotNull Class<ID> definitionClass) Description copied from interface:GlobalDefinitionsStore
Looking up item definitions by element name. The name can be qualified or unqualified. In the latter case there can be more than one definition returned.- Specified by:
findItemDefinitionsByElementName
in interfaceGlobalDefinitionsStore
-
findTypeDefinitionByCompileTimeClass
@Nullable public <TD extends TypeDefinition> TD findTypeDefinitionByCompileTimeClass(@NotNull @NotNull Class<?> compileTimeClass, @NotNull @NotNull Class<TD> definitionClass) - Specified by:
findTypeDefinitionByCompileTimeClass
in interfaceGlobalDefinitionsStore
-
findTypeDefinitionByType
@Nullable public <TD extends TypeDefinition> TD findTypeDefinitionByType(@NotNull @NotNull QName typeName, @NotNull @NotNull Class<TD> definitionClass) - Specified by:
findTypeDefinitionByType
in interfaceGlobalDefinitionsStore
-
findTypeDefinitionsByType
@NotNull public <TD extends TypeDefinition> @NotNull Collection<? extends TD> findTypeDefinitionsByType(@NotNull @NotNull QName typeName, @NotNull @NotNull Class<TD> definitionClass) - Specified by:
findTypeDefinitionsByType
in interfaceGlobalDefinitionsStore
-
findObjectDefinitionByCompileTimeClass
@Experimental public <O extends Objectable> PrismObjectDefinition<O> findObjectDefinitionByCompileTimeClass(@NotNull @NotNull Class<O> compileTimeClass) - Specified by:
findObjectDefinitionByCompileTimeClass
in interfaceGlobalDefinitionsStore
-
findObjectDefinitionByType
public <O extends Objectable> PrismObjectDefinition<O> findObjectDefinitionByType(@NotNull @NotNull QName typeName) - Specified by:
findObjectDefinitionByType
in interfaceGlobalDefinitionsStore
-
findItemDefinitionByFullPath
public <T extends ItemDefinition> T findItemDefinitionByFullPath(Class<? extends Objectable> objectClass, Class<T> defClass, QName... itemNames) throws SchemaException - Specified by:
findItemDefinitionByFullPath
in interfaceSchemaRegistry
- Throws:
SchemaException
-
findItemDefinitionByElementName
public ItemDefinition findItemDefinitionByElementName(QName elementName, @Nullable @Nullable List<String> ignoredNamespaces) - Specified by:
findItemDefinitionByElementName
in interfaceSchemaRegistry
-
getCompileTimeClassForObjectType
- Specified by:
getCompileTimeClassForObjectType
in interfaceSchemaRegistry
-
determineDefinitionFromClass
- Specified by:
determineDefinitionFromClass
in interfaceSchemaRegistry
-
locateItemDefinition
public ItemDefinition locateItemDefinition(@NotNull @NotNull QName itemName, @Nullable @Nullable QName explicitTypeName, @Nullable @Nullable ComplexTypeDefinition complexTypeDefinition, @Nullable @Nullable Function<QName, ItemDefinition> dynamicDefinitionProvider) - Specified by:
locateItemDefinition
in interfaceSchemaRegistry
-
resolveUnqualifiedTypeName
- Specified by:
resolveUnqualifiedTypeName
in interfaceSchemaRegistryState
- Throws:
SchemaException
-
qualifyTypeName
- Specified by:
qualifyTypeName
in interfaceSchemaRegistry
- Throws:
SchemaException
-
determineParentDefinition
public ComplexTypeDefinition determineParentDefinition(@NotNull @NotNull ComplexTypeDefinition child, @NotNull @NotNull ItemPath rest) - Specified by:
determineParentDefinition
in interfaceSchemaRegistryState
-
determineReferencedObjectDefinition
public PrismObjectDefinition determineReferencedObjectDefinition(@NotNull @NotNull QName targetTypeName, ItemPath rest) - Specified by:
determineReferencedObjectDefinition
in interfaceSchemaRegistry
-
resolveGlobalItemDefinition
public ItemDefinition resolveGlobalItemDefinition(QName itemName, @Nullable @Nullable ComplexTypeDefinition complexTypeDefinition) - Specified by:
resolveGlobalItemDefinition
in interfaceSchemaRegistry
-
getPrismSchema
- Specified by:
getPrismSchema
in interfaceSchemaRegistryState
-
getSchemas
- Specified by:
getSchemas
in interfaceSchemaRegistryState
-
getSchemaDescriptions
- Specified by:
getSchemaDescriptions
in interfaceSchemaRegistry
-
findSchemaByCompileTimeClass
- Specified by:
findSchemaByCompileTimeClass
in interfaceSchemaRegistryState
-
findSchemaByNamespace
- Specified by:
findSchemaByNamespace
in interfaceSchemaRegistryState
-
findSchemaDescriptionByNamespace
- Specified by:
findSchemaDescriptionByNamespace
in interfaceSchemaRegistryState
-
findSchemaDescriptionByPrefix
- Specified by:
findSchemaDescriptionByPrefix
in interfaceSchemaRegistryState
-
isList
@NotNull public @NotNull SchemaRegistryState.IsList isList(@Nullable @Nullable QName xsiType, @NotNull @NotNull QName elementName) Description copied from interface:SchemaRegistryState
Checks whether element with given (declared) xsi:type and name can be a heterogeneous list.- Specified by:
isList
in interfaceSchemaRegistryState
- 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
-
setValueMetadataTypeName
Must be called before call to initialize() -
getValueMetadataDefinition
- Specified by:
getValueMetadataDefinition
in interfaceSchemaRegistry
-
hasImplicitTypeDefinition
public boolean hasImplicitTypeDefinition(@NotNull @NotNull QName itemName, @NotNull @NotNull QName typeName) Answers the question: "If the receiver would get itemName without any other information, will it be able to derive suitable typeName from it?" If not, we have to provide explicit type definition for serialization.By suitable we mean such that can be used to determine specific object type.
- Specified by:
hasImplicitTypeDefinition
in interfaceSchemaRegistry
-
determineTypeForClass
Description copied from interface:SchemaRegistry
Tries to determine type name for any class (primitive, complex one). Does not use schemas (TODO explanation)- Specified by:
determineTypeForClass
in interfaceSchemaRegistry
- Returns:
-
determineClassForType
- Specified by:
determineClassForType
in interfaceSchemaRegistryState
-
determineCompileTimeClass
- Specified by:
determineCompileTimeClass
in interfaceSchemaRegistryState
-
determineCompileTimeClassInternal
- Specified by:
determineCompileTimeClassInternal
in interfaceSchemaRegistryState
-
determineClassForItemDefinition
- Specified by:
determineClassForItemDefinition
in interfaceSchemaRegistry
-
selectMoreSpecific
- Specified by:
selectMoreSpecific
in interfaceSchemaRegistry
- Throws:
SchemaException
-
selectMoreSpecific
Description copied from interface:SchemaRegistry
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- Specified by:
selectMoreSpecific
in interfaceSchemaRegistry
-
compareDefinitions
public <ID extends ItemDefinition> SchemaRegistry.ComparisonResult compareDefinitions(@NotNull ID def1, @NotNull ID def2) - Specified by:
compareDefinitions
in interfaceSchemaRegistry
- Returns:
- null means we cannot decide (types are different, and no compile time class for def1 and/or def2)
-
isAssignableFrom
Description copied from interface:SchemaRegistry
BEWARE: works only with statically-defined types!- Specified by:
isAssignableFrom
in interfaceSchemaRegistry
-
isAssignableFromGeneral
public boolean isAssignableFromGeneral(@NotNull @NotNull QName superType, @NotNull @NotNull QName subType) Description copied from interface:SchemaRegistry
Crawls through the type definition tree. May be slower.- Specified by:
isAssignableFromGeneral
in interfaceSchemaRegistry
-
isAssignableFrom
public boolean isAssignableFrom(@NotNull @NotNull Class<?> superClass, @NotNull @NotNull QName subType) Description copied from interface:SchemaRegistry
BEWARE: works only with statically-defined types!- Specified by:
isAssignableFrom
in interfaceSchemaRegistry
-
unifyTypes
Description copied from interface:SchemaRegistry
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!- Specified by:
unifyTypes
in interfaceSchemaRegistry
- Returns:
- null if unification cannot be done (or if both input types are null)
-
isContainerable
- Specified by:
isContainerable
in interfaceSchemaRegistry
- 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.
-
createAdHocDefinition
public ItemDefinition<?> createAdHocDefinition(QName elementName, QName typeName, int minOccurs, int maxOccurs) - Specified by:
createAdHocDefinition
in interfaceSchemaRegistry
-
getValueMetadataTypeName
-
staticNamespaceContext
- Specified by:
staticNamespaceContext
in interfaceSchemaRegistry
-
registerDynamicSchemaExtensions
public void registerDynamicSchemaExtensions(Map<String, Element> dynamicSchemaExtensions) throws SchemaException- Specified by:
registerDynamicSchemaExtensions
in interfaceSchemaRegistry
- Throws:
SchemaException
-
existDynamicSchemaExtensions
public boolean existDynamicSchemaExtensions()- Specified by:
existDynamicSchemaExtensions
in interfaceSchemaRegistry
-
registerStaticNamespace
-
getAllSubTypesByTypeDefinition
- Specified by:
getAllSubTypesByTypeDefinition
in interfaceSchemaRegistry
-
getDerivedObject
public <R,E extends Exception> R getDerivedObject(SchemaRegistryState.DerivationKey<R> derivationKey, CheckedFunction<SchemaRegistryState, R, throws EE> mapping) Description copied from interface:SchemaRegistryState
Returns derived value specific to this schema context state, supplied derivation key and mapping. Returns cached value if it was already computed and is available. If value is not available, it is computed by supplied mapping function. Do not use for short-lived values. Use-cases should be like caching parser instances with already done lookups for repository or other long-lived components, which needs to be recomputed when schemas are changed.- Specified by:
getDerivedObject
in interfaceSchemaRegistryState
- Returns:
- Throws:
E
-
resolverFor
- Specified by:
resolverFor
in interfaceSchemaLookup
-
definitionFactory
- Specified by:
definitionFactory
in interfaceSchemaLookup
-
getCurrentLookup
- Specified by:
getCurrentLookup
in interfaceSchemaRegistry
-
schemaSpecific
Description copied from interface:SchemaLookup
Returns schema-specific service- Specified by:
schemaSpecific
in interfaceSchemaLookup
- Type Parameters:
T
- Type of schema specific service- Returns:
- Requested service or null, if service is not available.
-