Class SchemaRegistryImpl
- java.lang.Object
-
- com.evolveum.midpoint.prism.impl.schema.SchemaRegistryImpl
-
- All Implemented Interfaces:
PrismContextSensitive
,DefinitionsStore
,GlobalDefinitionsStore
,SchemaRegistry
,DebugDumpable
- Direct Known Subclasses:
AxiomEnabledSchemaRegistry
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, SchemaRegistry.InvalidationListener, SchemaRegistry.IsList
-
-
Field Summary
-
Fields inherited from interface com.evolveum.midpoint.util.DebugDumpable
INDENT_STRING
-
-
Constructor Summary
Constructors Constructor Description SchemaRegistryImpl()
-
Method Summary
All Methods Instance Methods Concrete 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)
<ID extends ItemDefinition>
SchemaRegistry.ComparisonResultcompareDefinitions(ID def1, ID def2)
ItemDefinition<?>
createAdHocDefinition(QName elementName, QName typeName, int minOccurs, int maxOccurs)
String
debugDump(int indent)
Class<?>
determineClassForItemDefinition(ItemDefinition<?> itemDefinition)
<T> Class<T>
determineClassForType(QName type)
<T> Class<T>
determineCompileTimeClass(QName type)
PrismObjectDefinition
determineDefinitionFromClass(Class compileTimeClass)
ComplexTypeDefinition
determineParentDefinition(@NotNull ComplexTypeDefinition child, @NotNull ItemPath rest)
PrismObjectDefinition
determineReferencedObjectDefinition(@NotNull QName targetTypeName, ItemPath rest)
QName
determineTypeForClass(Class<?> clazz)
Tries to determine type name for any class (primitive, complex one).ItemDefinition
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)
PrismSchema
findSchemaByCompileTimeClass(@NotNull Class<?> compileTimeClass)
PrismSchema
findSchemaByNamespace(String namespaceURI)
PrismSchema
findSchemaByPrefix(String prefix)
SchemaDescription
findSchemaDescriptionByNamespace(String namespaceURI)
SchemaDescription
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<TD>findTypeDefinitionsByElementName(@NotNull QName name, @NotNull Class<TD> clazz)
<TD extends TypeDefinition>
@NotNull Collection<? extends TD>findTypeDefinitionsByType(@NotNull QName typeName, @NotNull 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()
Validator
getJavaxSchemaValidator()
DynamicNamespacePrefixMapper
getNamespacePrefixMapper()
org.apache.commons.collections4.MultiValuedMap<String,SchemaDescription>
getParsedSchemas()
PrismContext
getPrismContext()
PrismSchema
getPrismSchema(String namespace)
Collection<SchemaDescription>
getSchemaDescriptions()
Collection<PrismSchema>
getSchemas()
@NotNull PrismContainerDefinition<?>
getValueMetadataDefinition()
QName
getValueMetadataTypeName()
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
initialize()
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 SchemaRegistry.IsList
isList(@Nullable QName xsiType, @NotNull QName elementName)
Checks whether element with given (declared) xsi:type and name can be a heterogeneous list.protected void
loadPrismSchemaFileDescription(File file)
void
loadPrismSchemaResource(String resourcePath)
ItemDefinition
locateItemDefinition(@NotNull QName itemName, @Nullable ComplexTypeDefinition complexTypeDefinition, @Nullable Function<QName,ItemDefinition> dynamicDefinitionProvider)
protected void
parseAdditionalSchemas()
protected void
parsePrismSchemas()
QName
qualifyTypeName(QName typeName)
void
registerInvalidationListener(SchemaRegistry.InvalidationListener listener)
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)
ItemDefinition
resolveGlobalItemDefinition(QName itemName, @Nullable ComplexTypeDefinition complexTypeDefinition)
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)
void
setValueMetadataTypeName(QName typeName)
PrismNamespaceContext
staticNamespaceContext()
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
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, findTypeDefinitionsByType
-
Methods inherited from interface com.evolveum.midpoint.prism.schema.SchemaRegistry
determineClassForTypeRequired, determineClassForTypeRequired, determineTypeForClassRequired
-
-
-
-
Method Detail
-
getNamespacePrefixMapper
public DynamicNamespacePrefixMapper getNamespacePrefixMapper()
- Specified by:
getNamespacePrefixMapper
in interfaceSchemaRegistry
- Returns:
- System-wide "standard prefixes" registry.
-
setNamespacePrefixMapper
public void setNamespacePrefixMapper(DynamicNamespacePrefixMapper namespacePrefixMapper)
-
registerInvalidationListener
public void registerInvalidationListener(SchemaRegistry.InvalidationListener listener)
- Specified by:
registerInvalidationListener
in interfaceSchemaRegistry
-
getPrismContext
public PrismContext getPrismContext()
- Specified by:
getPrismContext
in interfacePrismContextSensitive
-
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
-
registerWsdlSchemaFile
public void registerWsdlSchemaFile(File file) throws SchemaException, FileNotFoundException
- 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
public void registerSchema(Node node, String sourceDescription) throws SchemaException
Must be called before call to initialize()- Throws:
SchemaException
-
registerPrismSchemaFile
public void registerPrismSchemaFile(File file) throws IOException, SchemaException
- Throws:
IOException
SchemaException
-
registerPrismSchema
public void registerPrismSchema(InputStream input, String sourceDescription) throws SchemaException
- Throws:
SchemaException
-
loadPrismSchemaFileDescription
protected void loadPrismSchemaFileDescription(File file) throws SchemaException, IOException
- Throws:
SchemaException
IOException
-
registerPrismSchemasFromDirectory
public void registerPrismSchemasFromDirectory(File directory) throws IOException, SchemaException
- Throws:
IOException
SchemaException
-
registerPrismSchemasFromDirectory
public void registerPrismSchemasFromDirectory(File directory, @NotNull @NotNull Collection<String> extensionFilesToIgnore) throws IOException, SchemaException
- Throws:
IOException
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
-
parseAdditionalSchemas
protected void parseAdditionalSchemas() throws SchemaException
- Throws:
SchemaException
-
parsePrismSchemas
protected void parsePrismSchemas() throws SchemaException
- Throws:
SchemaException
-
getJavaxSchema
public Schema getJavaxSchema()
- Specified by:
getJavaxSchema
in interfaceSchemaRegistry
-
getJavaxSchemaValidator
public Validator getJavaxSchemaValidator()
- Specified by:
getJavaxSchemaValidator
in interfaceSchemaRegistry
-
getCompileTimePackages
public Collection<Package> getCompileTimePackages()
- Specified by:
getCompileTimePackages
in interfaceSchemaRegistry
-
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> @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
-
findTypeDefinitionsByElementName
@NotNull public <TD extends TypeDefinition> @NotNull Collection<TD> findTypeDefinitionsByElementName(@NotNull @NotNull QName name, @NotNull @NotNull Class<TD> clazz)
- Specified by:
findTypeDefinitionsByElementName
in interfaceSchemaRegistry
-
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
-
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 @NotNull QName itemName, @Nullable @Nullable ComplexTypeDefinition complexTypeDefinition, @Nullable @Nullable Function<QName,ItemDefinition> dynamicDefinitionProvider)
- Specified by:
locateItemDefinition
in interfaceSchemaRegistry
-
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 @NotNull ComplexTypeDefinition child, @NotNull @NotNull ItemPath rest)
- Specified by:
determineParentDefinition
in interfaceSchemaRegistry
-
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
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 @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
-
isList
@NotNull public @NotNull SchemaRegistry.IsList isList(@Nullable @Nullable QName xsiType, @NotNull @NotNull QName elementName)
Description copied from interface:SchemaRegistry
Checks whether element with given (declared) xsi:type and name can be a heterogeneous list.- Specified by:
isList
in interfaceSchemaRegistry
- 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
public void setValueMetadataTypeName(QName typeName)
-
getValueMetadataDefinition
@NotNull public @NotNull PrismContainerDefinition<?> 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
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
-
determineCompileTimeClass
public <T> Class<T> determineCompileTimeClass(QName type)
- Specified by:
determineCompileTimeClass
in interfaceSchemaRegistry
-
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)
- 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
public boolean isAssignableFrom(@NotNull @NotNull QName superType, @NotNull @NotNull QName subType)
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
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)
-
isContainerable
public boolean isContainerable(QName typeName)
- 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
public QName getValueMetadataTypeName()
-
staticNamespaceContext
public PrismNamespaceContext staticNamespaceContext()
- Specified by:
staticNamespaceContext
in interfaceSchemaRegistry
-
-