public class XmlEdit extends Object
select attribute. Which denotes location
of content you wish to insert/replace. Then it must set either content - path
to location of another XML file that will appear as a child
of elements evaluated by select expression or xml - which denotes
XML content as String. Optionally, attribute can be
defined to identify inserted/replaced content. If attribute is not defined,
content (defined either via xml or content) is
loaded and xpath expression is created from root element's attributes and their values,
otherwise attribute is taken as the only one for
xpath expression.
If isAttributeContent() is true, the content is just a string (non-XML)
that is used to replace/insert an attribute value. In other words, if isAttributeContent()
is true, getSelect() should be an XPath to an attribute, not an element node.
If isIgnoreAttributeValue() is true, then when matching an element with the
given attribute, the matching won't care about the attribute value.
Use this normally if you know there is only one element with the given attribute but the attribute
value is unknown. This lets you match that element without caring about the value.| Constructor and Description |
|---|
XmlEdit() |
XmlEdit(String select,
String xml) |
XmlEdit(String select,
URL content) |
| Modifier and Type | Method and Description |
|---|---|
String |
getAttribute() |
URL |
getContent() |
String |
getSelect() |
String |
getXml() |
boolean |
isAttributeContent() |
boolean |
isIgnoreAttributeValue() |
void |
setAttribute(String attribute) |
void |
setAttributeContent(boolean isAttributeContent) |
void |
setContent(URL content) |
void |
setIgnoreAttributeValue(boolean isIgnoreAttributeValue) |
void |
setSelect(String select) |
void |
setXml(String xml) |
String |
toString() |
XmlEdit |
withAttribute(String attribute) |
XmlEdit |
withIsAttributeContent(boolean flag) |
XmlEdit |
withIsIgnoreAttributeValue(boolean flag) |
public XmlEdit withIsAttributeContent(boolean flag)
public XmlEdit withIsIgnoreAttributeValue(boolean flag)
public String getAttribute()
public void setAttribute(String attribute)
public void setXml(String xml)
public String getXml()
public String getSelect()
public void setSelect(String select)
public URL getContent()
public void setContent(URL content)
public boolean isAttributeContent()
public void setAttributeContent(boolean isAttributeContent)
public boolean isIgnoreAttributeValue()
public void setIgnoreAttributeValue(boolean isIgnoreAttributeValue)
Copyright © 2015–2016 Red Hat, Inc.. All rights reserved.