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 StringNamespace for items defined in this schema.protected final @NotNull PrismContextImplFields 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 TypeMethodDescriptionvoidadd(@NotNull Definition def) Adds any definition (item or type).voidadd(@NotNull Definition.DefinitionBuilder builder) Adds the definition corresponding to provided builder - potentially incomplete - to the schema.voidSome containers cannot be added to the schema immediately, because their CTD is not yet parsed.protected voidbuilder()clone()protected voidcopyContent(PrismSchemaImpl target) debugDump(int indent) protected voidextendDebugDump(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 StringAll top-level definitions (types, items) are in this namespace.com.google.common.collect.Multimap<QName,ItemDefinition<?>> booleanmutator()newComplexTypeDefinitionLikeBuilder(String localTypeName) Returns the builder for complex type definition; does not add anything to the schema (yet).voidprotected @NotNull QNameReturn schemaRegistryState that will be used for resolving of schema.@NotNull DocumentvoidsetRuntime(boolean runtime) voidsetSourceDescription(String sourceDescription) toString()Methods inherited from class com.evolveum.midpoint.prism.impl.schema.SchemaRegistryStateAware
setSchemaLookupMethods 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, findTypeDefinitionsByElementName, findTypeDefinitionsByTypeMethods 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:PrismSchemaAll top-level definitions (types, items) are in this namespace.- Specified by:
getNamespacein interfacePrismSchema- Specified by:
getNamespacein interfaceSchemaBuilder- Specified by:
getNamespacein interfaceSerializableSchema
-
getDefinitions
Description copied from interface:PrismSchemaReturns 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:
getDefinitionsin interfacePrismSchema
-
getDefinitionsToSerialize
- Specified by:
getDefinitionsToSerializein interfaceSerializableSchema
-
getDefinitions
@NotNull public <T extends Definition> @NotNull List<T> getDefinitions(@NotNull @NotNull Class<T> type) Description copied from interface:PrismSchemaReturns a collection of definitions of a given type. Similar toPrismSchema.getDefinitions().- Specified by:
getDefinitionsin interfacePrismSchema
-
addDelayedItemDefinition
Description copied from interface:SchemaBuilderSome 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:
addDelayedItemDefinitionin interfaceSchemaBuilder
-
add
Description copied from interface:PrismSchema.PrismSchemaMutatorAdds any definition (item or type).- Specified by:
addin interfacePrismSchema.PrismSchemaMutator
-
newComplexTypeDefinitionLikeBuilder
@NotNull public @NotNull ComplexTypeDefinition.ComplexTypeDefinitionLikeBuilder newComplexTypeDefinitionLikeBuilder(String localTypeName) Description copied from interface:SchemaBuilderReturns the builder for complex type definition; does not add anything to the schema (yet). We use this one instead of simply creating a newComplexTypeDefinitionusing theDefinitionFactoryin order to be able to build non-prism definitions, i.e., ones that are not ofDefinitiontype.- Specified by:
newComplexTypeDefinitionLikeBuilderin interfaceSchemaBuilder
-
add
Description copied from interface:SchemaBuilderAdds the definition corresponding to provided builder - potentially incomplete - to the schema.- Specified by:
addin interfaceSchemaBuilder
-
builder
- Specified by:
builderin interfacePrismSchema
-
getSubstitutions
- Specified by:
getSubstitutionsin interfacePrismSchema
-
serializeToXsd
- Specified by:
serializeToXsdin interfacePrismSchema- Throws:
SchemaException
-
debugDump
- Specified by:
debugDumpin 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: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
Description copied from interface:SchemaBuilderReturns 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:
findTypeDefinitionByTypein interfaceGlobalDefinitionsStore- Specified by:
findTypeDefinitionByTypein interfaceSchemaBuilder
-
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 classSchemaRegistryStateAware
-
clone
-
mutator
- Specified by:
mutatorin interfacePrismSchema
-
copyContent
-
assertNoDelayedDefinitionsOnClone
protected void assertNoDelayedDefinitionsOnClone() -
qualify
-
isRuntime
public boolean isRuntime()- Specified by:
isRuntimein interfacePrismSchema- Specified by:
isRuntimein interfaceSchemaBuilder
-
setRuntime
public void setRuntime(boolean runtime) - Specified by:
setRuntimein interfaceSchemaBuilder
-
getSourceDescription
- Specified by:
getSourceDescriptionin interfacePrismSchema
-
setSourceDescription
-
getCompileTimePackage
-
schemaLookup
Description copied from class:SchemaRegistryStateAwareReturn 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:
schemaLookupin interfaceSchemaLookup.Aware- Overrides:
schemaLookupin classSchemaRegistryStateAware- Returns:
- SchemaRegistryState that can be used for resolving of schema
-