Class AbstractJsonLexicalProcessor
- java.lang.Object
-
- com.evolveum.midpoint.prism.impl.lex.json.AbstractJsonLexicalProcessor
-
- All Implemented Interfaces:
LexicalProcessor<String>
- Direct Known Subclasses:
JsonLexicalProcessor
,YamlLexicalProcessor
public abstract class AbstractJsonLexicalProcessor extends Object implements LexicalProcessor<String>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.evolveum.midpoint.prism.impl.lex.LexicalProcessor
LexicalProcessor.RootXNodeHandler
-
-
Field Summary
Fields Modifier and Type Field Description protected SchemaRegistry
schemaRegistry
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract com.fasterxml.jackson.core.JsonGenerator
createJacksonGenerator(StringWriter out)
protected abstract com.fasterxml.jackson.core.JsonParser
createJacksonParser(InputStream stream)
protected QName
getExplicitType(XNodeImpl xnode)
RootXNodeImpl
read(ParserSource source, ParsingContext parsingContext)
List<RootXNodeImpl>
readObjects(ParserSource source, ParsingContext parsingContext)
Honors multi-document files and multiple objects in a single document ('c:objects', list-as-root mechanisms).void
readObjectsIteratively(ParserSource source, ParsingContext parsingContext, LexicalProcessor.RootXNodeHandler handler)
protected void
resetInlineTypeIfPossible(com.evolveum.midpoint.prism.impl.lex.json.AbstractJsonLexicalProcessor.JsonSerializationContext ctx)
protected abstract boolean
supportsInlineTypes()
protected abstract QName
tagToTypeName(Object tid, com.evolveum.midpoint.prism.impl.lex.json.AbstractJsonLexicalProcessor.JsonParsingContext ctx)
String
write(RootXNode root, SerializationContext prismSerializationContext)
Serializes a root node into XNode tree.String
write(XNode xnode, QName rootElementName, SerializationContext serializationContext)
Serializes a non-root node into XNode tree.String
write(List<RootXNodeImpl> roots, QName aggregateElementName, SerializationContext prismSerializationContext)
TODO Not supported for NullLexicalProcessor, though.protected abstract void
writeInlineType(QName typeName, com.evolveum.midpoint.prism.impl.lex.json.AbstractJsonLexicalProcessor.JsonSerializationContext ctx)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.evolveum.midpoint.prism.impl.lex.LexicalProcessor
canRead, canRead
-
-
-
-
Field Detail
-
schemaRegistry
@NotNull protected final SchemaRegistry schemaRegistry
-
-
Method Detail
-
read
@NotNull public RootXNodeImpl read(@NotNull ParserSource source, @NotNull ParsingContext parsingContext) throws SchemaException, IOException
- Specified by:
read
in interfaceLexicalProcessor<String>
- Throws:
SchemaException
IOException
-
readObjects
@NotNull public List<RootXNodeImpl> readObjects(@NotNull ParserSource source, @NotNull ParsingContext parsingContext) throws SchemaException, IOException
Honors multi-document files and multiple objects in a single document ('c:objects', list-as-root mechanisms).- Specified by:
readObjects
in interfaceLexicalProcessor<String>
- Throws:
SchemaException
IOException
-
readObjectsIteratively
public void readObjectsIteratively(@NotNull ParserSource source, @NotNull ParsingContext parsingContext, LexicalProcessor.RootXNodeHandler handler) throws SchemaException, IOException
- Specified by:
readObjectsIteratively
in interfaceLexicalProcessor<String>
- Throws:
SchemaException
IOException
-
createJacksonParser
protected abstract com.fasterxml.jackson.core.JsonParser createJacksonParser(InputStream stream) throws SchemaException, IOException
- Throws:
SchemaException
IOException
-
tagToTypeName
protected abstract QName tagToTypeName(Object tid, com.evolveum.midpoint.prism.impl.lex.json.AbstractJsonLexicalProcessor.JsonParsingContext ctx) throws IOException, SchemaException
- Throws:
IOException
SchemaException
-
write
@NotNull public String write(@NotNull XNode xnode, @NotNull QName rootElementName, SerializationContext serializationContext) throws SchemaException
Description copied from interface:LexicalProcessor
Serializes a non-root node into XNode tree. So, xnode SHOULD NOT be a root node (at least for now). TODO consider removing - replacing by the previous form.- Specified by:
write
in interfaceLexicalProcessor<String>
- Throws:
SchemaException
-
createJacksonGenerator
protected abstract com.fasterxml.jackson.core.JsonGenerator createJacksonGenerator(StringWriter out) throws SchemaException
- Throws:
SchemaException
-
write
@NotNull public String write(@NotNull RootXNode root, SerializationContext prismSerializationContext) throws SchemaException
Description copied from interface:LexicalProcessor
Serializes a root node into XNode tree.- Specified by:
write
in interfaceLexicalProcessor<String>
- Throws:
SchemaException
-
write
@NotNull public String write(@NotNull List<RootXNodeImpl> roots, QName aggregateElementName, @Nullable SerializationContext prismSerializationContext) throws SchemaException
Description copied from interface:LexicalProcessor
TODO Not supported for NullLexicalProcessor, though.- Specified by:
write
in interfaceLexicalProcessor<String>
- Returns:
- Throws:
SchemaException
-
supportsInlineTypes
protected abstract boolean supportsInlineTypes()
-
writeInlineType
protected abstract void writeInlineType(QName typeName, com.evolveum.midpoint.prism.impl.lex.json.AbstractJsonLexicalProcessor.JsonSerializationContext ctx) throws IOException
- Throws:
IOException
-
resetInlineTypeIfPossible
protected void resetInlineTypeIfPossible(com.evolveum.midpoint.prism.impl.lex.json.AbstractJsonLexicalProcessor.JsonSerializationContext ctx)
-
-