public class XMLBean extends Object
Modifier and Type | Field and Description |
---|---|
protected static org.slf4j.Logger |
log |
Constructor and Description |
---|
XMLBean(InputStream is)
Creates new XMLBean from an input stream; XMLBean is read-only!!!
|
XMLBean(String docname)
Creates new XMLBean.
|
XMLBean(URL docname)
Creates new XMLBean.
|
Modifier and Type | Method and Description |
---|---|
List |
getAllAttribute(org.jdom.Element elem)
Returns a list of all attributes from an element.
|
List |
getAllChild(String elemname)
Returns a list of all elements with the given elementname.
|
List |
getAllChild(String elemname,
String attribute,
String value)
Returns a list of all children with the specific name and the specific
attribute value;
|
String |
getAllChildText(String elemname,
String attribute,
String value,
String separator1,
String separator2)
This method returns the text of all children in the format
childname
|
org.jdom.Attribute |
getAttribute(org.jdom.Element elem,
String attrib)
Returns an elementattribute.
|
String |
getAttributeValue(org.jdom.Element elem,
String attrib)
Returns the value of an elementattribute.
|
org.jdom.Element |
getChild(String elemname)
Returns a child element.
|
org.jdom.Element |
getChild(String elemname,
String attribute,
String value)
This method finds a child by name and attribute.
|
String |
getChildText(String elemname,
String childname,
String attribute,
String value)
This method returns the text of a child element characterized by
elementname and attribute.
|
List |
getRootChild()
This method returns all direct children of the root element.
|
org.jdom.Element |
getRootElement()
Returns the root element.
|
String |
getText(org.jdom.Element elem)
This returns the text between a begining and an ending tag.
|
String |
getText(String elemname,
String attrname,
String attrvalue) |
boolean |
removeChild(String elemname)
Removes an element.
|
void |
setAttributeValue(org.jdom.Element elem,
String attrib,
String value)
This method set the value of an elementattribute.
|
void |
setText(org.jdom.Element elem,
String text) |
boolean |
writeXMLDoc()
This method saves the xml-file connected by XMLBean.
|
public XMLBean(String docname)
docname
- Path of xml-file.public XMLBean(URL docname)
docname
- URL of xml-file.public XMLBean(InputStream is)
public org.jdom.Element getRootElement()
public org.jdom.Element getChild(String elemname)
elemname
- Name of the child.public org.jdom.Element getChild(String elemname, String attribute, String value)
elemname
- Name of the child.attribute
- Name of the child attribute.value
- Value of the attribute.public String getText(org.jdom.Element elem)
elem
- Name of the element.public String getChildText(String elemname, String childname, String attribute, String value)
elemname
- Name of the element.childname
- Name of the child.attribute
- Name of the attribute which must element have.value
- Value of the attribute.public String getAllChildText(String elemname, String attribute, String value, String separator1, String separator2)
elemname
- Name of the root element.attribute
- Name of the attribute which must root element have.value
- Value of the attribute.public org.jdom.Attribute getAttribute(org.jdom.Element elem, String attrib)
elem
- Name of the element.attrib
- Name of the attribute.public String getAttributeValue(org.jdom.Element elem, String attrib)
elem
- Name of the element.attrib
- Name of the attribute.public void setAttributeValue(org.jdom.Element elem, String attrib, String value)
elem
- Name of the element.attrib
- Attribute of the element.value
- New value of the attribute.public void setText(org.jdom.Element elem, String text)
public boolean writeXMLDoc()
public List getRootChild()
public List getAllAttribute(org.jdom.Element elem)
elem
- Name of the element.public List getAllChild(String elemname)
public List getAllChild(String elemname, String attribute, String value)
public boolean removeChild(String elemname)
elemname
- Tag name of the element.Copyright © 2008-2014 Logical Objects. All Rights Reserved.