Xml
- The type of the xml representation used by the calling code.public final class XmlToJson<Xml> extends Object
ModelNode
used by Revapi.Modifier and Type | Class and Description |
---|---|
static class |
XmlToJson.JSONPointer |
Constructor and Description |
---|
XmlToJson(Map<String,org.jboss.dmr.ModelNode> knownExtensionSchemas,
java.util.function.Function<Xml,String> getName,
java.util.function.Function<Xml,String> getValue,
java.util.function.BiFunction<Xml,String,String> getAttributeValue,
java.util.function.Function<Xml,List<Xml>> getChildren)
Constructs a new XML to JSON convertor.
|
XmlToJson(Revapi revapi,
java.util.function.Function<Xml,String> getName,
java.util.function.Function<Xml,String> getValue,
java.util.function.BiFunction<Xml,String,String> getAttributeValue,
java.util.function.Function<Xml,List<Xml>> getChildren)
A convenience constructor to create an instance using the extension schemas known to the provided Revapi
instance.
|
public XmlToJson(Revapi revapi, java.util.function.Function<Xml,String> getName, java.util.function.Function<Xml,String> getValue, java.util.function.BiFunction<Xml,String,String> getAttributeValue, java.util.function.Function<Xml,List<Xml>> getChildren)
public XmlToJson(Map<String,org.jboss.dmr.ModelNode> knownExtensionSchemas, java.util.function.Function<Xml,String> getName, java.util.function.Function<Xml,String> getValue, java.util.function.BiFunction<Xml,String,String> getAttributeValue, java.util.function.Function<Xml,List<Xml>> getChildren)
knownExtensionSchemas
- the schemas of the known extensions. Keys are extension ids, values are extension
schemasgetName
- a function that gets the name of an XML taggetValue
- a function that gets the textual value of an XML node, e.g. it's textual content.getAttributeValue
- a function to get a value of an attribute of an XML nodegetChildren
- a function that gets the children of an XML node. Note that the returned list MUST NOT
contain any text or CDATA nodes - those are to be used in the getValue
function.
It also MUST NOT contain any comment nodes.public org.jboss.dmr.ModelNode convert(Xml xml)
Copyright © 2014-2020 Lukas Krejci. All Rights Reserved.