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.MutableNested classes/interfaces inherited from interface com.evolveum.midpoint.prism.schema.SchemaRegistry
SchemaRegistry.ComparisonResult, SchemaRegistry.InvalidationListenerNested classes/interfaces inherited from interface com.evolveum.midpoint.prism.schema.SchemaRegistryState
SchemaRegistryState.DerivationKey<R>, SchemaRegistryState.IsList -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected PrismContextA prism context this schema registry is part of.Fields inherited from interface com.evolveum.midpoint.util.DebugDumpable
INDENT_STRING -
Constructor Summary
Constructors -
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) voiddebugDump(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).booleanfindItemDefinitionByElementName(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<?>booleanhasImplicitTypeDefinition(@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?"voidThis can be used to read additional schemas even after the registry was initialized.booleanisAssignableFrom(@NotNull Class<?> superClass, @NotNull QName subType) BEWARE: works only with statically-defined types!booleanisAssignableFrom(@NotNull QName superType, @NotNull QName subType) BEWARE: works only with statically-defined types!booleanisAssignableFromGeneral(@NotNull QName superType, @NotNull QName subType) Crawls through the type definition tree.booleanisContainerable(QName typeName) @NotNull SchemaRegistryState.IsListChecks whether element with given (declared) xsi:type and name can be a heterogeneous list.protected voidvoidloadPrismSchemaResource(String resourcePath) locateItemDefinition(@NotNull QName itemName, @Nullable QName explicitTypeName, @Nullable ComplexTypeDefinition complexTypeDefinition, @Nullable Function<QName, ItemDefinition> dynamicDefinitionProvider) protected voidparseAdditionalSchemas(SchemaRegistryState schemaRegistryStateLocale) qualifyTypeName(QName typeName) voidregisterDynamicSchemaExtensions(Map<String, Element> dynamicSchemaExtensions) voidvoidregisterPrismDefaultSchemaResource(String resourcePath, String usualPrefix, Package compileTimeClassesPackage) Must be called before call to initialize()voidregisterPrismSchema(InputStream input, String sourceDescription) voidregisterPrismSchemaFile(File file) voidregisterPrismSchemaResource(String resourcePath, String usualPrefix) Must be called before call to initialize()voidregisterPrismSchemaResource(String resourcePath, String usualPrefix, Package compileTimeClassesPackage) Must be called before call to initialize()voidregisterPrismSchemaResource(String resourcePath, String usualPrefix, Package compileTimeClassesPackage, boolean prefixDeclaredByDefault) Must be called before call to initialize()voidregisterPrismSchemasFromDirectory(File directory) voidregisterPrismSchemasFromDirectory(File directory, @NotNull Collection<String> extensionFilesToIgnore) protected voidregisterPrismSchemasFromWsdl(String resourcePath, List<SchemaDescriptionImpl> descriptions, List<Package> compileTimeClassesPackages) voidregisterPrismSchemasFromWsdlResource(String resourcePath, List<Package> compileTimeClassesPackages) voidregisterSchema(Node node, String sourceDescription) Must be called before call to initialize()voidregisterSchemaResource(String resourcePath, String usualPrefix) Must be called before call to initialize()voidregisterStaticNamespace(String ns, String prefix, boolean declaredByDefault) voidregisterWsdlSchemaFile(File file) voidreload()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.voidsetCatalogFiles(File[] catalogFiles) voidsetCatalogResourceName(String catalogResourceName) voidsetDefaultNamespace(String defaultNamespace) Must be called before call to initialize()voidsetNamespacePrefixMapper(DynamicNamespacePrefixMapper namespacePrefixMapper) Must be called before call to initialize()voidsetPrismContext(@NotNull PrismContext prismContext) voidsetValueMetadataTypeName(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, waitMethods inherited from interface com.evolveum.midpoint.util.DebugDumpable
debugDump, debugDumpLazily, debugDumpLazilyMethods 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, findTypeDefinitionsByTypeMethods 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:
getNamespacePrefixMapperin interfaceSchemaRegistryState
-
customizeNamespacePrefixMapper
- Specified by:
customizeNamespacePrefixMapperin interfaceSchemaRegistry
-
setNamespacePrefixMapper
Must be called before call to initialize() -
registerInvalidationListener
- Specified by:
registerInvalidationListenerin interfaceSchemaRegistry
-
setPrismContext
-
getEntityResolver
-
getParsedSchemas
-
getBuiltinSchemaResolver
-
getCatalogFiles
-
setCatalogFiles
-
getCatalogResourceName
-
setCatalogResourceName
-
getDefaultNamespace
- Specified by:
getDefaultNamespacein 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:
SchemaExceptionFileNotFoundException
-
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:
IOExceptionSchemaException
-
registerPrismSchema
- Throws:
SchemaException
-
loadPrismSchemaFileDescription
- Throws:
SchemaExceptionIOException
-
registerPrismSchemasFromDirectory
- Throws:
IOExceptionSchemaException
-
registerPrismSchemasFromDirectory
public void registerPrismSchemasFromDirectory(File directory, @NotNull @NotNull Collection<String> extensionFilesToIgnore) throws IOException, SchemaException - Throws:
IOExceptionSchemaException
-
loadPrismSchemaResource
- Throws:
SchemaException
-
reload
- Specified by:
reloadin interfaceSchemaRegistry- Throws:
SchemaException
-
initialize
This can be used to read additional schemas even after the registry was initialized.- Specified by:
initializein interfaceSchemaRegistry- Throws:
SAXExceptionIOExceptionSchemaException
-
parseAdditionalSchemas
protected void parseAdditionalSchemas(SchemaRegistryState schemaRegistryStateLocale) throws SchemaException - Throws:
SchemaException
-
getJavaxSchema
- Specified by:
getJavaxSchemain interfaceSchemaRegistryState
-
getJavaxSchemaValidator
- Specified by:
getJavaxSchemaValidatorin interfaceSchemaRegistry
-
getCompileTimePackages
- Specified by:
getCompileTimePackagesin interfaceSchemaRegistryState
-
debugDump
- Specified by:
debugDumpin interfaceDebugDumpable
-
applyDefinition
public <C extends Containerable> void applyDefinition(PrismContainer<C> container, Class<C> type) throws SchemaException Description copied from interface:SchemaRegistryThis method will try to locate the appropriate object definition and apply it.- Specified by:
applyDefinitionin interfaceSchemaRegistry- Throws:
SchemaException
-
applyDefinition
public <C extends Containerable> void applyDefinition(PrismContainer<C> container, Class<C> compileTimeClass, boolean force) throws SchemaException - Specified by:
applyDefinitionin interfaceSchemaRegistry- Throws:
SchemaException
-
applyDefinition
public <O extends Objectable> void applyDefinition(ObjectDelta<O> objectDelta, Class<O> compileTimeClass, boolean force) throws SchemaException - Specified by:
applyDefinitionin 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:
applyDefinitionin interfaceSchemaRegistry- Throws:
SchemaException
-
applyDefinition
public <C extends Containerable> void applyDefinition(PrismContainerValue<C> prismContainerValue, QName typeName, ItemPath path, boolean force) throws SchemaException - Specified by:
applyDefinitionin 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:GlobalDefinitionsStoreLooking 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:
findItemDefinitionsByCompileTimeClassin interfaceGlobalDefinitionsStore
-
findItemDefinitionByType
@Nullable public <ID extends ItemDefinition> ID findItemDefinitionByType(@NotNull @NotNull QName typeName, @NotNull @NotNull Class<ID> definitionClass) Description copied from interface:GlobalDefinitionsStoreLooking 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:
findItemDefinitionByTypein interfaceGlobalDefinitionsStore
-
findItemDefinitionsByElementName
@NotNull public <ID extends ItemDefinition> @NotNull List<ID> findItemDefinitionsByElementName(@NotNull @NotNull QName elementName, @NotNull @NotNull Class<ID> definitionClass) Description copied from interface:GlobalDefinitionsStoreLooking 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:
findItemDefinitionsByElementNamein interfaceGlobalDefinitionsStore
-
findTypeDefinitionByCompileTimeClass
@Nullable public <TD extends TypeDefinition> TD findTypeDefinitionByCompileTimeClass(@NotNull @NotNull Class<?> compileTimeClass, @NotNull @NotNull Class<TD> definitionClass) - Specified by:
findTypeDefinitionByCompileTimeClassin interfaceGlobalDefinitionsStore
-
findTypeDefinitionByType
@Nullable public <TD extends TypeDefinition> TD findTypeDefinitionByType(@NotNull @NotNull QName typeName, @NotNull @NotNull Class<TD> definitionClass) - Specified by:
findTypeDefinitionByTypein interfaceGlobalDefinitionsStore
-
findTypeDefinitionsByType
@NotNull public <TD extends TypeDefinition> @NotNull Collection<? extends TD> findTypeDefinitionsByType(@NotNull @NotNull QName typeName, @NotNull @NotNull Class<TD> definitionClass) - Specified by:
findTypeDefinitionsByTypein interfaceGlobalDefinitionsStore
-
findObjectDefinitionByCompileTimeClass
@Experimental public <O extends Objectable> PrismObjectDefinition<O> findObjectDefinitionByCompileTimeClass(@NotNull @NotNull Class<O> compileTimeClass) - Specified by:
findObjectDefinitionByCompileTimeClassin interfaceGlobalDefinitionsStore
-
findObjectDefinitionByType
public <O extends Objectable> PrismObjectDefinition<O> findObjectDefinitionByType(@NotNull @NotNull QName typeName) - Specified by:
findObjectDefinitionByTypein interfaceGlobalDefinitionsStore
-
findItemDefinitionByFullPath
public <T extends ItemDefinition> T findItemDefinitionByFullPath(Class<? extends Objectable> objectClass, Class<T> defClass, QName... itemNames) throws SchemaException - Specified by:
findItemDefinitionByFullPathin interfaceSchemaRegistry- Throws:
SchemaException
-
findItemDefinitionByElementName
public ItemDefinition findItemDefinitionByElementName(QName elementName, @Nullable @Nullable List<String> ignoredNamespaces) - Specified by:
findItemDefinitionByElementNamein interfaceSchemaRegistry
-
getCompileTimeClassForObjectType
- Specified by:
getCompileTimeClassForObjectTypein interfaceSchemaRegistry
-
determineDefinitionFromClass
- Specified by:
determineDefinitionFromClassin 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:
locateItemDefinitionin interfaceSchemaRegistry
-
resolveUnqualifiedTypeName
- Specified by:
resolveUnqualifiedTypeNamein interfaceSchemaRegistryState- Throws:
SchemaException
-
qualifyTypeName
- Specified by:
qualifyTypeNamein interfaceSchemaRegistry- Throws:
SchemaException
-
determineParentDefinition
public ComplexTypeDefinition determineParentDefinition(@NotNull @NotNull ComplexTypeDefinition child, @NotNull @NotNull ItemPath rest) - Specified by:
determineParentDefinitionin interfaceSchemaRegistryState
-
determineReferencedObjectDefinition
public PrismObjectDefinition determineReferencedObjectDefinition(@NotNull @NotNull QName targetTypeName, ItemPath rest) - Specified by:
determineReferencedObjectDefinitionin interfaceSchemaRegistry
-
resolveGlobalItemDefinition
public ItemDefinition resolveGlobalItemDefinition(QName itemName, @Nullable @Nullable ComplexTypeDefinition complexTypeDefinition) - Specified by:
resolveGlobalItemDefinitionin interfaceSchemaRegistry
-
getPrismSchema
- Specified by:
getPrismSchemain interfaceSchemaRegistryState
-
getSchemas
- Specified by:
getSchemasin interfaceSchemaRegistryState
-
getSchemaDescriptions
- Specified by:
getSchemaDescriptionsin interfaceSchemaRegistry
-
findSchemaByCompileTimeClass
- Specified by:
findSchemaByCompileTimeClassin interfaceSchemaRegistryState
-
findSchemaByNamespace
- Specified by:
findSchemaByNamespacein interfaceSchemaRegistryState
-
findSchemaDescriptionByNamespace
- Specified by:
findSchemaDescriptionByNamespacein interfaceSchemaRegistryState
-
findSchemaDescriptionByPrefix
- Specified by:
findSchemaDescriptionByPrefixin interfaceSchemaRegistryState
-
isList
@NotNull public @NotNull SchemaRegistryState.IsList isList(@Nullable @Nullable QName xsiType, @NotNull @NotNull QName elementName) Description copied from interface:SchemaRegistryStateChecks whether element with given (declared) xsi:type and name can be a heterogeneous list.- Specified by:
isListin 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:
getValueMetadataDefinitionin 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:
hasImplicitTypeDefinitionin interfaceSchemaRegistry
-
determineTypeForClass
Description copied from interface:SchemaRegistryTries to determine type name for any class (primitive, complex one). Does not use schemas (TODO explanation)- Specified by:
determineTypeForClassin interfaceSchemaRegistry- Returns:
-
determineClassForType
- Specified by:
determineClassForTypein interfaceSchemaRegistryState
-
determineCompileTimeClass
- Specified by:
determineCompileTimeClassin interfaceSchemaRegistryState
-
determineCompileTimeClassInternal
- Specified by:
determineCompileTimeClassInternalin interfaceSchemaRegistryState
-
determineClassForItemDefinition
- Specified by:
determineClassForItemDefinitionin interfaceSchemaRegistry
-
selectMoreSpecific
- Specified by:
selectMoreSpecificin interfaceSchemaRegistry- Throws:
SchemaException
-
selectMoreSpecific
Description copied from interface:SchemaRegistrySelects 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:
selectMoreSpecificin interfaceSchemaRegistry
-
compareDefinitions
public <ID extends ItemDefinition> SchemaRegistry.ComparisonResult compareDefinitions(@NotNull ID def1, @NotNull ID def2) - Specified by:
compareDefinitionsin 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:SchemaRegistryBEWARE: works only with statically-defined types!- Specified by:
isAssignableFromin interfaceSchemaRegistry
-
isAssignableFromGeneral
public boolean isAssignableFromGeneral(@NotNull @NotNull QName superType, @NotNull @NotNull QName subType) Description copied from interface:SchemaRegistryCrawls through the type definition tree. May be slower.- Specified by:
isAssignableFromGeneralin interfaceSchemaRegistry
-
isAssignableFrom
public boolean isAssignableFrom(@NotNull @NotNull Class<?> superClass, @NotNull @NotNull QName subType) Description copied from interface:SchemaRegistryBEWARE: works only with statically-defined types!- Specified by:
isAssignableFromin interfaceSchemaRegistry
-
unifyTypes
Description copied from interface:SchemaRegistryReturns 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:
unifyTypesin interfaceSchemaRegistry- Returns:
- null if unification cannot be done (or if both input types are null)
-
isContainerable
- Specified by:
isContainerablein 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:
createAdHocDefinitionin interfaceSchemaRegistry
-
getValueMetadataTypeName
-
staticNamespaceContext
- Specified by:
staticNamespaceContextin interfaceSchemaRegistry
-
registerDynamicSchemaExtensions
public void registerDynamicSchemaExtensions(Map<String, Element> dynamicSchemaExtensions) throws SchemaException- Specified by:
registerDynamicSchemaExtensionsin interfaceSchemaRegistry- Throws:
SchemaException
-
existDynamicSchemaExtensions
public boolean existDynamicSchemaExtensions()- Specified by:
existDynamicSchemaExtensionsin interfaceSchemaRegistry
-
registerStaticNamespace
-
getAllSubTypesByTypeDefinition
- Specified by:
getAllSubTypesByTypeDefinitionin interfaceSchemaRegistry
-
getDerivedObject
public <R,E extends Exception> R getDerivedObject(SchemaRegistryState.DerivationKey<R> derivationKey, CheckedFunction<SchemaRegistryState, R, throws EE> mapping) Description copied from interface:SchemaRegistryStateReturns 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:
getDerivedObjectin interfaceSchemaRegistryState- Returns:
- Throws:
E
-
resolverFor
- Specified by:
resolverForin interfaceSchemaLookup
-
definitionFactory
- Specified by:
definitionFactoryin interfaceSchemaLookup
-
getCurrentLookup
- Specified by:
getCurrentLookupin interfaceSchemaRegistry
-
schemaSpecific
Description copied from interface:SchemaLookupReturns schema-specific service- Specified by:
schemaSpecificin interfaceSchemaLookup- Type Parameters:
T- Type of schema specific service- Returns:
- Requested service or null, if service is not available.
-