Class PrismSchemaImpl
java.lang.Object
com.evolveum.midpoint.prism.AbstractFreezable
com.evolveum.midpoint.prism.impl.schema.SchemaRegistryStateAware
com.evolveum.midpoint.prism.impl.schema.PrismSchemaImpl
- All Implemented Interfaces:
Freezable
,DefinitionSearchImplementation
,DefinitionsStore
,GlobalDefinitionsStore
,PrismSchema
,PrismSchema.PrismSchemaMutator
,SchemaBuilder
,SchemaLookup.Aware
,SerializableSchema
,DebugDumpable
,Cloneable
- Direct Known Subclasses:
ConnectorSchemaImpl
,ResourceSchemaImpl
public class PrismSchemaImpl
extends SchemaRegistryStateAware
implements PrismSchema, PrismSchema.PrismSchemaMutator, SchemaBuilder, SerializableSchema
- Author:
- Radovan Semancik
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.evolveum.midpoint.prism.schema.PrismSchema
PrismSchema.PrismSchemaMutator
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final @NotNull Collection<Definition>
protected final @NotNull String
Namespace for items defined in this schema.protected final @NotNull PrismContextImpl
Fields inherited from interface com.evolveum.midpoint.util.DebugDumpable
INDENT_STRING
-
Constructor Summary
ConstructorsConstructorDescriptionPrismSchemaImpl
(@NotNull String namespace) PrismSchemaImpl
(@NotNull String namespace, @Nullable Package compileTimePackage) -
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(@NotNull Definition def) Adds any definition (item or type).void
add
(@NotNull Definition.DefinitionBuilder builder) Adds the definition corresponding to provided builder - potentially incomplete - to the schema.void
Some containers cannot be added to the schema immediately, because their CTD is not yet parsed.protected void
builder()
clone()
protected void
copyContent
(PrismSchemaImpl target) debugDump
(int indent) protected void
extendDebugDump
(StringBuilder sb, 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) findTypeDefinitionByType
(@NotNull QName typeName) Returns existing type definition (if there's one) in the schema being built.<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 all definitions: both types and items.<T extends Definition>
@NotNull List<T>getDefinitions
(@NotNull Class<T> type) Returns a collection of definitions of a given type.@NotNull Collection<? extends SerializableDefinition>
@NotNull String
All top-level definitions (types, items) are in this namespace.com.google.common.collect.Multimap<QName,
ItemDefinition<?>> boolean
mutator()
newComplexTypeDefinitionLikeBuilder
(String localTypeName) Returns the builder for complex type definition; does not add anything to the schema (yet).void
protected @NotNull QName
Return schemaRegistryState that will be used for resolving of schema.@NotNull Document
void
setRuntime
(boolean runtime) void
setSourceDescription
(String sourceDescription) toString()
Methods inherited from class com.evolveum.midpoint.prism.impl.schema.SchemaRegistryStateAware
setSchemaLookup
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, findTypeDefinitionsByElementName, findTypeDefinitionsByType
Methods inherited from interface com.evolveum.midpoint.prism.schema.PrismSchema
getComplexTypeDefinitions, getObjectDefinitions, isEmpty, size
-
Field Details
-
definitions
-
namespace
Namespace for items defined in this schema. -
prismContext
-
-
Constructor Details
-
PrismSchemaImpl
-
PrismSchemaImpl
-
-
Method Details
-
getNamespace
Description copied from interface:PrismSchema
All top-level definitions (types, items) are in this namespace.- Specified by:
getNamespace
in interfacePrismSchema
- Specified by:
getNamespace
in interfaceSchemaBuilder
- Specified by:
getNamespace
in interfaceSerializableSchema
-
getDefinitions
Description copied from interface:PrismSchema
Returns all definitions: both types and items. Their order is insignificant. The collection is unmodifiable. The returned value should not be used for looking up specific definitions, as there may be thousands of them. Use more specific lookup methods instead.- Specified by:
getDefinitions
in interfacePrismSchema
-
getDefinitionsToSerialize
- Specified by:
getDefinitionsToSerialize
in interfaceSerializableSchema
-
getDefinitions
@NotNull public <T extends Definition> @NotNull List<T> getDefinitions(@NotNull @NotNull Class<T> type) Description copied from interface:PrismSchema
Returns a collection of definitions of a given type. Similar toPrismSchema.getDefinitions()
.- Specified by:
getDefinitions
in interfacePrismSchema
-
addDelayedItemDefinition
Description copied from interface:SchemaBuilder
Some containers cannot be added to the schema immediately, because their CTD is not yet parsed. This can occur when multiple schemas with circular dependencies are present. So we add them only after all the schemas are parsed.- Specified by:
addDelayedItemDefinition
in interfaceSchemaBuilder
-
add
Description copied from interface:PrismSchema.PrismSchemaMutator
Adds any definition (item or type).- Specified by:
add
in interfacePrismSchema.PrismSchemaMutator
-
newComplexTypeDefinitionLikeBuilder
@NotNull public @NotNull ComplexTypeDefinition.ComplexTypeDefinitionLikeBuilder newComplexTypeDefinitionLikeBuilder(String localTypeName) Description copied from interface:SchemaBuilder
Returns the builder for complex type definition; does not add anything to the schema (yet). We use this one instead of simply creating a newComplexTypeDefinition
using theDefinitionFactory
in order to be able to build non-prism definitions, i.e., ones that are not ofDefinition
type.- Specified by:
newComplexTypeDefinitionLikeBuilder
in interfaceSchemaBuilder
-
add
Description copied from interface:SchemaBuilder
Adds the definition corresponding to provided builder - potentially incomplete - to the schema.- Specified by:
add
in interfaceSchemaBuilder
-
builder
- Specified by:
builder
in interfacePrismSchema
-
getSubstitutions
- Specified by:
getSubstitutions
in interfacePrismSchema
-
serializeToXsd
- Specified by:
serializeToXsd
in interfacePrismSchema
- Throws:
SchemaException
-
debugDump
- Specified by:
debugDump
in interfaceDebugDumpable
-
extendDebugDump
-
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
Description copied from interface:SchemaBuilder
Returns existing type definition (if there's one) in the schema being built. This is used when types can be referenced by other types, e.g., in the case of complex types. Its implementation is optional; currently, it is used only in genuine prism schemas.- Specified by:
findTypeDefinitionByType
in interfaceGlobalDefinitionsStore
- Specified by:
findTypeDefinitionByType
in interfaceSchemaBuilder
-
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 classSchemaRegistryStateAware
-
clone
-
mutator
- Specified by:
mutator
in interfacePrismSchema
-
copyContent
-
assertNoDelayedDefinitionsOnClone
protected void assertNoDelayedDefinitionsOnClone() -
qualify
-
isRuntime
public boolean isRuntime()- Specified by:
isRuntime
in interfacePrismSchema
- Specified by:
isRuntime
in interfaceSchemaBuilder
-
setRuntime
public void setRuntime(boolean runtime) - Specified by:
setRuntime
in interfaceSchemaBuilder
-
getSourceDescription
- Specified by:
getSourceDescription
in interfacePrismSchema
-
setSourceDescription
-
getCompileTimePackage
-
schemaLookup
Description copied from class:SchemaRegistryStateAware
Return schemaRegistryState that will be used for resolving of schema. This method is used to move the variable to another class. For resolving of definition useSchemaRegistryStateAware.schemaLookup()
.- Specified by:
schemaLookup
in interfaceSchemaLookup.Aware
- Overrides:
schemaLookup
in classSchemaRegistryStateAware
- Returns:
- SchemaRegistryState that can be used for resolving of schema
-