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
FieldsModifier and TypeFieldDescriptionprotected final @NotNull Collection<Definition>protected final @NotNull StringNamespace for items defined in this schema.protected PrismContextFields inherited from interface com.evolveum.midpoint.util.DebugDumpable
INDENT_STRING -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(@NotNull Definition def) voidaddDelayedItemDefinition(DefinitionSupplier supplier) voidaddSubstitution(QName substitutionHead, ItemDefinition<?> definition) protected voidclone()protected voidcopyContent(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 StringReturns schema namespace.com.google.common.collect.Multimap<QName,ItemDefinition<?>> booleanisEmpty()static PrismSchemaparse(Element element, boolean isRuntime, String shortDescription, PrismContext prismContext) static PrismSchemaparse(Element element, EntityResolver resolver, boolean isRuntime, String shortDescription, boolean allowDelayedItemDefinitions, PrismContext prismContext) voidparseThis(Element element, boolean isRuntime, String shortDescription, PrismContext prismContext) voidvoidregisterCompileTimeClass(Class<?> compileTimeClass, TypeDefinition typeDefinition) @NotNull DocumenttoString()Methods inherited from class com.evolveum.midpoint.prism.AbstractFreezable
freeze, freeze, freezeAll, freezeNullableList, isImmutable, isMutableMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.evolveum.midpoint.util.DebugDumpable
debugDump, debugDumpLazily, debugDumpLazilyMethods inherited from interface com.evolveum.midpoint.prism.Freezable
checkImmutable, checkMutable, freeze, isImmutableMethods 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, findTypeDefinitionsByTypeMethods 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:PrismSchemaReturns schema namespace. All schema definitions are placed in the returned namespace.- Specified by:
getNamespacein interfacePrismSchema- Returns:
- schema namespace
-
getDefinitions
Description copied from interface:PrismSchemaReturns set of definitions. The set contains all definitions of all types that were parsed. Order of definitions is insignificant.- Specified by:
getDefinitionsin interfacePrismSchema- Returns:
- set of definitions
-
getDefinitions
@NotNull public <T extends Definition> @NotNull List<T> getDefinitions(@NotNull @NotNull Class<T> type) Description copied from interface:PrismSchemaReturns 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:
getDefinitionsin interfacePrismSchema- Returns:
- set of definitions
-
addDelayedItemDefinition
- Specified by:
addDelayedItemDefinitionin interfaceMutablePrismSchema
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfacePrismSchema
-
add
- Specified by:
addin interfaceMutablePrismSchema
-
registerCompileTimeClass
- Specified by:
registerCompileTimeClassin interfaceMutablePrismSchema
-
addSubstitution
- Specified by:
addSubstitutionin interfaceMutablePrismSchema
-
getSubstitutions
- Specified by:
getSubstitutionsin interfacePrismSchema
-
getPrismContext
- Specified by:
getPrismContextin 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:
parseThisin interfaceMutablePrismSchema- Throws:
SchemaException
-
serializeToXsd
- Specified by:
serializeToXsdin 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:
createContainerDefinitionin interfaceMutablePrismSchema- Parameters:
localTypeName- type name "relative" to schema namespace- Returns:
- new property container definition
-
createContainerDefinition
public MutablePrismContainerDefinition<?> createContainerDefinition(String localItemName, String localTypeName) - Specified by:
createContainerDefinitionin interfaceMutablePrismSchema
-
createComplexTypeDefinition
- Specified by:
createComplexTypeDefinitionin 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:
createPropertyDefinitionin 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:
createPropertyDefinitionin interfaceMutablePrismSchema- Parameters:
name- element nametypeName- XSD type name of the element- Returns:
- new property definition
-
debugDump
- Specified by:
debugDumpin 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:GlobalDefinitionsStoreLooking 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:
findItemDefinitionsByCompileTimeClassin interfaceGlobalDefinitionsStore
-
findItemDefinitionByType
public <ID extends ItemDefinition> ID findItemDefinitionByType(@NotNull @NotNull QName typeName, @NotNull @NotNull Class<ID> definitionClass) Description copied from interface:GlobalDefinitionsStoreLooking 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:
findItemDefinitionByTypein interfaceGlobalDefinitionsStore
-
findItemDefinitionsByElementName
@NotNull public <ID extends ItemDefinition> @NotNull List<ID> findItemDefinitionsByElementName(@NotNull @NotNull QName elementName, @NotNull @NotNull Class<ID> definitionClass) Description copied from interface:GlobalDefinitionsStoreLooking 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:
findItemDefinitionsByElementNamein interfaceGlobalDefinitionsStore
-
findComplexTypeDefinitionByCompileTimeClass
public <C extends Containerable> ComplexTypeDefinition findComplexTypeDefinitionByCompileTimeClass(@NotNull @NotNull Class<C> compileTimeClass) - Specified by:
findComplexTypeDefinitionByCompileTimeClassin interfaceGlobalDefinitionsStore
-
findTypeDefinitionByType
@Nullable public <TD extends TypeDefinition> TD findTypeDefinitionByType(@NotNull @NotNull QName typeName, @NotNull @NotNull Class<TD> definitionClass) - Specified by:
findTypeDefinitionByTypein interfaceGlobalDefinitionsStore
-
findTypeDefinitionsByType
@NotNull public <TD extends TypeDefinition> @NotNull Collection<TD> findTypeDefinitionsByType(@NotNull @NotNull QName typeName, @NotNull @NotNull Class<TD> definitionClass) - Specified by:
findTypeDefinitionsByTypein interfaceGlobalDefinitionsStore
-
findTypeDefinitionByCompileTimeClass
@Nullable public <TD extends TypeDefinition> TD findTypeDefinitionByCompileTimeClass(@NotNull @NotNull Class<?> compileTimeClass, @NotNull @NotNull Class<TD> definitionClass) - Specified by:
findTypeDefinitionByCompileTimeClassin interfaceGlobalDefinitionsStore
-
performFreeze
public void performFreeze()- Overrides:
performFreezein classAbstractFreezable
-
clone
-
copyContent
-
assertNoDelayedDefinitionsOnClone
protected void assertNoDelayedDefinitionsOnClone()
-