Interface SchemaRegistry
- All Superinterfaces:
DebugDumpable
,DefinitionsStore
,GlobalDefinitionsStore
,SchemaRegistryState
- All Known Implementing Classes:
AxiomEnabledSchemaRegistry
,SchemaRegistryImpl
Maintains system-wide schemas that is used as source for parsing during initialize and reload.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic enum
static interface
Nested classes/interfaces inherited from interface com.evolveum.midpoint.prism.schema.SchemaRegistryState
SchemaRegistryState.DerivationKey<R>, SchemaRegistryState.IsList
-
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) void
Class<?>
determineClassForItemDefinition
(ItemDefinition<?> itemDefinition) default <T> Class<T>
default <T> Class<T>
determineClassForTypeRequired
(QName type, Class<T> expected) default <T> Class<T>
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) boolean
findItemDefinitionByElementName
(QName elementName, @Nullable List<String> ignoredNamespaces) <T extends ItemDefinition>
TfindItemDefinitionByFullPath
(Class<? extends Objectable> objectClass, Class<T> defClass, QName... itemNames) static SchemaRegistry
get()
getAllSubTypesByTypeDefinition
(List<TypeDefinition> typeClasses) default <T> Class<T>
getCompileTimeClass
(QName xsdType) Class<? extends ObjectType>
getCompileTimeClassForObjectType
(QName objectType) default @NotNull Class<? extends ObjectType>
getCompileTimeClassForObjectTypeRequired
(@NotNull QName objectType) @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) locateItemDefinition
(@NotNull QName itemName, @Nullable QName explicitTypeName, @Nullable ComplexTypeDefinition complexTypeDefinition, @Nullable Function<QName, ItemDefinition> dynamicDefinitionResolver) qualifyTypeName
(QName typeName) void
registerDynamicSchemaExtensions
(Map<String, Element> dbSchemaExtensions) void
void
reload()
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, findTypeDefinitionsByElementName, findTypeDefinitionsByType, findTypeDefinitionsByType
Methods inherited from interface com.evolveum.midpoint.prism.schema.SchemaRegistryState
determineClassForType, determineCompileTimeClass, determineCompileTimeClassInternal, determineParentDefinition, findSchemaByCompileTimeClass, findSchemaByNamespace, findSchemaDescriptionByNamespace, findSchemaDescriptionByPrefix, getCompileTimePackages, getDerivedObject, getJavaxSchema, getNamespacePrefixMapper, getPrismSchema, getSchemas, isList, resolveUnqualifiedTypeName
-
Method Details
-
get
-
customizeNamespacePrefixMapper
-
staticNamespaceContext
PrismNamespaceContext staticNamespaceContext() -
registerInvalidationListener
-
getDefaultNamespace
String getDefaultNamespace() -
reload
- Throws:
SchemaException
-
initialize
- Throws:
SAXException
IOException
SchemaException
-
getJavaxSchemaValidator
Validator getJavaxSchemaValidator() -
getSchemaDescriptions
Collection<SchemaDescription> getSchemaDescriptions() -
locateItemDefinition
ItemDefinition locateItemDefinition(@NotNull @NotNull QName itemName, @Nullable @Nullable QName explicitTypeName, @Nullable @Nullable ComplexTypeDefinition complexTypeDefinition, @Nullable @Nullable Function<QName, ItemDefinition> dynamicDefinitionResolver) -
qualifyTypeName
- Throws:
SchemaException
-
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) -
getCompileTimeClass
-
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
-
determineDefinitionFromClass
-
getValueMetadataDefinition
-
hasImplicitTypeDefinition
-
resolveGlobalItemDefinition
ItemDefinition resolveGlobalItemDefinition(QName itemName, @Nullable @Nullable ComplexTypeDefinition complexTypeDefinition) -
determineJavaClassForType
-
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.
-
getCurrentLookup
SchemaLookup.Mutable getCurrentLookup() -
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) -
getAllSubTypesByTypeDefinition
-
registerDynamicSchemaExtensions
- Throws:
SchemaException
-
existDynamicSchemaExtensions
boolean existDynamicSchemaExtensions()
-