public class XmlBuilder extends Object
Constructor | Description |
---|---|
XmlBuilder() |
|
XmlBuilder(NamespaceContext namespaceContext) |
Modifier and Type | Method | Description |
---|---|---|
<T> T |
build(T xml) |
Evaluates collected XPath effects on a given XML model object.
|
XmlBuilder |
put(String xpath) |
Greedily creates all missing nodes that could be evaluated by given XPath expression.
|
XmlBuilder |
put(String xpath,
Object value) |
Greedily creates all missing nodes that could be evaluated by given XPath expression and then sets given
value as text content to all evaluated nodes.
|
XmlBuilder |
putAll(Iterable<String> xpaths) |
Greedily creates all missing nodes that could be evaluated by given XPath expressions.
|
XmlBuilder |
putAll(String... xpaths) |
Greedily creates all missing nodes that could be evaluated by given XPath expressions.
|
XmlBuilder |
putAll(Map<String,Object> xpathToValueMap) |
Greedily creates all missing nodes that could be evaluated by given XPath expressions and then sets the
associated value as text content to all evaluated nodes.
|
XmlBuilder |
remove(String xpath) |
Evaluates given XPath expression and detaches all of the resulting nodes.
|
XmlBuilder |
removeAll(Iterable<String> xpaths) |
Evaluates given XPath expressions and detaches all of the resulting nodes.
|
XmlBuilder |
removeAll(String... xpaths) |
Evaluates given XPath expressions and detaches all of the resulting nodes.
|
public XmlBuilder()
public XmlBuilder(NamespaceContext namespaceContext)
public XmlBuilder put(String xpath) throws XPathExpressionException
xpath
- XPath to processXmlBuilder
instanceXPathExpressionException
- if xpath cannot be parsedputAll(Iterable)
public XmlBuilder put(String xpath, Object value) throws XPathExpressionException
xpath
- XPath to processvalue
- value to setXmlBuilder
instanceXPathExpressionException
- if xpath cannot be parsedputAll(Map)
public XmlBuilder putAll(String... xpaths) throws XPathExpressionException
xpaths
- XPaths to processXmlBuilder
instanceXPathExpressionException
- if xpath cannot be parsedputAll(Iterable)
public XmlBuilder putAll(Iterable<String> xpaths) throws XPathExpressionException
xpaths
- XPaths to processXmlBuilder
instanceXPathExpressionException
- if xpath cannot be parsedput(String)
,
putAll(String...)
public XmlBuilder putAll(Map<String,Object> xpathToValueMap) throws XPathExpressionException
xpathToValueMap
- XPath to values associationsXmlBuilder
instanceXPathExpressionException
- if xpath cannot be parsedput(String, Object)
public XmlBuilder remove(String xpath) throws XPathExpressionException
xpath
- XPath to processXmlBuilder
instanceXPathExpressionException
- if xpath cannot be parsedremoveAll(Iterable)
public XmlBuilder removeAll(String... xpaths) throws XPathExpressionException
xpaths
- XPaths to processXmlBuilder
instanceXPathExpressionException
- if xpath cannot be parsedremoveAll(Iterable)
public XmlBuilder removeAll(Iterable<String> xpaths) throws XPathExpressionException
xpaths
- XPaths to processXmlBuilder
instanceXPathExpressionException
- if xpath cannot be parsedremove(String)
,
removeAll(String...)
public <T> T build(T xml) throws XmlBuilderException
T
- XML model typexml
- XML to processXmlBuilderException
- if XML model modification failed