Interface SchemaRegistry
- All Superinterfaces:
DebugDumpable
,DefinitionsStore
,GlobalDefinitionsStore
,PrismContextSensitive
public interface SchemaRegistry
extends PrismContextSensitive, DebugDumpable, GlobalDefinitionsStore
Maintains system-wide schemas.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic enum
static interface
static enum
-
Field Summary
Fields inherited from interface com.evolveum.midpoint.util.DebugDumpable
INDENT_STRING
-
Method Summary
Modifier and TypeMethodDescription<T extends Objectable>
voidapplyDefinition
(ObjectDelta<T> objectDelta, Class<T> type, 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> prismObject, Class<C> type, boolean force) <C extends Containerable,
O extends Objectable>
voidapplyDefinition
(PrismContainerValue<C> prismContainerValue, Class<O> type, 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) Class<?>
determineClassForItemDefinition
(ItemDefinition<?> itemDefinition) <T> Class<T>
determineClassForType
(QName type) default <T> Class<T>
default <T> Class<T>
determineClassForTypeRequired
(QName type, Class<T> expected) <T> Class<T>
determineCompileTimeClass
(QName typeName) 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).default @NotNull QName
determineTypeForClassRequired
(Class<?> clazz) findItemDefinitionByElementName
(QName elementName, @Nullable List<String> ignoredNamespaces) <T extends ItemDefinition>
TfindItemDefinitionByFullPath
(Class<? extends Objectable> objectClass, Class<T> defClass, QName... itemNames) findSchemaByCompileTimeClass
(@NotNull Class<?> compileTimeClass) findSchemaByNamespace
(String namespaceURI) findSchemaByPrefix
(String prefix) findSchemaDescriptionByNamespace
(String namespaceURI) findSchemaDescriptionByPrefix
(String prefix) <TD extends TypeDefinition>
@NotNull Collection<TD>findTypeDefinitionsByElementName
(@NotNull QName name, @NotNull Class<TD> clazz) static SchemaRegistry
get()
<T> Class<T>
getCompileTimeClass
(QName xsdType) Class<? extends ObjectType>
getCompileTimeClassForObjectType
(QName objectType) default @NotNull Class<? extends ObjectType>
getCompileTimeClassForObjectTypeRequired
(@NotNull QName objectType) getPrismSchema
(String namespace) @NotNull PrismContainerDefinition<?>
boolean
hasImplicitTypeDefinition
(@NotNull QName itemName, @NotNull QName typeName) void
boolean
isAssignableFrom
(@NotNull Class<?> superType, @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
Checks whether element with given (declared) xsi:type and name can be a heterogeneous list.locateItemDefinition
(@NotNull QName itemName, @Nullable ComplexTypeDefinition complexTypeDefinition, @Nullable Function<QName, ItemDefinition> dynamicDefinitionResolver) qualifyTypeName
(QName typeName) void
resolveGlobalItemDefinition
(QName itemName, @Nullable ComplexTypeDefinition complexTypeDefinition) selectMoreSpecific
(@Nullable QName type1, @Nullable QName type2) Selects the type that is more specific of the two.<ID extends ItemDefinition>
IDselectMoreSpecific
(ID def1, ID def2) unifyTypes
(QName type1, QName type2) Returns most specific common supertype for these two.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 Details
-
get
-
getNamespacePrefixMapper
DynamicNamespacePrefixMapper getNamespacePrefixMapper()- Returns:
- System-wide "standard prefixes" registry.
-
staticNamespaceContext
PrismNamespaceContext staticNamespaceContext() -
registerInvalidationListener
-
getDefaultNamespace
String getDefaultNamespace() -
initialize
- Throws:
SAXException
IOException
SchemaException
-
getJavaxSchema
Schema getJavaxSchema() -
getJavaxSchemaValidator
Validator getJavaxSchemaValidator() -
getPrismSchema
-
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
- Throws:
SchemaException
-
qualifyTypeName
- Throws:
SchemaException
-
determineParentDefinition
ComplexTypeDefinition determineParentDefinition(@NotNull @NotNull ComplexTypeDefinition child, @NotNull @NotNull ItemPath rest) -
determineReferencedObjectDefinition
PrismObjectDefinition determineReferencedObjectDefinition(@NotNull @NotNull QName targetTypeName, ItemPath rest) -
getCompileTimeClassForObjectType
-
getCompileTimeClassForObjectTypeRequired
@NotNull default @NotNull Class<? extends ObjectType> getCompileTimeClassForObjectTypeRequired(@NotNull @NotNull QName objectType) -
findItemDefinitionByElementName
ItemDefinition findItemDefinitionByElementName(QName elementName, @Nullable @Nullable List<String> ignoredNamespaces) -
determineCompileTimeClass
-
getCompileTimeClass
-
findSchemaByCompileTimeClass
-
determineTypeForClass
Tries to determine type name for any class (primitive, complex one). Does not use schemas (TODO explanation)- Parameters:
clazz
-- Returns:
-
determineTypeForClassRequired
-
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
-
findSchemaDescriptionByNamespace
-
findSchemaByPrefix
-
findSchemaDescriptionByPrefix
-
determineDefinitionFromClass
-
getValueMetadataDefinition
-
hasImplicitTypeDefinition
-
resolveGlobalItemDefinition
ItemDefinition resolveGlobalItemDefinition(QName itemName, @Nullable @Nullable ComplexTypeDefinition complexTypeDefinition) -
determineClassForType
-
determineClassForTypeRequired
-
determineClassForTypeRequired
-
determineClassForItemDefinition
-
selectMoreSpecific
- Throws:
SchemaException
-
selectMoreSpecific
QName selectMoreSpecific(@Nullable @Nullable QName type1, @Nullable @Nullable QName type2) throws SchemaException 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- Throws:
SchemaException
-
isContainerable
- 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
BEWARE: works only with statically-defined types! -
isAssignableFrom
BEWARE: works only with statically-defined types! -
isAssignableFromGeneral
@Experimental boolean isAssignableFromGeneral(@NotNull @NotNull QName superType, @NotNull @NotNull QName subType) Crawls through the type definition tree. May be slower. -
unifyTypes
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!- 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)
-