Class PrismSchemaImpl
java.lang.Object
com.evolveum.midpoint.prism.AbstractFreezable
com.evolveum.midpoint.prism.impl.schema.PrismSchemaImpl
- All Implemented Interfaces:
Freezable
,PrismContextSensitive
,DefinitionSearchImplementation
,DefinitionsStore
,GlobalDefinitionsStore
,MutablePrismSchema
,PrismSchema
,DebugDumpable
,Cloneable
- Direct Known Subclasses:
ConnectorSchemaImpl
,ResourceSchemaImpl
- Author:
- Radovan Semancik
-
Field Summary
Modifier and TypeFieldDescriptionprotected final @NotNull Collection<Definition>
protected final @NotNull String
Namespace for items defined in this schema.protected PrismContext
Fields inherited from interface com.evolveum.midpoint.util.DebugDumpable
INDENT_STRING
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(@NotNull Definition def) void
addDelayedItemDefinition
(DefinitionSupplier supplier) void
addSubstitution
(QName substitutionHead, ItemDefinition<?> definition) protected void
clone()
protected void
copyContent
(PrismSchemaImpl target) createComplexTypeDefinition
(QName typeName) createContainerDefinition
(String localTypeName) Creates a new property container definition and adds it to the schema.createContainerDefinition
(String localItemName, String localTypeName) createPropertyDefinition
(String localName, QName typeName) Creates a top-level property definition and adds it to the schema.createPropertyDefinition
(QName name, QName typeName) Creates a top-level property definition and adds it to the schema.debugDump
(int indent) <C extends Containerable>
ComplexTypeDefinitionfindComplexTypeDefinitionByCompileTimeClass
(@NotNull Class<C> compileTimeClass) <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.<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>findTypeDefinitionsByType
(@NotNull QName typeName, @NotNull Class<TD> definitionClass) @NotNull Collection<Definition>
Returns set of definitions.<T extends Definition>
@NotNull List<T>getDefinitions
(@NotNull Class<T> type) Returns set of definitions of a given type.@NotNull String
Returns schema namespace.com.google.common.collect.Multimap<QName,
ItemDefinition<?>> boolean
isEmpty()
static PrismSchema
parse
(Element element, boolean isRuntime, String shortDescription, PrismContext prismContext) static PrismSchema
parse
(Element element, EntityResolver resolver, boolean isRuntime, String shortDescription, boolean allowDelayedItemDefinitions, PrismContext prismContext) void
parseThis
(Element element, boolean isRuntime, String shortDescription, PrismContext prismContext) void
void
registerCompileTimeClass
(Class<?> compileTimeClass, TypeDefinition typeDefinition) @NotNull Document
toString()
Methods inherited from class com.evolveum.midpoint.prism.AbstractFreezable
freeze, freeze, freezeAll, freezeNullableList, isImmutable, isMutable
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.evolveum.midpoint.util.DebugDumpable
debugDump, debugDumpLazily, debugDumpLazily
Methods inherited from interface com.evolveum.midpoint.prism.Freezable
checkImmutable, checkMutable, freeze, isImmutable
Methods inherited from interface com.evolveum.midpoint.prism.schema.GlobalDefinitionsStore
findComplexTypeDefinitionByType, findContainerDefinitionByCompileTimeClass, findContainerDefinitionByElementName, findContainerDefinitionByType, findItemDefinitionByCompileTimeClass, findItemDefinitionByElementName, findItemDefinitionByElementName, findItemDefinitionByType, findItemDefinitionsByElementName, findObjectDefinitionByCompileTimeClass, findObjectDefinitionByElementName, findObjectDefinitionByType, findPropertyDefinitionByElementName, findReferenceDefinitionByElementName, findSimpleTypeDefinitionByType, findTypeDefinitionByType, findTypeDefinitionsByType
Methods inherited from interface com.evolveum.midpoint.prism.schema.PrismSchema
getComplexTypeDefinitions, getObjectDefinitions
-
Field Details
-
definitions
-
namespace
Namespace for items defined in this schema. -
prismContext
-
-
Constructor Details
-
PrismSchemaImpl
-
-
Method Details
-
getNamespace
Description copied from interface:PrismSchema
Returns schema namespace. All schema definitions are placed in the returned namespace.- Specified by:
getNamespace
in interfacePrismSchema
- Returns:
- schema namespace
-
getDefinitions
Description copied from interface:PrismSchema
Returns set of definitions. The set contains all definitions of all types that were parsed. Order of definitions is insignificant.- Specified by:
getDefinitions
in interfacePrismSchema
- Returns:
- set of definitions
-
getDefinitions
@NotNull public <T extends Definition> @NotNull List<T> getDefinitions(@NotNull @NotNull Class<T> type) Description copied from interface:PrismSchema
Returns set of definitions of a given type. The set contains all definitions of the given type that were parsed. Order of definitions is insignificant.- Specified by:
getDefinitions
in interfacePrismSchema
- Returns:
- set of definitions
-
addDelayedItemDefinition
- Specified by:
addDelayedItemDefinition
in interfaceMutablePrismSchema
-
isEmpty
public boolean isEmpty()- Specified by:
isEmpty
in interfacePrismSchema
-
add
- Specified by:
add
in interfaceMutablePrismSchema
-
registerCompileTimeClass
- Specified by:
registerCompileTimeClass
in interfaceMutablePrismSchema
-
addSubstitution
- Specified by:
addSubstitution
in interfaceMutablePrismSchema
-
getSubstitutions
- Specified by:
getSubstitutions
in interfacePrismSchema
-
getPrismContext
- Specified by:
getPrismContext
in interfacePrismContextSensitive
-
parse
public static PrismSchema parse(Element element, boolean isRuntime, String shortDescription, PrismContext prismContext) throws SchemaException - Throws:
SchemaException
-
parse
public static PrismSchema parse(Element element, EntityResolver resolver, boolean isRuntime, String shortDescription, boolean allowDelayedItemDefinitions, PrismContext prismContext) throws SchemaException - Throws:
SchemaException
-
parseThis
public void parseThis(Element element, boolean isRuntime, String shortDescription, PrismContext prismContext) throws SchemaException - Specified by:
parseThis
in interfaceMutablePrismSchema
- Throws:
SchemaException
-
serializeToXsd
- Specified by:
serializeToXsd
in interfacePrismSchema
- Throws:
SchemaException
-
createContainerDefinition
Creates a new property container definition and adds it to the schema. This is a preferred way how to create definition in the schema.- Specified by:
createContainerDefinition
in interfaceMutablePrismSchema
- Parameters:
localTypeName
- type name "relative" to schema namespace- Returns:
- new property container definition
-
createContainerDefinition
public MutablePrismContainerDefinition<?> createContainerDefinition(String localItemName, String localTypeName) - Specified by:
createContainerDefinition
in interfaceMutablePrismSchema
-
createComplexTypeDefinition
- Specified by:
createComplexTypeDefinition
in interfaceMutablePrismSchema
-
createPropertyDefinition
Creates a top-level property definition and adds it to the schema. This is a preferred way how to create definition in the schema.- Specified by:
createPropertyDefinition
in interfaceMutablePrismSchema
- Parameters:
localName
- element name "relative" to schema namespacetypeName
- XSD type name of the element- Returns:
- new property definition
-
createPropertyDefinition
Creates a top-level property definition and adds it to the schema. This is a preferred way how to create definition in the schema.- Specified by:
createPropertyDefinition
in interfaceMutablePrismSchema
- Parameters:
name
- element nametypeName
- XSD type name of the element- Returns:
- new property definition
-
debugDump
- Specified by:
debugDump
in interfaceDebugDumpable
-
toString
-
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
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
-
findComplexTypeDefinitionByCompileTimeClass
public <C extends Containerable> ComplexTypeDefinition findComplexTypeDefinitionByCompileTimeClass(@NotNull @NotNull Class<C> compileTimeClass) - Specified by:
findComplexTypeDefinitionByCompileTimeClass
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<TD> findTypeDefinitionsByType(@NotNull @NotNull QName typeName, @NotNull @NotNull Class<TD> definitionClass) - Specified by:
findTypeDefinitionsByType
in interfaceGlobalDefinitionsStore
-
findTypeDefinitionByCompileTimeClass
@Nullable public <TD extends TypeDefinition> TD findTypeDefinitionByCompileTimeClass(@NotNull @NotNull Class<?> compileTimeClass, @NotNull @NotNull Class<TD> definitionClass) - Specified by:
findTypeDefinitionByCompileTimeClass
in interfaceGlobalDefinitionsStore
-
performFreeze
public void performFreeze()- Overrides:
performFreeze
in classAbstractFreezable
-
clone
-
copyContent
-
assertNoDelayedDefinitionsOnClone
protected void assertNoDelayedDefinitionsOnClone()
-