Class DomLexicalProcessor
- java.lang.Object
-
- com.evolveum.midpoint.prism.impl.lex.dom.DomLexicalProcessor
-
- All Implemented Interfaces:
LexicalProcessor<String>
public class DomLexicalProcessor extends Object implements LexicalProcessor<String>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.evolveum.midpoint.prism.impl.lex.LexicalProcessor
LexicalProcessor.RootXNodeHandler
-
-
Constructor Summary
Constructors Constructor Description DomLexicalProcessor(SchemaRegistry schemaRegistry)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description boolean
canRead(File file)
Checks if the processor can read from a given file.boolean
canRead(String dataString)
Checks if the processor can read from a given string.RootXNodeImpl
read(ParserSource source, ParsingContext parsingContext)
XNodeImpl
read(File file, ParsingContext parsingContext)
Deprecated.RootXNodeImpl
read(Document document)
RootXNodeImpl
read(Element rootElement)
List<RootXNodeImpl>
readObjects(ParserSource source, ParsingContext parsingContext)
void
readObjectsIteratively(ParserSource source, ParsingContext parsingContext, LexicalProcessor.RootXNodeHandler handler)
Element
serializeSingleElementMapToElement(MapXNode map)
Element
serializeUnderElement(XNodeImpl xnode, QName rootElementName, Element parentElement)
Element
serializeXMapToElement(MapXNodeImpl xmap, QName elementName)
String
write(RootXNode xnode, SerializationContext serializationContext)
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 context)
TODO Not supported for NullLexicalProcessor, though.Element
writeXRootListToElement(List<RootXNodeImpl> roots, QName aggregateElementName)
Element
writeXRootToElement(RootXNodeImpl xroot)
-
-
-
Field Detail
-
LOGGER
public static final Trace LOGGER
-
-
Constructor Detail
-
DomLexicalProcessor
public DomLexicalProcessor(@NotNull SchemaRegistry schemaRegistry)
-
-
Method Detail
-
read
@Deprecated public XNodeImpl read(File file, ParsingContext parsingContext) throws SchemaException, IOException
Deprecated.- Throws:
SchemaException
IOException
-
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
- 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
-
read
@NotNull public RootXNodeImpl read(Document document) throws SchemaException
- Throws:
SchemaException
-
read
@NotNull public RootXNodeImpl read(Element rootElement) throws SchemaException
- Throws:
SchemaException
-
canRead
public boolean canRead(@NotNull File file) throws IOException
Description copied from interface:LexicalProcessor
Checks if the processor can read from a given file. (Guessed by file extension, for now.) Used for autodetection of language.- Specified by:
canRead
in interfaceLexicalProcessor<String>
- Throws:
IOException
-
canRead
public boolean canRead(@NotNull String dataString)
Description copied from interface:LexicalProcessor
Checks if the processor can read from a given string. Note this is only an approximative information (for now). Used for autodetection of language.- Specified by:
canRead
in interfaceLexicalProcessor<String>
-
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
-
write
@NotNull public String write(@NotNull RootXNode xnode, SerializationContext serializationContext) 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, @Nullable QName aggregateElementName, @Nullable SerializationContext context) throws SchemaException
Description copied from interface:LexicalProcessor
TODO Not supported for NullLexicalProcessor, though.- Specified by:
write
in interfaceLexicalProcessor<String>
- Returns:
- Throws:
SchemaException
-
writeXRootListToElement
@NotNull public Element writeXRootListToElement(@NotNull List<RootXNodeImpl> roots, QName aggregateElementName) throws SchemaException
- Throws:
SchemaException
-
serializeUnderElement
public Element serializeUnderElement(XNodeImpl xnode, QName rootElementName, Element parentElement) throws SchemaException
- Throws:
SchemaException
-
serializeXMapToElement
public Element serializeXMapToElement(MapXNodeImpl xmap, QName elementName) throws SchemaException
- Throws:
SchemaException
-
writeXRootToElement
@NotNull public Element writeXRootToElement(@NotNull RootXNodeImpl xroot) throws SchemaException
- Throws:
SchemaException
-
serializeSingleElementMapToElement
public Element serializeSingleElementMapToElement(MapXNode map) throws SchemaException
- Throws:
SchemaException
-
-