|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectat.woli.xml.XMLData
public class XMLData
XMLData
to store all elements and attributes of an XML Object.
Field Summary | |
---|---|
private ArrayList<XMLDataElement> |
dataArray
Stores all elements of the object |
static int |
REMOVE_ALL
Removes all elements, which were find in the List NOT IMPLEMENTED YET |
static int |
REMOVE_FIRST
Removes the first element from the list NOT IMPLEMENTED YET |
static int |
REMOVE_LAST
Removes the last element from the list NOT IMPLEMENTED YET |
private String |
rootElementName
The name of the root element |
private XMLDataElement |
xmlElement
Actual element which is in use |
Constructor Summary | |
---|---|
XMLData()
Standard constructor all variables are initialized with 0 |
|
XMLData(String rootElementName)
Constructor which sets the name of the root element with the given parameter |
|
XMLData(String rootElementName,
String elementName,
Object elementValue)
Constructor which creates a new Element with the given parameters |
Method Summary | |
---|---|
void |
addElementToArray(XMLDataElement xmlElement)
Adds an element of type XMLDataElement to the list of elements |
void |
addNewAttributeToLastElement(String attributeName,
String attributeValue)
Adds a new attribute to the last element in the list |
void |
addNewElementToArray(String elementName,
Object elementValue)
Adds a new element to the list of elements |
ArrayList<XMLDataElement> |
getDataArray()
Returns the list of elements |
XMLDataElement |
getElementAtIndex(int index)
Returns an element from the list of elements at the given index |
XMLDataElement |
getElementByName(String name)
Returns an element from the list of elements by the given name |
XMLDataElement |
getFirstElement()
Returns the first element from the list of elements |
XMLDataElement |
getLastElement()
Returns the last element from the list of elements |
int |
getNumbersOfElements()
Returns the number of elements from the list of elements |
String |
getRootElementName()
Returns the name of the root element |
XMLDataElement |
getXmlElement()
Returns the actual element which is in use |
void |
removeElementFromArrayByIndex(int index)
Removes an element at the given index |
void |
removeElementFromArrayByName(String name,
int type)
Removes an element with the given name |
void |
removeElementFromArrayByValue(String value,
int type)
Removes an element with the given value |
void |
setDataArray(ArrayList<XMLDataElement> dataArray)
Sets the list of elements in this class |
void |
setRootElementName(String rootElementName)
Sets the name of the root element |
void |
setXmlElement(XMLDataElement xmlElement)
Setd the actual element of the class. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int REMOVE_ALL
public static final int REMOVE_FIRST
public static final int REMOVE_LAST
private String rootElementName
private ArrayList<XMLDataElement> dataArray
private XMLDataElement xmlElement
Constructor Detail |
---|
public XMLData()
public XMLData(String rootElementName)
rootElementName
- The Name of the root elementpublic XMLData(String rootElementName, String elementName, Object elementValue)
rootElementName
- The Name of the root elementelementName
- The Name of the elementelementValue
- The Value of the elementMethod Detail |
---|
public ArrayList<XMLDataElement> getDataArray()
public void setDataArray(ArrayList<XMLDataElement> dataArray)
dataArray
- The list of elementspublic XMLDataElement getXmlElement()
public void setXmlElement(XMLDataElement xmlElement)
addElementToArray()
xmlElement
- An element of the type XMLElementaddElementToArray(XMLDataElement)
public String getRootElementName()
public XMLDataElement getFirstElement()
getElementAtIndex(int)
,
getLastElement()
,
getElementByName(String)
public XMLDataElement getLastElement()
getElementAtIndex(int)
,
getFirstElement()
,
getElementByName(String)
public XMLDataElement getElementAtIndex(int index)
getFirstElement()
,
getLastElement()
,
getElementByName(String)
public XMLDataElement getElementByName(String name)
name
- The name of the element
getFirstElement()
,
getLastElement()
,
getElementAtIndex(int)
public int getNumbersOfElements()
public void setRootElementName(String rootElementName)
rootElementName
- The name of the root elementpublic void removeElementFromArrayByIndex(int index)
index
- The index of an element, which will be removedpublic void removeElementFromArrayByName(String name, int type)
name
- The name of an element, which will be removedtype
- This is just a placeholder for features in later releasespublic void removeElementFromArrayByValue(String value, int type)
value
- The value of an element, which will be removedtype
- This is just a placeholder for features in later releasespublic void addElementToArray(XMLDataElement xmlElement)
xmlElement
- The element which will be add to the list of elementspublic void addNewElementToArray(String elementName, Object elementValue)
elementName
- The name of the new elementelementValue
- The value of the new elementpublic void addNewAttributeToLastElement(String attributeName, String attributeValue)
attributeName
- The name of the new attributeattributeValue
- The value of the new attribute
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |