Class SchemaRegistryImpl
- java.lang.Object
-
- com.evolveum.midpoint.prism.impl.schema.SchemaRegistryImpl
-
- All Implemented Interfaces:
DefinitionsStore
,GlobalDefinitionsStore
,SchemaRegistry
,DebugDumpable
public class SchemaRegistryImpl extends Object implements DebugDumpable, SchemaRegistry
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.SchemaRegistry
SchemaRegistry.ComparisonResult
-
-
Field Summary
-
Fields inherited from interface com.evolveum.midpoint.util.DebugDumpable
INDENT_STRING
-
-
Constructor Summary
Constructors Constructor Description SchemaRegistryImpl()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description <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)
boolean
areComparable(QName type1, QName type2)
<ID extends ItemDefinition>
SchemaRegistry.ComparisonResultcompareDefinitions(ID def1, ID def2)
ItemDefinition<?>
createAdHocDefinition(QName elementName, QName typeName, int minOccurs, int maxOccurs)
static ItemDefinition
createDefaultItemDefinition(QName itemName, PrismContext prismContext)
String
debugDump()
Show the content of the object intended for diagnostics by system administrator.String
debugDump(int indent)
Class<?>
determineClassForItemDefinition(ItemDefinition<?> itemDefinition)
<T> Class<T>
determineClassForType(QName type)
<T> Class<T>
determineClassForTypeNotNull(QName typeName)
<T> Class<T>
determineCompileTimeClass(QName typeName)
<T> Class<T>
determineCompileTimeClassNotNull(QName typeName)
PrismObjectDefinition
determineDefinitionFromClass(Class compileTimeClass)
ComplexTypeDefinition
determineParentDefinition(ComplexTypeDefinition child, ItemPath rest)
PrismObjectDefinition
determineReferencedObjectDefinition(QName targetTypeName, ItemPath rest)
QName
determineTypeForClass(Class<?> clazz)
Tries to determine type name for any class (primitive, complex one).ItemDefinition
findItemDefinitionByElementName(QName elementName, List<String> ignoredNamespaces)
<T extends ItemDefinition>
TfindItemDefinitionByFullPath(Class<? extends Objectable> objectClass, Class<T> defClass, QName... itemNames)
<ID extends ItemDefinition>
IDfindItemDefinitionByType(QName typeName, Class<ID> definitionClass)
<ID extends ItemDefinition>
List<ID>findItemDefinitionsByCompileTimeClass(Class<?> compileTimeClass, Class<ID> definitionClass)
<ID extends ItemDefinition>
List<ID>findItemDefinitionsByElementName(QName elementName, Class<ID> definitionClass)
PrismSchema
findSchemaByCompileTimeClass(Class<?> compileTimeClass)
PrismSchema
findSchemaByNamespace(String namespaceURI)
PrismSchema
findSchemaByPrefix(String prefix)
SchemaDescription
findSchemaDescriptionByNamespace(String namespaceURI)
SchemaDescription
findSchemaDescriptionByPrefix(String prefix)
<TD extends TypeDefinition>
TDfindTypeDefinitionByCompileTimeClass(Class<?> compileTimeClass, Class<TD> definitionClass)
<TD extends TypeDefinition>
TDfindTypeDefinitionByType(QName typeName, Class<TD> definitionClass)
<TD extends TypeDefinition>
Collection<TD>findTypeDefinitionsByElementName(QName name, Class<TD> clazz)
<TD extends TypeDefinition>
Collection<? extends TD>findTypeDefinitionsByType(QName typeName, Class<TD> definitionClass)
EntityResolver
getBuiltinSchemaResolver()
File[]
getCatalogFiles()
String
getCatalogResourceName()
<T> Class<T>
getCompileTimeClass(QName xsdType)
Class<? extends ObjectType>
getCompileTimeClassForObjectType(QName objectType)
Collection<Package>
getCompileTimePackages()
String
getDefaultNamespace()
XmlEntityResolver
getEntityResolver()
Schema
getJavaxSchema()
DynamicNamespacePrefixMapper
getNamespacePrefixMapper()
org.apache.commons.collections4.MultiValuedMap<String,SchemaDescription>
getParsedSchemas()
PrismContext
getPrismContext()
PrismSchema
getPrismSchema(String namespace)
Collection<SchemaDescription>
getSchemaDescriptions()
Collection<PrismSchema>
getSchemas()
boolean
hasImplicitTypeDefinition(QName itemName, 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
initialize()
This can be used to read additional schemas even after the registry was initialized.<T extends Objectable>
PrismObject<T>instantiate(Class<T> compileTimeClass)
Deprecated.boolean
isAssignableFrom(QName superType, QName subType)
boolean
isContainer(QName typeName)
SchemaDescription
loadPrismSchemaDescription(InputStream input, String sourceDescription)
void
loadPrismSchemaFile(File file)
SchemaDescription
loadPrismSchemaFileDescription(File file)
void
loadPrismSchemaResource(String resourcePath)
void
loadPrismSchemasFromDirectory(File directory)
This can be used to read additional schemas even after the registry was initialized.ItemDefinition
locateItemDefinition(QName itemName, ComplexTypeDefinition complexTypeDefinition, Function<QName,ItemDefinition> dynamicDefinitionProvider)
QName
qualifyTypeName(QName typeName)
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
registerPrismSchemaResource(String resourcePath, String usualPrefix, Package compileTimeClassesPackage, boolean defaultSchema, boolean prefixDeclaredByDefault)
Must be called before call to initialize()void
registerPrismSchemasFromDirectory(File directory)
void
registerPrismSchemasFromWsdlResource(String resourcePath, List<Package> compileTimeClassesPackages)
void
registerSchema(Node node, String sourceDescription)
Must be called before call to initialize()void
registerSchema(Node node, String sourceDescription, String usualPrefix)
Must be called before call to initialize()void
registerSchemaResource(String resourcePath, String usualPrefix)
Must be called before call to initialize()ItemDefinition
resolveGlobalItemDefinition(QName itemName, ComplexTypeDefinition complexTypeDefinition)
ItemDefinition
resolveGlobalItemDefinition(QName elementQName, PrismContainerDefinition<?> containerDefinition)
Deprecated.QName
resolveUnqualifiedTypeName(QName type)
<ID extends ItemDefinition>
IDselectMoreSpecific(ID def1, ID def2)
QName
selectMoreSpecific(QName type1, QName type2)
void
setCatalogFiles(File[] catalogFiles)
void
setCatalogResourceName(String catalogResourceName)
void
setDefaultNamespace(String defaultNamespace)
void
setNamespacePrefixMapper(DynamicNamespacePrefixMapper namespacePrefixMapper)
void
setPrismContext(PrismContext prismContext)
QName
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
debugDumpLazily, debugDumpLazily
-
Methods inherited from interface com.evolveum.midpoint.prism.schema.GlobalDefinitionsStore
findComplexTypeDefinition, findComplexTypeDefinitionByCompileTimeClass, findComplexTypeDefinitionByType, findContainerDefinitionByCompileTimeClass, findContainerDefinitionByElementName, findContainerDefinitionByType, findItemDefinition, findItemDefinition, findItemDefinitionByCompileTimeClass, findItemDefinitionByElementName, findItemDefinitionByElementName, findItemDefinitionByType, findItemDefinitionsByElementName, findObjectDefinitionByCompileTimeClass, findObjectDefinitionByElementName, findObjectDefinitionByType, findPropertyDefinitionByElementName, findReferenceDefinitionByElementName, findSimpleTypeDefinitionByType, findTypeDefinitionByType, findTypeDefinitionsByType
-
-
-
-
Method Detail
-
getNamespacePrefixMapper
public DynamicNamespacePrefixMapper getNamespacePrefixMapper()
- Specified by:
getNamespacePrefixMapper
in interfaceSchemaRegistry
-
setNamespacePrefixMapper
public void setNamespacePrefixMapper(DynamicNamespacePrefixMapper namespacePrefixMapper)
-
getPrismContext
public PrismContext getPrismContext()
- Specified by:
getPrismContext
in interfaceSchemaRegistry
-
setPrismContext
public void setPrismContext(PrismContext prismContext)
-
getEntityResolver
public XmlEntityResolver getEntityResolver()
-
getParsedSchemas
public org.apache.commons.collections4.MultiValuedMap<String,SchemaDescription> getParsedSchemas()
-
getBuiltinSchemaResolver
public EntityResolver getBuiltinSchemaResolver()
-
getCatalogFiles
public File[] getCatalogFiles()
-
setCatalogFiles
public void setCatalogFiles(File[] catalogFiles)
-
getCatalogResourceName
public String getCatalogResourceName()
-
setCatalogResourceName
public void setCatalogResourceName(String catalogResourceName)
-
getDefaultNamespace
public String getDefaultNamespace()
- Specified by:
getDefaultNamespace
in interfaceSchemaRegistry
-
setDefaultNamespace
public void setDefaultNamespace(String defaultNamespace)
-
registerSchemaResource
public void registerSchemaResource(String resourcePath, String usualPrefix) throws SchemaException
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
-
registerPrismSchemasFromWsdlResource
public void registerPrismSchemasFromWsdlResource(String resourcePath, 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
-
registerPrismSchemaResource
public void registerPrismSchemaResource(String resourcePath, String usualPrefix, Package compileTimeClassesPackage, boolean defaultSchema, boolean prefixDeclaredByDefault) throws SchemaException
Must be called before call to initialize()- Parameters:
prefixDeclaredByDefault
- Whether this prefix will be declared in top element in all XML serializations (MID-2198)- Throws:
SchemaException
-
registerSchema
public void registerSchema(Node node, String sourceDescription) throws SchemaException
Must be called before call to initialize()- Parameters:
node
-- Throws:
SchemaException
-
registerSchema
public void registerSchema(Node node, String sourceDescription, String usualPrefix) throws SchemaException
Must be called before call to initialize()- Parameters:
node
-- Throws:
SchemaException
-
registerPrismSchemaFile
public void registerPrismSchemaFile(File file) throws FileNotFoundException, SchemaException
- Throws:
FileNotFoundException
SchemaException
-
registerPrismSchema
public void registerPrismSchema(InputStream input, String sourceDescription) throws SchemaException
- Throws:
SchemaException
-
loadPrismSchemaFileDescription
public SchemaDescription loadPrismSchemaFileDescription(File file) throws FileNotFoundException, SchemaException
- Throws:
FileNotFoundException
SchemaException
-
loadPrismSchemaDescription
public SchemaDescription loadPrismSchemaDescription(InputStream input, String sourceDescription) throws SchemaException
- Throws:
SchemaException
-
registerPrismSchemasFromDirectory
public void registerPrismSchemasFromDirectory(File directory) throws FileNotFoundException, SchemaException
- Throws:
FileNotFoundException
SchemaException
-
loadPrismSchemasFromDirectory
public void loadPrismSchemasFromDirectory(File directory) throws FileNotFoundException, SchemaException
This can be used to read additional schemas even after the registry was initialized.- Throws:
FileNotFoundException
SchemaException
-
loadPrismSchemaFile
public void loadPrismSchemaFile(File file) throws FileNotFoundException, SchemaException
- Throws:
FileNotFoundException
SchemaException
-
loadPrismSchemaResource
public void loadPrismSchemaResource(String resourcePath) throws SchemaException
- Throws:
SchemaException
-
initialize
public void initialize() throws SAXException, IOException, SchemaException
This can be used to read additional schemas even after the registry was initialized.- Specified by:
initialize
in interfaceSchemaRegistry
- Throws:
SAXException
IOException
SchemaException
-
getJavaxSchema
public Schema getJavaxSchema()
- Specified by:
getJavaxSchema
in interfaceSchemaRegistry
-
getCompileTimePackages
public Collection<Package> getCompileTimePackages()
- Specified by:
getCompileTimePackages
in interfaceSchemaRegistry
-
debugDump
public String debugDump()
Description copied from interface:DebugDumpable
Show the content of the object intended for diagnostics by system administrator. The out put should be suitable to use in system logs at "debug" level. It may be multi-line, but in that case it should be well indented and quite terse. As it is intended to be used by system administrator, it should not use any developer terms such as class names, exceptions or stack traces.- Specified by:
debugDump
in interfaceDebugDumpable
- Returns:
- content of the object intended for diagnostics by system administrator.
-
debugDump
public String debugDump(int indent)
- 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> List<ID> findItemDefinitionsByCompileTimeClass(@NotNull Class<?> compileTimeClass, @NotNull Class<ID> definitionClass)
- Specified by:
findItemDefinitionsByCompileTimeClass
in interfaceGlobalDefinitionsStore
-
findItemDefinitionByType
@Nullable public <ID extends ItemDefinition> ID findItemDefinitionByType(@NotNull QName typeName, @NotNull Class<ID> definitionClass)
- Specified by:
findItemDefinitionByType
in interfaceGlobalDefinitionsStore
-
findItemDefinitionsByElementName
@NotNull public <ID extends ItemDefinition> List<ID> findItemDefinitionsByElementName(@NotNull QName elementName, @NotNull Class<ID> definitionClass)
- Specified by:
findItemDefinitionsByElementName
in interfaceGlobalDefinitionsStore
-
findTypeDefinitionByCompileTimeClass
@Nullable public <TD extends TypeDefinition> TD findTypeDefinitionByCompileTimeClass(@NotNull Class<?> compileTimeClass, @NotNull Class<TD> definitionClass)
- Specified by:
findTypeDefinitionByCompileTimeClass
in interfaceGlobalDefinitionsStore
-
findTypeDefinitionByType
@Nullable public <TD extends TypeDefinition> TD findTypeDefinitionByType(@NotNull QName typeName, @NotNull Class<TD> definitionClass)
- Specified by:
findTypeDefinitionByType
in interfaceGlobalDefinitionsStore
-
findTypeDefinitionsByType
@NotNull public <TD extends TypeDefinition> Collection<? extends TD> findTypeDefinitionsByType(@NotNull QName typeName, @NotNull Class<TD> definitionClass)
- Specified by:
findTypeDefinitionsByType
in interfaceGlobalDefinitionsStore
-
findTypeDefinitionsByElementName
@NotNull public <TD extends TypeDefinition> Collection<TD> findTypeDefinitionsByElementName(@NotNull QName name, @NotNull Class<TD> clazz)
- Specified by:
findTypeDefinitionsByElementName
in interfaceSchemaRegistry
-
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 List<String> ignoredNamespaces)
- Specified by:
findItemDefinitionByElementName
in interfaceSchemaRegistry
-
determineCompileTimeClass
public <T> Class<T> determineCompileTimeClass(QName typeName)
- Specified by:
determineCompileTimeClass
in interfaceSchemaRegistry
-
determineCompileTimeClassNotNull
@NotNull public <T> Class<T> determineCompileTimeClassNotNull(QName typeName)
-
getCompileTimeClass
public <T> Class<T> getCompileTimeClass(QName xsdType)
- Specified by:
getCompileTimeClass
in interfaceSchemaRegistry
-
getCompileTimeClassForObjectType
public Class<? extends ObjectType> getCompileTimeClassForObjectType(QName objectType)
- Specified by:
getCompileTimeClassForObjectType
in interfaceSchemaRegistry
-
determineDefinitionFromClass
public PrismObjectDefinition determineDefinitionFromClass(Class compileTimeClass)
- Specified by:
determineDefinitionFromClass
in interfaceSchemaRegistry
-
locateItemDefinition
public ItemDefinition locateItemDefinition(@NotNull QName itemName, @Nullable ComplexTypeDefinition complexTypeDefinition, @Nullable Function<QName,ItemDefinition> dynamicDefinitionProvider) throws SchemaException
- Specified by:
locateItemDefinition
in interfaceSchemaRegistry
- Throws:
SchemaException
-
resolveUnqualifiedTypeName
public QName resolveUnqualifiedTypeName(QName type) throws SchemaException
- Specified by:
resolveUnqualifiedTypeName
in interfaceSchemaRegistry
- Throws:
SchemaException
-
qualifyTypeName
public QName qualifyTypeName(QName typeName) throws SchemaException
- Specified by:
qualifyTypeName
in interfaceSchemaRegistry
- Throws:
SchemaException
-
determineParentDefinition
public ComplexTypeDefinition determineParentDefinition(@NotNull ComplexTypeDefinition child, @NotNull ItemPath rest)
- Specified by:
determineParentDefinition
in interfaceSchemaRegistry
-
determineReferencedObjectDefinition
public PrismObjectDefinition determineReferencedObjectDefinition(@NotNull QName targetTypeName, ItemPath rest)
- Specified by:
determineReferencedObjectDefinition
in interfaceSchemaRegistry
-
resolveGlobalItemDefinition
@Deprecated public ItemDefinition resolveGlobalItemDefinition(QName elementQName, PrismContainerDefinition<?> containerDefinition) throws SchemaException
Deprecated.Looks for a top-level definition for the specified element name (in all schemas).- Specified by:
resolveGlobalItemDefinition
in interfaceSchemaRegistry
- Throws:
SchemaException
-
resolveGlobalItemDefinition
public ItemDefinition resolveGlobalItemDefinition(QName itemName, @Nullable ComplexTypeDefinition complexTypeDefinition) throws SchemaException
- Specified by:
resolveGlobalItemDefinition
in interfaceSchemaRegistry
- Throws:
SchemaException
-
getPrismSchema
public PrismSchema getPrismSchema(String namespace)
- Specified by:
getPrismSchema
in interfaceSchemaRegistry
-
getSchemas
public Collection<PrismSchema> getSchemas()
- Specified by:
getSchemas
in interfaceSchemaRegistry
-
getSchemaDescriptions
public Collection<SchemaDescription> getSchemaDescriptions()
- Specified by:
getSchemaDescriptions
in interfaceSchemaRegistry
-
findSchemaByCompileTimeClass
public PrismSchema findSchemaByCompileTimeClass(@NotNull Class<?> compileTimeClass)
- Specified by:
findSchemaByCompileTimeClass
in interfaceSchemaRegistry
-
findSchemaByNamespace
public PrismSchema findSchemaByNamespace(String namespaceURI)
- Specified by:
findSchemaByNamespace
in interfaceSchemaRegistry
-
findSchemaDescriptionByNamespace
public SchemaDescription findSchemaDescriptionByNamespace(String namespaceURI)
- Specified by:
findSchemaDescriptionByNamespace
in interfaceSchemaRegistry
-
findSchemaByPrefix
public PrismSchema findSchemaByPrefix(String prefix)
- Specified by:
findSchemaByPrefix
in interfaceSchemaRegistry
-
findSchemaDescriptionByPrefix
public SchemaDescription findSchemaDescriptionByPrefix(String prefix)
- Specified by:
findSchemaDescriptionByPrefix
in interfaceSchemaRegistry
-
createDefaultItemDefinition
public static ItemDefinition createDefaultItemDefinition(QName itemName, PrismContext prismContext)
-
instantiate
@Deprecated public <T extends Objectable> PrismObject<T> instantiate(Class<T> compileTimeClass) throws SchemaException
Deprecated.- Specified by:
instantiate
in interfaceSchemaRegistry
- Throws:
SchemaException
-
hasImplicitTypeDefinition
public 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. By suitable we mean such that can be used to determine specific object type.- Specified by:
hasImplicitTypeDefinition
in interfaceSchemaRegistry
-
determineTypeForClass
public QName determineTypeForClass(Class<?> clazz)
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
public <T> Class<T> determineClassForType(QName type)
- Specified by:
determineClassForType
in interfaceSchemaRegistry
-
determineClassForTypeNotNull
@NotNull public <T> Class<T> determineClassForTypeNotNull(QName typeName)
-
determineClassForItemDefinition
public Class<?> determineClassForItemDefinition(ItemDefinition<?> itemDefinition)
- Specified by:
determineClassForItemDefinition
in interfaceSchemaRegistry
-
selectMoreSpecific
public <ID extends ItemDefinition> ID selectMoreSpecific(ID def1, ID def2) throws SchemaException
- Specified by:
selectMoreSpecific
in interfaceSchemaRegistry
- Throws:
SchemaException
-
selectMoreSpecific
public QName selectMoreSpecific(QName type1, QName type2) throws SchemaException
- Specified by:
selectMoreSpecific
in interfaceSchemaRegistry
- Throws:
SchemaException
-
areComparable
public boolean areComparable(QName type1, QName type2) throws SchemaException
- Specified by:
areComparable
in interfaceSchemaRegistry
- Throws:
SchemaException
-
compareDefinitions
public <ID extends ItemDefinition> SchemaRegistry.ComparisonResult compareDefinitions(@NotNull ID def1, @NotNull ID def2) throws SchemaException
- Specified by:
compareDefinitions
in interfaceSchemaRegistry
- Returns:
- null means we cannot decide (types are different, and no compile time class for def1 and/or def2)
- Throws:
SchemaException
-
isAssignableFrom
public boolean isAssignableFrom(@NotNull QName superType, @NotNull QName subType)
- Specified by:
isAssignableFrom
in interfaceSchemaRegistry
-
unifyTypes
public QName unifyTypes(QName type1, QName type2)
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- Specified by:
unifyTypes
in interfaceSchemaRegistry
- Returns:
- null if unification cannot be done (or if both input types are null)
-
isContainer
public boolean isContainer(QName typeName)
- Specified by:
isContainer
in interfaceSchemaRegistry
-
createAdHocDefinition
public ItemDefinition<?> createAdHocDefinition(QName elementName, QName typeName, int minOccurs, int maxOccurs)
- Specified by:
createAdHocDefinition
in interfaceSchemaRegistry
-
-