bibliothek.util.xml
Class XAttribute

java.lang.Object
  extended by bibliothek.util.xml.XAttribute
Direct Known Subclasses:
XElement

public class XAttribute
extends Object

An attribute is an element in a XML-file that has a name and perhaps a value.

Author:
Benjamin Sigg

Constructor Summary
XAttribute(String name)
          Creates a new attribute.
 
Method Summary
 boolean getBoolean()
          Gets the value of this attribute as boolean.
 byte getByte()
          Gets the value of this attribute as byte.
 byte[] getByteArray()
          Gets the value of this attribute as byte-array.
 char getChar()
          Gets the value of this attribute as character.
 double getDouble()
          Gets the value of this attribute as double.
 float getFloat()
          Gets the value of this attribute as float.
 int getInt()
          Gets the value of this attribute as integer.
 long getLong()
          Gets the value of this attribute as long.
 String getName()
          Gets the name of this attribute.
 short getShort()
          Gets the value of this attribute as short.
 String getString()
          Gets the value of this attribute as string.
 String getValue()
          Gets the exact value that is stored in this attribute.
 void setBoolean(boolean b)
          Sets the value of this attribute.
 void setByte(byte b)
          Sets the value of this attribute.
 void setByteArray(byte[] bs)
          Sets the value of this attribute.
 void setChar(char c)
          Sets the value of this attribute.
 void setDouble(double d)
          Sets the value of this attribute.
 void setFloat(float f)
          Sets the value of this attribute.
 void setInt(int i)
          Sets the value of this attribute.
 void setLong(long l)
          Sets the value of this attribute.
 void setName(String name)
          Sets the name of this attribute.
 void setShort(short s)
          Sets the value of this attribute.
 void setString(String s)
          Sets the value of this attribute.
 void setValue(String value)
          Sets the exact value that is stored in this attribute.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XAttribute

public XAttribute(String name)
Creates a new attribute.

Parameters:
name - the name of the attribute
Method Detail

setName

public void setName(String name)
Sets the name of this attribute.

Parameters:
name - the new name

getName

public String getName()
Gets the name of this attribute.

Returns:
the name

setValue

public void setValue(String value)
Sets the exact value that is stored in this attribute.

Parameters:
value - the value that will not be encoded by this method

getValue

public String getValue()
Gets the exact value that is stored in this attribute.

Returns:
the value that is not encoded

setByte

public void setByte(byte b)
Sets the value of this attribute.

Parameters:
b - the value

setShort

public void setShort(short s)
Sets the value of this attribute.

Parameters:
s - the value

setInt

public void setInt(int i)
Sets the value of this attribute.

Parameters:
i - the value

setLong

public void setLong(long l)
Sets the value of this attribute.

Parameters:
l - the value

setBoolean

public void setBoolean(boolean b)
Sets the value of this attribute.

Parameters:
b - the value

setChar

public void setChar(char c)
Sets the value of this attribute.

Parameters:
c - the value

setString

public void setString(String s)
Sets the value of this attribute.

Parameters:
s - the value

setFloat

public void setFloat(float f)
Sets the value of this attribute.

Parameters:
f - the value

setDouble

public void setDouble(double d)
Sets the value of this attribute.

Parameters:
d - the value

setByteArray

public void setByteArray(byte[] bs)
Sets the value of this attribute.

Parameters:
bs - the value

getByte

public byte getByte()
Gets the value of this attribute as byte.

Returns:
the value
Throws:
XException - if value is not a byte

getShort

public short getShort()
Gets the value of this attribute as short.

Returns:
the value
Throws:
XException - if value is not a short

getInt

public int getInt()
Gets the value of this attribute as integer.

Returns:
the value
Throws:
XException - if value is not an integer

getLong

public long getLong()
Gets the value of this attribute as long.

Returns:
the value
Throws:
XException - if value is not a long

getFloat

public float getFloat()
Gets the value of this attribute as float.

Returns:
the value
Throws:
XException - if value is not a float

getDouble

public double getDouble()
Gets the value of this attribute as double.

Returns:
the value
Throws:
XException - if value is not a double

getChar

public char getChar()
Gets the value of this attribute as character.

Returns:
the value
Throws:
XException - if value is not a character

getString

public String getString()
Gets the value of this attribute as string.

Returns:
the value
Throws:
XException - if value is not a string

getBoolean

public boolean getBoolean()
Gets the value of this attribute as boolean.

Returns:
the value
Throws:
XException - if value is not a boolean

getByteArray

public byte[] getByteArray()
Gets the value of this attribute as byte-array.

Returns:
the value
Throws:
XException - if value is not a byte-array