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
- Direct Known Subclasses:
 ConnectorSchemaImpl,ResourceSchemaImpl
public class PrismSchemaImpl extends AbstractFreezable implements MutablePrismSchema
- Author:
 - Radovan Semancik
 
 
- 
- 
Field Summary
Fields Modifier and Type Field Description protected @NotNull Collection<Definition>definitionsprotected @NotNull Stringnamespaceprotected PrismContextprismContext- 
Fields inherited from interface com.evolveum.midpoint.util.DebugDumpable
INDENT_STRING 
 - 
 
- 
Constructor Summary
Constructors Constructor Description PrismSchemaImpl(@NotNull String namespace, PrismContext prismContext) 
- 
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(@NotNull Definition def)voidaddDelayedItemDefinition(DefinitionSupplier supplier)voidaddSubstitution(QName substitutionHead, ItemDefinition<?> definition)ComplexTypeDefinitioncreateComplexTypeDefinition(QName typeName)PrismContainerDefinitionImplcreatePropertyContainerDefinition(String localTypeName)Creates a new property container definition and adds it to the schema.PrismContainerDefinitionImplcreatePropertyContainerDefinition(String localElementName, String localTypeName)PrismPropertyDefinitioncreatePropertyDefinition(String localName, QName typeName)Creates a top-level property definition and adds it to the schema.PrismPropertyDefinitioncreatePropertyDefinition(QName name, QName typeName)Creates a top-level property definition and adds it to the schema.StringdebugDump(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>getDefinitions()Returns set of definitions.<T extends Definition>
@NotNull List<T>getDefinitions(@NotNull Class<T> type)Returns set of definitions of a given type.@NotNull StringgetNamespace()Returns schema namespace.PrismContextgetPrismContext()com.google.common.collect.Multimap<QName,ItemDefinition<?>>getSubstitutions()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)voidperformFreeze()@NotNull DocumentserializeToXsd()StringtoString()- 
Methods inherited from class com.evolveum.midpoint.prism.AbstractFreezable
freeze, freeze, freezeAll, freezeNullableList, isImmutable, isMutable 
- 
Methods inherited from class java.lang.Object
clone, 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 Detail
- 
definitions
@NotNull protected final @NotNull Collection<Definition> definitions
 
- 
namespace
@NotNull protected final @NotNull String namespace
 
- 
prismContext
protected PrismContext prismContext
 
 - 
 
- 
Constructor Detail
- 
PrismSchemaImpl
public PrismSchemaImpl(@NotNull @NotNull String namespace, PrismContext prismContext) 
 - 
 
- 
Method Detail
- 
getNamespace
@NotNull public @NotNull String 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
@NotNull public @NotNull Collection<Definition> 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
public void addDelayedItemDefinition(DefinitionSupplier supplier)
- Specified by:
 addDelayedItemDefinitionin interfaceMutablePrismSchema
 
- 
isEmpty
public boolean isEmpty()
- Specified by:
 isEmptyin interfacePrismSchema
 
- 
add
public void add(@NotNull @NotNull Definition def)- Specified by:
 addin interfaceMutablePrismSchema
 
- 
addSubstitution
public void addSubstitution(QName substitutionHead, ItemDefinition<?> definition)
- Specified by:
 addSubstitutionin interfaceMutablePrismSchema
 
- 
getSubstitutions
public com.google.common.collect.Multimap<QName,ItemDefinition<?>> getSubstitutions()
- Specified by:
 getSubstitutionsin interfacePrismSchema
 
- 
getPrismContext
public PrismContext 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
@NotNull public @NotNull Document serializeToXsd() throws SchemaException
- Specified by:
 serializeToXsdin interfacePrismSchema- Throws:
 SchemaException
 
- 
createPropertyContainerDefinition
public PrismContainerDefinitionImpl createPropertyContainerDefinition(String localTypeName)
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:
 createPropertyContainerDefinitionin interfaceMutablePrismSchema- Parameters:
 localTypeName- type name "relative" to schema namespace- Returns:
 - new property container definition
 
 
- 
createPropertyContainerDefinition
public PrismContainerDefinitionImpl createPropertyContainerDefinition(String localElementName, String localTypeName)
- Specified by:
 createPropertyContainerDefinitionin interfaceMutablePrismSchema
 
- 
createComplexTypeDefinition
public ComplexTypeDefinition createComplexTypeDefinition(QName typeName)
- Specified by:
 createComplexTypeDefinitionin interfaceMutablePrismSchema
 
- 
createPropertyDefinition
public PrismPropertyDefinition createPropertyDefinition(String localName, QName typeName)
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
public PrismPropertyDefinition createPropertyDefinition(QName name, QName typeName)
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
public String debugDump(int indent)
- Specified by:
 debugDumpin interfaceDebugDumpable
 
- 
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
 
 - 
 
 -