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 @NotNull 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)
@NotNull RootXNodeImpl
read(@NotNull ParserSource source, @NotNull ParsingContext parsingContext)
@NotNull List<RootXNodeImpl>
readObjects(@NotNull ParserSource source, @NotNull ParsingContext parsingContext)
Honors multi-document files and multiple objects in a single document ('c:objects', list-as-root mechanisms).void
readObjectsIteratively(@NotNull ParserSource source, @NotNull 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)
@NotNull String
write(@NotNull RootXNode root, SerializationContext prismSerializationContext)
Serializes a root node into XNode tree.@NotNull String
write(@NotNull XNode xnode, @NotNull QName rootElementName, SerializationContext serializationContext)
Serializes a non-root node into XNode tree.@NotNull String
write(@NotNull List<RootXNodeImpl> roots, QName aggregateElementName, @Nullable 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 @NotNull SchemaRegistry schemaRegistry
-
-
Method Detail
-
read
@NotNull public @NotNull RootXNodeImpl read(@NotNull @NotNull ParserSource source, @NotNull @NotNull ParsingContext parsingContext) throws SchemaException, IOException
- Specified by:
read
in interfaceLexicalProcessor<String>
- Throws:
SchemaException
IOException
-
readObjects
@NotNull public @NotNull List<RootXNodeImpl> readObjects(@NotNull @NotNull ParserSource source, @NotNull @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 @NotNull ParserSource source, @NotNull @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 @NotNull String write(@NotNull @NotNull XNode xnode, @NotNull @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 @NotNull String write(@NotNull @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 @NotNull String write(@NotNull @NotNull List<RootXNodeImpl> roots, QName aggregateElementName, @Nullable @Nullable SerializationContext prismSerializationContext) throws SchemaException
Description copied from interface:LexicalProcessor
TODO Not supported for NullLexicalProcessor, though.- Specified by:
write
in interfaceLexicalProcessor<String>
- 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)
-
-