com.b3dgs.lionengine.file
Interface XMLNode


public interface XMLNode

Describe an xml node, which can be modified (reading & writing). All primitive types are written as string inside any xml file. XMLNodes can be save in a file, using an XMLParser.

See Also:
XMLParser

Method Summary
 void add(XMLNode node)
          Add a child node.
 java.util.TreeMap<java.lang.String,java.lang.String> getAttributes()
          Get all attributes.
 XMLNode getChild(java.lang.String name)
          Get a child node from its name.
 java.util.List<XMLNode> getChildren()
          Get list of all children.
 boolean readBoolean(java.lang.String attribute)
          Read a boolean.
 double readDouble(java.lang.String attribute)
          Read a double.
 float readFloat(java.lang.String attribute)
          Read a float.
 int readInteger(java.lang.String attribute)
          Read an integer.
 java.lang.String readString(java.lang.String attribute)
          Read a string.
 void writeBoolean(java.lang.String attribute, boolean content)
          Write a boolean.
 void writeDouble(java.lang.String attribute, double content)
          Write a double.
 void writeFloat(java.lang.String attribute, float content)
          Write a float.
 void writeInteger(java.lang.String attribute, int content)
          Write an integer.
 void writeString(java.lang.String attribute, java.lang.String content)
          Write a string.
 

Method Detail

add

void add(XMLNode node)
Add a child node.

Parameters:
node - child node.

writeInteger

void writeInteger(java.lang.String attribute,
                  int content)
Write an integer.

Parameters:
attribute - integer name.
content - integer value.

writeFloat

void writeFloat(java.lang.String attribute,
                float content)
Write a float.

Parameters:
attribute - float name.
content - float value.

writeDouble

void writeDouble(java.lang.String attribute,
                 double content)
Write a double.

Parameters:
attribute - double name.
content - double value.

writeString

void writeString(java.lang.String attribute,
                 java.lang.String content)
Write a string.

Parameters:
attribute - string name.
content - string value.

writeBoolean

void writeBoolean(java.lang.String attribute,
                  boolean content)
Write a boolean.

Parameters:
attribute - boolean name.
content - boolean value.

readInteger

int readInteger(java.lang.String attribute)
Read an integer.

Parameters:
attribute - integer name.
Returns:
integer value.

readFloat

float readFloat(java.lang.String attribute)
Read a float.

Parameters:
attribute - float name.
Returns:
float value.

readDouble

double readDouble(java.lang.String attribute)
Read a double.

Parameters:
attribute - double name.
Returns:
double value.

readString

java.lang.String readString(java.lang.String attribute)
Read a string.

Parameters:
attribute - string name.
Returns:
string value.

readBoolean

boolean readBoolean(java.lang.String attribute)
Read a boolean.

Parameters:
attribute - boolean name.
Returns:
boolean value.

getChild

XMLNode getChild(java.lang.String name)
Get a child node from its name.

Parameters:
name - child name.
Returns:
child node reference.

getChildren

java.util.List<XMLNode> getChildren()
Get list of all children.

Returns:
children list.

getAttributes

java.util.TreeMap<java.lang.String,java.lang.String> getAttributes()
Get all attributes.

Returns:
attributes map reference.