Class PrismParserImplNoIO
java.lang.Object
com.evolveum.midpoint.prism.impl.marshaller.PrismParserImplNoIO
- All Implemented Interfaces:
PrismParser
,PrismParserNoIO
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.evolveum.midpoint.prism.PrismParser
PrismParser.ObjectHandler
-
Constructor Summary
ConstructorDescriptionPrismParserImplNoIO
(ParserSource source, String language, ParsingContext context, PrismContextImpl prismContext, ItemDefinition<?> itemDefinition, QName itemName, QName dataType, Class<?> dataClass) -
Method Summary
Modifier and TypeMethodDescription@NotNull PrismParserNoIO
compat()
Switches the parser into "compatibility" (or relaxed) parsing mode.@NotNull PrismParserNoIO
context
(@NotNull ParsingContext context) Provides a parsing context for the parser.@NotNull PrismParserNoIO
definition
(ItemDefinition<?> itemDefinition) Tells parser which definition to use when parsing item (or an item value).@NotNull PrismParserNoIO
Does not check for existing values during parsing.@NotNull PrismParserNoIO
json()
Sets the language of the parser to be JSON.@NotNull PrismParserNoIO
For string inputs: sets the data language that the parser will try to parse; null means auto-detect.@NotNull PrismParserNoIO
Tells parser what name to use for parsed item.<O extends Objectable>
@NotNull PrismObject<O>parse()
Parses the input as a prism object.<IV extends PrismValue,
ID extends ItemDefinition<?>>
Item<IV,ID> Parses the input as a prism item.Parses either an item, or a real value.<IV extends PrismValue>
IVParses the input as a prism value.@NotNull List<PrismObject<? extends Objectable>>
Parses the input as a collection of prism objects.void
parseObjectsIteratively
(@NotNull PrismParser.ObjectHandler handler) Currently implemented for JSON/YAML only.<T> T
Parses a real value.<T> T
parseRealValue
(Class<T> clazz) Parses a real value - either property or container value.<T> jakarta.xml.bind.JAXBElement<T>
Parses a real value and stores it into JAXBElement, using item name derived in the usual way.Parses the input into RootXNode.@NotNull PrismParserNoIO
strict()
Switches the parser into "strict" parsing mode.@NotNull PrismParserNoIO
Tells parser what data type to expect.@NotNull PrismParserNoIO
Tells parser what data type to expect.@NotNull PrismParserNoIO
xml()
Sets the language of the parser to be XML.@NotNull PrismParserNoIO
yaml()
Sets the language of the parser to be YAML.
-
Constructor Details
-
PrismParserImplNoIO
public PrismParserImplNoIO(ParserSource source, String language, ParsingContext context, PrismContextImpl prismContext, ItemDefinition<?> itemDefinition, QName itemName, QName dataType, Class<?> dataClass)
-
-
Method Details
-
language
Description copied from interface:PrismParser
For string inputs: sets the data language that the parser will try to parse; null means auto-detect. For other kinds of input (DOM and XNode) the language is fixed to XML or none, respectively.- Specified by:
language
in interfacePrismParser
- Specified by:
language
in interfacePrismParserNoIO
- Parameters:
language
- The language- Returns:
- Updated parser.
-
xml
Description copied from interface:PrismParser
Sets the language of the parser to be XML.- Specified by:
xml
in interfacePrismParser
- Specified by:
xml
in interfacePrismParserNoIO
- Returns:
- Updated parser.
-
json
Description copied from interface:PrismParser
Sets the language of the parser to be JSON.- Specified by:
json
in interfacePrismParser
- Specified by:
json
in interfacePrismParserNoIO
- Returns:
- Updated parser.
-
yaml
Description copied from interface:PrismParser
Sets the language of the parser to be YAML.- Specified by:
yaml
in interfacePrismParser
- Specified by:
yaml
in interfacePrismParserNoIO
- Returns:
- Updated parser.
-
context
Description copied from interface:PrismParser
Provides a parsing context for the parser. The context contains e.g. selection of strict/compat mode of operation (set by client) or a list of warnings (maintained by the parser).- Specified by:
context
in interfacePrismParser
- Specified by:
context
in interfacePrismParserNoIO
- Parameters:
context
- The parsing context.- Returns:
- Updated parser.
-
strict
Description copied from interface:PrismParser
Switches the parser into "strict" parsing mode.- Specified by:
strict
in interfacePrismParser
- Specified by:
strict
in interfacePrismParserNoIO
- Returns:
- Updated parser.
-
compat
Description copied from interface:PrismParser
Switches the parser into "compatibility" (or relaxed) parsing mode. TODO description here- Specified by:
compat
in interfacePrismParser
- Specified by:
compat
in interfacePrismParserNoIO
- Returns:
- Updated parser.
-
fastAddOperations
Description copied from interface:PrismParser
Does not check for existing values during parsing. To be used in situations where the data can be trusted to not contain duplicates - for example, when reading from the repository.- Specified by:
fastAddOperations
in interfacePrismParser
- Specified by:
fastAddOperations
in interfacePrismParserNoIO
-
definition
Description copied from interface:PrismParser
Tells parser which definition to use when parsing item (or an item value). Optional.- Specified by:
definition
in interfacePrismParser
- Specified by:
definition
in interfacePrismParserNoIO
- Parameters:
itemDefinition
- The definition- Returns:
- Updated parser.
-
name
Description copied from interface:PrismParser
Tells parser what name to use for parsed item. Optional.- Specified by:
name
in interfacePrismParser
- Specified by:
name
in interfacePrismParserNoIO
- Parameters:
itemName
- Item name to use.- Returns:
- Updated parser.
-
type
Description copied from interface:PrismParser
Tells parser what data type to expect. Optional.- Specified by:
type
in interfacePrismParser
- Specified by:
type
in interfacePrismParserNoIO
- Parameters:
typeName
- Data type to expect.- Returns:
- Updated parser.
-
type
Description copied from interface:PrismParser
Tells parser what data type to expect. Optional.- Specified by:
type
in interfacePrismParser
- Specified by:
type
in interfacePrismParserNoIO
- Parameters:
typeClass
- Data type to expect.- Returns:
- Updated parser.
-
parse
Description copied from interface:PrismParser
Parses the input as a prism object.- Specified by:
parse
in interfacePrismParser
- Specified by:
parse
in interfacePrismParserNoIO
- Returns:
- The object.
- Throws:
SchemaException
-
parseItem
public <IV extends PrismValue,ID extends ItemDefinition<?>> Item<IV,ID> parseItem() throws SchemaExceptionDescription copied from interface:PrismParser
Parses the input as a prism item. (Object, container, reference, value.) May return raw property values as part of the prism structure, if definitions are not known.- Specified by:
parseItem
in interfacePrismParser
- Specified by:
parseItem
in interfacePrismParserNoIO
- Returns:
- The item.
- Throws:
SchemaException
-
parseItemValue
Description copied from interface:PrismParser
Parses the input as a prism value. (Container value, reference value, property value.) May return raw property values as part of the prism structure, if definitions are not known.- Specified by:
parseItemValue
in interfacePrismParser
- Specified by:
parseItemValue
in interfacePrismParserNoIO
- Returns:
- The item.
- Throws:
SchemaException
-
parseRealValue
Description copied from interface:PrismParser
Parses a real value - either property or container value.- Specified by:
parseRealValue
in interfacePrismParser
- Specified by:
parseRealValue
in interfacePrismParserNoIO
- Parameters:
clazz
- Expected class of the data. May be null if unknown.- Returns:
- Real value - POJO, Containerable, Objectable or Referencable.
- Throws:
SchemaException
-
parseRealValue
Description copied from interface:PrismParser
Parses a real value. The class is not supplied by the caller, so it has to be determined from the data source.- Specified by:
parseRealValue
in interfacePrismParser
- Specified by:
parseRealValue
in interfacePrismParserNoIO
- Returns:
- Real value - POJO, Containerable, Objectable or Referencable.
- Throws:
SchemaException
-
parseRealValueToJaxbElement
Description copied from interface:PrismParser
Parses a real value and stores it into JAXBElement, using item name derived in the usual way.- Specified by:
parseRealValueToJaxbElement
in interfacePrismParser
- Specified by:
parseRealValueToJaxbElement
in interfacePrismParserNoIO
- Throws:
SchemaException
-
parseToXNode
Description copied from interface:PrismParser
Parses the input into RootXNode. This is a bit unusual approach, skipping the unmarshalling phase altogether. But it is useful at some places.- Specified by:
parseToXNode
in interfacePrismParser
- Specified by:
parseToXNode
in interfacePrismParserNoIO
- Returns:
- RootXNode corresponding to the input.
- Throws:
SchemaException
-
parseObjects
@NotNull public @NotNull List<PrismObject<? extends Objectable>> parseObjects() throws SchemaExceptionDescription copied from interface:PrismParser
Parses the input as a collection of prism objects. For XML the input must be formatted as a collection of objects (TODO change this). For other languages the input may contain one or more objects.- Specified by:
parseObjects
in interfacePrismParser
- Specified by:
parseObjects
in interfacePrismParserNoIO
- Returns:
- A list of objects.
- Throws:
SchemaException
-
parseObjectsIteratively
public void parseObjectsIteratively(@NotNull @NotNull PrismParser.ObjectHandler handler) throws SchemaException Description copied from interface:PrismParser
Currently implemented for JSON/YAML only. For XML, use old Validator code.- Specified by:
parseObjectsIteratively
in interfacePrismParser
- Specified by:
parseObjectsIteratively
in interfacePrismParserNoIO
- Throws:
SchemaException
-
parseItemOrRealValue
Description copied from interface:PrismParser
Parses either an item, or a real value. It depends on the type declaration or item name in the source data. 1) If explicit type is present, it is taken into account. If it corresponds to a prism item, the input is parsed as a prism item. Otherwise, it is parsed as a real value (containerable or simple POJO), if possible. 2) If there is no type, the item name is consulted. If it corresponds to a prism item, the input is parsed as a prism item. Otherwise, an exception is thrown. Pre-set parameters (itemDefinition, typeName, itemName) must NOT be present. Use with utmost care. If at all possible, avoid it.- Specified by:
parseItemOrRealValue
in interfacePrismParser
- Specified by:
parseItemOrRealValue
in interfacePrismParserNoIO
- Returns:
- either prism item (Item) or a real value (Object)
- Throws:
SchemaException
-
convertMissingTypes
- Specified by:
convertMissingTypes
in interfacePrismParser
- Specified by:
convertMissingTypes
in interfacePrismParserNoIO
-