Package com.evolveum.midpoint.prism
Interface PrismContext
-
- All Superinterfaces:
ProtectorCreator
- All Known Implementing Classes:
PrismContextImpl
public interface PrismContext extends ProtectorCreator
- Author:
- semancik, mederly
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description void
adopt(Containerable containerable)
<T extends Objectable>
voidadopt(ObjectDelta<T> delta)
void
adopt(Objectable objectable)
<C extends Containerable>
voidadopt(PrismContainer<C> object, Class<C> declaredType)
<T extends Containerable>
voidadopt(PrismContainer<T> object)
void
adopt(PrismContainerValue value)
<C extends Containerable,O extends Objectable>
voidadopt(PrismContainerValue<C> prismContainerValue, Class<O> type, ItemPath path)
<C extends Containerable,O extends Objectable>
voidadopt(PrismContainerValue<C> prismContainerValue, QName typeName, ItemPath path)
<C extends Containerable,O extends Objectable>
voidadopt(C containerable, Class<O> type, ItemPath path)
boolean
canSerialize(Object value)
TODOvoid
configurePolyStringNormalizer(PolyStringNormalizerConfigurationType configuration)
CanonicalItemPath
createCanonicalItemPath(ItemPath itemPath)
TemporaryCanonicalItemPath
createCanonicalItemPath(ItemPath itemPath, Class<? extends Containerable> clazz)
Temporary<O extends Objectable>
PrismObject<O>createKnownObject(Class<O> clazz)
Creates a new PrismObject of a given static type.<O extends Objectable>
OcreateKnownObjectable(Class<O> clazz)
Creates a new Objectable of a given static type.<O extends Objectable>
PrismObject<O>createObject(Class<O> clazz)
Creates a new PrismObject of a given type.<O extends Objectable>
OcreateObjectable(Class<O> clazz)
Creates a new Objectable of a given type.ParsingContext
createParsingContextForAllowMissingRefTypes()
ParsingContext
createParsingContextForCompatibilityMode()
DefinitionFactory
definitionFactory()
DeltaFactory
deltaFactory()
<C extends Containerable>
S_ItemEntrydeltaFor(Class<C> objectClass)
String
detectLanguage(File file)
PrismSerializer<Element>
domSerializer()
Creates a serializer for DOM.UniformItemPath
emptyPath()
ParsingContext
getDefaultParsingContext()
PolyStringNormalizer
getDefaultPolyStringNormalizer()
Returns the default PolyString normalizer.Protector
getDefaultProtector()
Returns the default protector.QName
getDefaultRelation()
If defined, it is considered to be the same as the relation of 'null'.LSResourceResolver
getEntityResolver()
Deprecated.JaxbDomHack
getJaxbDomHack()
Deprecated.PrismMonitor
getMonitor()
QName
getObjectsElementName()
If defined, marks the 'multiple objects' element.ParsingMigrator
getParsingMigrator()
QueryConverter
getQueryConverter()
SchemaRegistry
getSchemaRegistry()
Returns the schema registry.Hacks
hacks()
void
initialize()
Initializes the prism context, e.g.boolean
isDefaultRelation(QName relation)
ItemFactory
itemFactory()
ItemPathParser
itemPathParser()
PrismSerializer<String>
jsonSerializer()
Creates a serializer for JSON language.default <T extends Objectable>
PrismObject<T>parseObject(File file)
default <T extends Objectable>
PrismObject<T>parseObject(String dataString)
PrismParserNoIO
parserFor(RootXNode xnode)
Creates a parser ready to process data from the given XNode tree.PrismParser
parserFor(File file)
Creates a parser ready to process the given file.PrismParser
parserFor(InputStream stream)
Creates a parser ready to process data from the given input stream.PrismParserNoIO
parserFor(String data)
Creates a parser ready to process data from the given string.PrismParserNoIO
parserFor(Element element)
Creates a parser ready to process data from the given DOM element.UniformItemPath
path(Object... namesOrIdsOrSegments)
QueryFactory
queryFactory()
S_FilterEntryOrEmpty
queryFor(Class<? extends Containerable> queryClass)
boolean
relationMatches(List<QName> relationQuery, QName relation)
Returns true of any of the relation in the relationQuery list matches specified relation.boolean
relationMatches(QName relationQuery, QName relation)
boolean
relationsEquivalent(QName relation1, QName relation2)
SchemaFactory
schemaFactory()
<O extends Objectable>
StringserializeObjectToString(PrismObject<O> object, String language)
Deprecated.PrismSerializer<String>
serializerFor(String language)
Creates a serializer for the given language.void
setDefaultRelation(QName name)
void
setExtraValidation(boolean value)
void
setMonitor(PrismMonitor monitor)
void
setParsingMigrator(ParsingMigrator migrator)
default ItemPath
toPath(ItemPathType path)
UniformItemPath
toUniformPath(ItemPath path)
TemporaryUniformItemPath
toUniformPath(ItemPathType path)
UniformItemPath
toUniformPathKeepNull(ItemPath path)
PrismSerializer<String>
xmlSerializer()
Creates a serializer for XML language.XNodeFactory
xnodeFactory()
XNodeMutator
xnodeMutator()
PrismSerializer<RootXNode>
xnodeSerializer()
Creates a serializer for XNode.PrismSerializer<String>
yamlSerializer()
Creates a serializer for YAML language.-
Methods inherited from interface com.evolveum.midpoint.prism.crypto.ProtectorCreator
createInitializedProtector, createProtector
-
-
-
-
Field Detail
-
LANG_XML
static final String LANG_XML
- See Also:
- Constant Field Values
-
LANG_JSON
static final String LANG_JSON
- See Also:
- Constant Field Values
-
LANG_YAML
static final String LANG_YAML
- See Also:
- Constant Field Values
-
-
Method Detail
-
initialize
void initialize() throws SchemaException, SAXException, IOException
Initializes the prism context, e.g. loads and parses all the schemas.- Throws:
SchemaException
SAXException
IOException
-
configurePolyStringNormalizer
void configurePolyStringNormalizer(PolyStringNormalizerConfigurationType configuration) throws ClassNotFoundException, InstantiationException, IllegalAccessException
-
getSchemaRegistry
@NotNull SchemaRegistry getSchemaRegistry()
Returns the schema registry.
-
getDefaultPolyStringNormalizer
@NotNull PolyStringNormalizer getDefaultPolyStringNormalizer()
Returns the default PolyString normalizer.
-
getDefaultProtector
Protector getDefaultProtector()
Returns the default protector. (TODO)
-
getQueryConverter
@NotNull QueryConverter getQueryConverter()
-
parserFor
@NotNull PrismParser parserFor(@NotNull File file)
Creates a parser ready to process the given file.- Parameters:
file
- File to be parsed.- Returns:
- Parser that can be invoked to retrieve the (parsed) content of the file.
-
parserFor
@NotNull PrismParser parserFor(@NotNull InputStream stream)
Creates a parser ready to process data from the given input stream.- Parameters:
stream
- Input stream to be parsed.- Returns:
- Parser that can be invoked to retrieve the (parsed) content of the input stream.
-
parserFor
@NotNull PrismParserNoIO parserFor(@NotNull String data)
Creates a parser ready to process data from the given string.- Parameters:
data
- String with the data to be parsed. It has be in UTF-8 encoding. (For other encodings please use InputStream or File source.)- Returns:
- Parser that can be invoked to retrieve the (parsed) content.
-
parserFor
@NotNull PrismParserNoIO parserFor(@NotNull RootXNode xnode)
Creates a parser ready to process data from the given XNode tree.- Parameters:
xnode
- XNode tree with the data to be parsed.- Returns:
- Parser that can be invoked to retrieve the (parsed) content.
-
parserFor
@NotNull PrismParserNoIO parserFor(@NotNull Element element)
Creates a parser ready to process data from the given DOM element.- Parameters:
element
- Element with the data to be parsed.- Returns:
- Parser that can be invoked to retrieve the (parsed) content.
-
detectLanguage
@NotNull String detectLanguage(@NotNull File file) throws IOException
- Throws:
IOException
-
parseObject
default <T extends Objectable> PrismObject<T> parseObject(File file) throws SchemaException, IOException
- Throws:
SchemaException
IOException
-
parseObject
default <T extends Objectable> PrismObject<T> parseObject(String dataString) throws SchemaException
- Throws:
SchemaException
-
getParsingMigrator
ParsingMigrator getParsingMigrator()
-
setParsingMigrator
void setParsingMigrator(ParsingMigrator migrator)
-
adopt
<C extends Containerable> void adopt(PrismContainer<C> object, Class<C> declaredType) throws SchemaException
- Throws:
SchemaException
-
adopt
<T extends Containerable> void adopt(PrismContainer<T> object) throws SchemaException
- Throws:
SchemaException
-
adopt
void adopt(Objectable objectable) throws SchemaException
- Throws:
SchemaException
-
adopt
void adopt(Containerable containerable) throws SchemaException
- Throws:
SchemaException
-
adopt
void adopt(PrismContainerValue value) throws SchemaException
- Throws:
SchemaException
-
adopt
<T extends Objectable> void adopt(ObjectDelta<T> delta) throws SchemaException
- Throws:
SchemaException
-
adopt
<C extends Containerable,O extends Objectable> void adopt(C containerable, Class<O> type, ItemPath path) throws SchemaException
- Throws:
SchemaException
-
adopt
<C extends Containerable,O extends Objectable> void adopt(PrismContainerValue<C> prismContainerValue, Class<O> type, ItemPath path) throws SchemaException
- Throws:
SchemaException
-
adopt
<C extends Containerable,O extends Objectable> void adopt(PrismContainerValue<C> prismContainerValue, QName typeName, ItemPath path) throws SchemaException
- Throws:
SchemaException
-
serializerFor
@NotNull PrismSerializer<String> serializerFor(@NotNull String language)
Creates a serializer for the given language.- Parameters:
language
- Language (like xml, json, yaml).- Returns:
- The serializer.
-
xmlSerializer
@NotNull PrismSerializer<String> xmlSerializer()
Creates a serializer for XML language.- Returns:
- The serializer.
-
jsonSerializer
@NotNull PrismSerializer<String> jsonSerializer()
Creates a serializer for JSON language.- Returns:
- The serializer.
-
yamlSerializer
@NotNull PrismSerializer<String> yamlSerializer()
Creates a serializer for YAML language.- Returns:
- The serializer.
-
domSerializer
@NotNull PrismSerializer<Element> domSerializer()
Creates a serializer for DOM. The difference from XML serializer is that XML produces String output whereas this one produces a DOM Element.- Returns:
- The serializer.
-
xnodeSerializer
@NotNull PrismSerializer<RootXNode> xnodeSerializer()
Creates a serializer for XNode. The output of this serializer is intermediate XNode representation.- Returns:
- The serializer.
-
serializeObjectToString
@Deprecated <O extends Objectable> String serializeObjectToString(PrismObject<O> object, String language) throws SchemaException
Deprecated.- Throws:
SchemaException
-
canSerialize
boolean canSerialize(Object value)
TODO- Parameters:
value
-- Returns:
-
createObject
@NotNull <O extends Objectable> PrismObject<O> createObject(@NotNull Class<O> clazz) throws SchemaException
Creates a new PrismObject of a given type.- Parameters:
clazz
- Static type of the object to be created.- Returns:
- New PrismObject.
- Throws:
SchemaException
- If a definition for the given class couldn't be found.
-
createObjectable
@NotNull <O extends Objectable> O createObjectable(@NotNull Class<O> clazz) throws SchemaException
Creates a new Objectable of a given type.- Parameters:
clazz
- Static type of the object to be created.- Returns:
- New PrismObject's objectable content.
- Throws:
SchemaException
- If a definition for the given class couldn't be found.
-
createKnownObject
@NotNull <O extends Objectable> PrismObject<O> createKnownObject(@NotNull Class<O> clazz)
Creates a new PrismObject of a given static type. It is expected that the type exists, so any SchemaExceptions will be thrown as run-time exception.- Parameters:
clazz
- Static type of the object to be created.- Returns:
- New PrismObject.
-
createKnownObjectable
@NotNull <O extends Objectable> O createKnownObjectable(@NotNull Class<O> clazz)
Creates a new Objectable of a given static type. It is expected that the type exists, so any SchemaExceptions will be thrown as run-time exception.- Parameters:
clazz
- Static type of the object to be created.- Returns:
- New PrismObject's objectable content.
-
getEntityResolver
@Deprecated LSResourceResolver getEntityResolver()
Deprecated.Do not use.
-
getJaxbDomHack
@NotNull @Deprecated JaxbDomHack getJaxbDomHack()
Deprecated.TODO eliminate this method
-
getMonitor
PrismMonitor getMonitor()
-
setMonitor
void setMonitor(PrismMonitor monitor)
-
getDefaultRelation
QName getDefaultRelation()
If defined, it is considered to be the same as the relation of 'null'. Currently in midPoint, it is the value of org:default.
-
setDefaultRelation
void setDefaultRelation(QName name)
-
getObjectsElementName
QName getObjectsElementName()
If defined, marks the 'multiple objects' element.
-
isDefaultRelation
boolean isDefaultRelation(QName relation)
-
relationMatches
boolean relationMatches(@NotNull List<QName> relationQuery, QName relation)
Returns true of any of the relation in the relationQuery list matches specified relation.
-
getDefaultParsingContext
ParsingContext getDefaultParsingContext()
-
createParsingContextForAllowMissingRefTypes
ParsingContext createParsingContextForAllowMissingRefTypes()
-
createParsingContextForCompatibilityMode
ParsingContext createParsingContextForCompatibilityMode()
-
emptyPath
UniformItemPath emptyPath()
-
path
UniformItemPath path(Object... namesOrIdsOrSegments)
-
hacks
Hacks hacks()
-
xnodeFactory
XNodeFactory xnodeFactory()
-
xnodeMutator
XNodeMutator xnodeMutator()
-
toUniformPath
@NotNull UniformItemPath toUniformPath(ItemPath path)
Temporary
-
toUniformPathKeepNull
@Nullable UniformItemPath toUniformPathKeepNull(ItemPath path)
-
toUniformPath
UniformItemPath toUniformPath(ItemPathType path)
-
toPath
default ItemPath toPath(ItemPathType path)
-
createCanonicalItemPath
CanonicalItemPath createCanonicalItemPath(ItemPath itemPath, Class<? extends Containerable> clazz)
Temporary
-
createCanonicalItemPath
CanonicalItemPath createCanonicalItemPath(ItemPath itemPath)
Temporary
-
deltaFor
<C extends Containerable> S_ItemEntry deltaFor(Class<C> objectClass) throws SchemaException
- Throws:
SchemaException
-
queryFor
S_FilterEntryOrEmpty queryFor(Class<? extends Containerable> queryClass)
-
deltaFactory
@NotNull DeltaFactory deltaFactory()
-
queryFactory
@NotNull QueryFactory queryFactory()
-
itemFactory
@NotNull ItemFactory itemFactory()
-
definitionFactory
@NotNull DefinitionFactory definitionFactory()
-
itemPathParser
@NotNull ItemPathParser itemPathParser()
-
setExtraValidation
void setExtraValidation(boolean value)
-
schemaFactory
@NotNull SchemaFactory schemaFactory()
-
-