Interface SchemaRegistry
-
- All Superinterfaces:
DebugDumpable
,DefinitionsStore
,GlobalDefinitionsStore
,PrismContextSensitive
- All Known Implementing Classes:
AxiomEnabledSchemaRegistry
,SchemaRegistryImpl
public interface SchemaRegistry extends PrismContextSensitive, DebugDumpable, GlobalDefinitionsStore
Maintains system-wide schemas.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
SchemaRegistry.ComparisonResult
static interface
SchemaRegistry.InvalidationListener
static class
SchemaRegistry.IsList
-
Field Summary
-
Fields inherited from interface com.evolveum.midpoint.util.DebugDumpable
INDENT_STRING
-
-
Method Summary
-
Methods inherited from interface com.evolveum.midpoint.util.DebugDumpable
debugDump, debugDump, debugDumpLazily, debugDumpLazily
-
Methods inherited from interface com.evolveum.midpoint.prism.schema.GlobalDefinitionsStore
findComplexTypeDefinitionByCompileTimeClass, findComplexTypeDefinitionByType, findContainerDefinitionByCompileTimeClass, findContainerDefinitionByElementName, findContainerDefinitionByType, findItemDefinitionByCompileTimeClass, findItemDefinitionByElementName, findItemDefinitionByElementName, findItemDefinitionByType, findItemDefinitionByType, findItemDefinitionsByCompileTimeClass, findItemDefinitionsByElementName, findItemDefinitionsByElementName, findObjectDefinitionByCompileTimeClass, findObjectDefinitionByElementName, findObjectDefinitionByType, findPropertyDefinitionByElementName, findReferenceDefinitionByElementName, findSimpleTypeDefinitionByType, findTypeDefinitionByCompileTimeClass, findTypeDefinitionByType, findTypeDefinitionByType, findTypeDefinitionsByType, findTypeDefinitionsByType
-
Methods inherited from interface com.evolveum.midpoint.prism.PrismContextSensitive
getPrismContext
-
-
-
-
Method Detail
-
getNamespacePrefixMapper
DynamicNamespacePrefixMapper getNamespacePrefixMapper()
- Returns:
- System-wide "standard prefixes" registry.
-
staticNamespaceContext
PrismNamespaceContext staticNamespaceContext()
-
registerInvalidationListener
void registerInvalidationListener(SchemaRegistry.InvalidationListener listener)
-
getDefaultNamespace
String getDefaultNamespace()
-
initialize
void initialize() throws SAXException, IOException, SchemaException
- Throws:
SAXException
IOException
SchemaException
-
getJavaxSchema
Schema getJavaxSchema()
-
getJavaxSchemaValidator
Validator getJavaxSchemaValidator()
-
getPrismSchema
PrismSchema getPrismSchema(String namespace)
-
getSchemas
Collection<PrismSchema> getSchemas()
-
getSchemaDescriptions
Collection<SchemaDescription> getSchemaDescriptions()
-
getCompileTimePackages
Collection<Package> getCompileTimePackages()
-
locateItemDefinition
ItemDefinition locateItemDefinition(@NotNull @NotNull QName itemName, @Nullable @Nullable ComplexTypeDefinition complexTypeDefinition, @Nullable @Nullable Function<QName,ItemDefinition> dynamicDefinitionResolver)
-
resolveUnqualifiedTypeName
QName resolveUnqualifiedTypeName(QName type) throws SchemaException
- Throws:
SchemaException
-
qualifyTypeName
QName qualifyTypeName(QName typeName) throws SchemaException
- Throws:
SchemaException
-
determineParentDefinition
ComplexTypeDefinition determineParentDefinition(@NotNull @NotNull ComplexTypeDefinition child, @NotNull @NotNull ItemPath rest)
-
determineReferencedObjectDefinition
PrismObjectDefinition determineReferencedObjectDefinition(@NotNull @NotNull QName targetTypeName, ItemPath rest)
-
getCompileTimeClassForObjectType
Class<? extends ObjectType> getCompileTimeClassForObjectType(QName objectType)
-
findItemDefinitionByElementName
ItemDefinition findItemDefinitionByElementName(QName elementName, @Nullable @Nullable List<String> ignoredNamespaces)
-
findSchemaByCompileTimeClass
PrismSchema findSchemaByCompileTimeClass(@NotNull @NotNull Class<?> compileTimeClass)
-
determineTypeForClass
QName determineTypeForClass(Class<?> clazz)
Tries to determine type name for any class (primitive, complex one). Does not use schemas (TODO explanation)- Parameters:
clazz
-- Returns:
-
determineTypeForClassRequired
@NotNull default @NotNull QName determineTypeForClassRequired(Class<?> clazz)
-
applyDefinition
<C extends Containerable> void applyDefinition(PrismContainer<C> container, Class<C> type) throws SchemaException
This method will try to locate the appropriate object definition and apply it.- Parameters:
container
-type
-- Throws:
SchemaException
-
applyDefinition
<C extends Containerable> void applyDefinition(PrismContainer<C> prismObject, Class<C> type, boolean force) throws SchemaException
- Throws:
SchemaException
-
applyDefinition
<T extends Objectable> void applyDefinition(ObjectDelta<T> objectDelta, Class<T> type, boolean force) throws SchemaException
- Throws:
SchemaException
-
applyDefinition
<C extends Containerable,O extends Objectable> void applyDefinition(PrismContainerValue<C> prismContainerValue, Class<O> type, ItemPath path, boolean force) throws SchemaException
- Throws:
SchemaException
-
applyDefinition
<C extends Containerable> void applyDefinition(PrismContainerValue<C> prismContainerValue, QName typeName, ItemPath path, boolean force) throws SchemaException
- Throws:
SchemaException
-
findItemDefinitionByFullPath
<T extends ItemDefinition> T findItemDefinitionByFullPath(Class<? extends Objectable> objectClass, Class<T> defClass, QName... itemNames) throws SchemaException
- Throws:
SchemaException
-
findSchemaByNamespace
PrismSchema findSchemaByNamespace(String namespaceURI)
-
findSchemaDescriptionByNamespace
SchemaDescription findSchemaDescriptionByNamespace(String namespaceURI)
-
findSchemaByPrefix
PrismSchema findSchemaByPrefix(String prefix)
-
findSchemaDescriptionByPrefix
SchemaDescription findSchemaDescriptionByPrefix(String prefix)
-
determineDefinitionFromClass
PrismObjectDefinition determineDefinitionFromClass(Class type)
-
getValueMetadataDefinition
@NotNull @NotNull PrismContainerDefinition<?> getValueMetadataDefinition()
-
hasImplicitTypeDefinition
boolean hasImplicitTypeDefinition(@NotNull @NotNull QName itemName, @NotNull @NotNull QName typeName)
-
resolveGlobalItemDefinition
ItemDefinition resolveGlobalItemDefinition(QName itemName, @Nullable @Nullable ComplexTypeDefinition complexTypeDefinition)
-
determineClassForTypeRequired
default <T> Class<T> determineClassForTypeRequired(QName type, Class<T> expected)
-
determineClassForItemDefinition
Class<?> determineClassForItemDefinition(ItemDefinition<?> itemDefinition)
-
selectMoreSpecific
<ID extends ItemDefinition> ID selectMoreSpecific(ID def1, ID def2) throws SchemaException
- Throws:
SchemaException
-
selectMoreSpecific
QName selectMoreSpecific(QName type1, QName type2) throws SchemaException
- Throws:
SchemaException
-
isContainerable
boolean isContainerable(QName typeName)
- Returns:
- true if the typeName corresponds to statically-typed class that is Containerable. TODO The utility of this method is questionable. Reconsider its removal/update.
-
findTypeDefinitionsByElementName
@NotNull <TD extends TypeDefinition> @NotNull Collection<TD> findTypeDefinitionsByElementName(@NotNull @NotNull QName name, @NotNull @NotNull Class<TD> clazz)
-
isList
@NotNull @NotNull SchemaRegistry.IsList isList(@Nullable @Nullable QName xsiType, @NotNull @NotNull QName elementName)
Checks whether element with given (declared) xsi:type and name can be a heterogeneous list.- Returns:
- YES if it is a list, NO if it's not, MAYBE if it probably is a list but some further content-based checks are needed
-
compareDefinitions
<ID extends ItemDefinition> SchemaRegistry.ComparisonResult compareDefinitions(@NotNull ID def1, @NotNull ID def2) throws SchemaException
- Returns:
- null means we cannot decide (types are different, and no compile time class for def1 and/or def2)
- Throws:
SchemaException
-
isAssignableFrom
boolean isAssignableFrom(@NotNull @NotNull Class<?> superType, @NotNull @NotNull QName subType)
BEWARE: works only with statically-defined types!
-
isAssignableFrom
boolean isAssignableFrom(@NotNull @NotNull QName superType, @NotNull @NotNull QName subType)
BEWARE: works only with statically-defined types!
-
unifyTypes
QName unifyTypes(QName type1, QName type2)
Returns most specific common supertype for these two. If any of input params is null, it means it is ignored- Returns:
- null if unification cannot be done (or if both input types are null)
-
createAdHocDefinition
ItemDefinition<?> createAdHocDefinition(QName elementName, QName typeName, int minOccurs, int maxOccurs)
-
-