public class PrismParserImplIO extends Object
PrismParser.ObjectHandler
Constructor and Description |
---|
PrismParserImplIO(ParserSource source,
String language,
ParsingContext context,
PrismContextImpl prismContext,
ItemDefinition<?> itemDefinition,
QName itemName,
QName typeName,
Class<?> typeClass) |
Modifier and Type | Method and Description |
---|---|
PrismParser |
compat()
Switches the parser into "compatibility" (or relaxed) parsing mode.
|
PrismParser |
context(ParsingContext context)
Provides a parsing context for the parser.
|
PrismParser |
definition(ItemDefinition<?> itemDefinition)
Tells parser which definition to use when parsing item (or an item value).
|
PrismParser |
json()
Sets the language of the parser to be JSON.
|
PrismParser |
language(String language)
For string inputs: sets the data language that the parser will try to parse; null means auto-detect.
|
PrismParser |
name(QName itemName)
Tells parser what name to use for parsed item.
|
<O extends Objectable> |
parse()
Parses the input as a prism object.
|
<IV extends PrismValue,ID extends ItemDefinition> |
parseItem()
Parses the input as a prism item.
|
Object |
parseItemOrRealValue()
Parses either an item, or a real value.
|
<IV extends PrismValue> |
parseItemValue()
Parses the input as a prism value.
|
List<PrismObject<? extends Objectable>> |
parseObjects()
Parses the input as a collection of prism objects.
|
void |
parseObjectsIteratively(PrismParser.ObjectHandler handler)
Currently implemented for JSON/YAML only.
|
<T> T |
parseRealValue()
Parses a real value.
|
<T> T |
parseRealValue(Class<T> clazz)
Parses a real value - either property or container value.
|
<T> JAXBElement<T> |
parseRealValueToJaxbElement()
Parses a real value and stores it into JAXBElement, using item name derived in the usual way.
|
RootXNode |
parseToXNode()
Parses the input into RootXNode.
|
PrismParser |
strict()
Switches the parser into "strict" parsing mode.
|
PrismParser |
type(Class<?> typeClass)
Tells parser what data type to expect.
|
PrismParser |
type(QName typeName)
Tells parser what data type to expect.
|
PrismParser |
xml()
Sets the language of the parser to be XML.
|
PrismParser |
yaml()
Sets the language of the parser to be YAML.
|
public PrismParserImplIO(ParserSource source, String language, ParsingContext context, PrismContextImpl prismContext, ItemDefinition<?> itemDefinition, QName itemName, QName typeName, Class<?> typeClass)
@NotNull public <O extends Objectable> PrismObject<O> parse() throws SchemaException, IOException
PrismParser
SchemaException
IOException
public <IV extends PrismValue,ID extends ItemDefinition> Item<IV,ID> parseItem() throws SchemaException, IOException
PrismParser
SchemaException
IOException
public <IV extends PrismValue> IV parseItemValue() throws SchemaException, IOException
PrismParser
SchemaException
IOException
public <T> T parseRealValue(Class<T> clazz) throws IOException, SchemaException
PrismParser
clazz
- Expected class of the data. May be null if unknown.IOException
SchemaException
public <T> T parseRealValue() throws IOException, SchemaException
PrismParser
IOException
SchemaException
public <T> JAXBElement<T> parseRealValueToJaxbElement() throws IOException, SchemaException
PrismParser
IOException
SchemaException
public RootXNode parseToXNode() throws IOException, SchemaException
PrismParser
IOException
SchemaException
@NotNull public List<PrismObject<? extends Objectable>> parseObjects() throws SchemaException, IOException
PrismParser
SchemaException
IOException
public void parseObjectsIteratively(@NotNull PrismParser.ObjectHandler handler) throws SchemaException, IOException
PrismParser
SchemaException
IOException
public Object parseItemOrRealValue() throws IOException, SchemaException
PrismParser
IOException
SchemaException
@NotNull public PrismParser language(@Nullable String language)
PrismParser
language
in interface PrismParser
language
- The language@NotNull public PrismParser xml()
PrismParser
xml
in interface PrismParser
@NotNull public PrismParser json()
PrismParser
json
in interface PrismParser
@NotNull public PrismParser yaml()
PrismParser
yaml
in interface PrismParser
@NotNull public PrismParser context(@NotNull ParsingContext context)
PrismParser
context
in interface PrismParser
context
- The parsing context.@NotNull public PrismParser strict()
PrismParser
strict
in interface PrismParser
@NotNull public PrismParser compat()
PrismParser
compat
in interface PrismParser
@NotNull public PrismParser definition(ItemDefinition<?> itemDefinition)
PrismParser
definition
in interface PrismParser
itemDefinition
- The definition@NotNull public PrismParser name(QName itemName)
PrismParser
name
in interface PrismParser
itemName
- Item name to use.@NotNull public PrismParser type(QName typeName)
PrismParser
type
in interface PrismParser
typeName
- Data type to expect.@NotNull public PrismParser type(Class<?> typeClass)
PrismParser
type
in interface PrismParser
typeClass
- Data type to expect.Copyright © 2019 Evolveum. All rights reserved.