LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.parser
Class LyXmlNode

java.lang.Object
  extended by leon.parser.LyXmlNode
Direct Known Subclasses:
LyInfoNode, LyViewNode

public abstract class LyXmlNode
extends java.lang.Object

This class is used to offer temporary storage to our real node instances. We chose not to extend ElementNode directly from our objects to save memory. In user execution mode, these instances can be freed after loading because they are totally unuseful at this time.


Field Summary
static java.lang.String __VERSION
           
 
Constructor Summary
LyXmlNode()
          Constructor.
 
Method Summary
abstract  java.lang.String getAttribute(java.lang.String attributeName)
          Gets the given attribute value.
 boolean getBoolean(java.lang.String attributeName)
          Gets the given attribute value.
 boolean getBoolean(java.lang.String attributeName, boolean defaultValue)
          Gets the given attribute value as a float.
 java.util.Date getDate(java.lang.String attributeName)
          Gets the given attribute value as a date.
 double getDouble(java.lang.String attributeName)
          Gets the given attribute value.
 double getDouble(java.lang.String attributeName, double defaultValue)
          Gets the given attribute value as a double.
 float getFloat(java.lang.String attributeName)
          Gets the given attribute value.
 float getFloat(java.lang.String attributeName, float defaultValue)
          Gets the given attribute value as a float.
 int getInt(java.lang.String attributeName)
          Gets the given attribute value.
 int getInt(java.lang.String attributeName, int defaultValue)
          Gets the given attribute value as an int.
 java.lang.Number getNumber(java.lang.String attributeName, java.lang.Class<? extends java.lang.Number> numberClass)
          Gets the given attribute value as a Number.
 java.lang.String getString(java.lang.String attributeName)
          Gets the given attribute value.
 java.lang.String getString(java.lang.String attributeName, java.lang.String defaultValue)
          Gets the given attribute value.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

__VERSION

public static final java.lang.String __VERSION
See Also:
Constant Field Values
Constructor Detail

LyXmlNode

public LyXmlNode()
Constructor. Does nothing.

Method Detail

getAttribute

public abstract java.lang.String getAttribute(java.lang.String attributeName)
Gets the given attribute value. Should be implemented in subclasses.

Parameters:
attributeName - the attribute name
Returns:
the attribute value as a string

getString

public java.lang.String getString(java.lang.String attributeName,
                                  java.lang.String defaultValue)
Gets the given attribute value.

Parameters:
attributeName - the attribute name.
defaultValue - the value to return for the attribute if no value is specified
Returns:
the value

getString

public java.lang.String getString(java.lang.String attributeName)
Gets the given attribute value. Only calls getString(attributeName, null)

Parameters:
attributeName - the attribute name.
Returns:
the value
See Also:
getString(String, String)

getInt

public int getInt(java.lang.String attributeName,
                  int defaultValue)
Gets the given attribute value as an int.

Parameters:
attributeName - the attribute name.
defaultValue - the value to return for the attribute if no value is specified
Returns:
the value as an int
Throws:
java.lang.IllegalArgumentException - If the given token cannot be parsed as an int.

getInt

public int getInt(java.lang.String attributeName)
Gets the given attribute value. Only calls getInt(attributeName, 1)

Parameters:
attributeName - the attribute name.
Returns:
the value as an int
See Also:
getInt(String, int)

getDouble

public double getDouble(java.lang.String attributeName,
                        double defaultValue)
Gets the given attribute value as a double.

Parameters:
attributeName - the attribute name.
defaultValue - the value to return for the attribute if no value is specified
Returns:
the value as a double
Throws:
java.lang.IllegalArgumentException - If the given token cannot be parsed as a double.

getDouble

public double getDouble(java.lang.String attributeName)
Gets the given attribute value. Only calls getDouble(attributeName, -1)

Parameters:
attributeName - the attribute name.
Returns:
the value as a double
See Also:
LyXmlNode#getDouble(String, int)

getFloat

public float getFloat(java.lang.String attributeName,
                      float defaultValue)
Gets the given attribute value as a float.

Parameters:
attributeName - the attribute name
defaultValue - the value to return for the attribute if no value is specified
Returns:
the value as a float
Throws:
java.lang.IllegalArgumentException - If the given token cannot be parsed as a float.

getFloat

public float getFloat(java.lang.String attributeName)
Gets the given attribute value. Only calls getFloat(attributeName, -1)

Parameters:
attributeName - the attribute name.
Returns:
the value as a float
See Also:
LyXmlNode#getFloat(String, int)

getNumber

public java.lang.Number getNumber(java.lang.String attributeName,
                                  java.lang.Class<? extends java.lang.Number> numberClass)
Gets the given attribute value as a Number.

Parameters:
attributeName - the attribute name
numberClass - the Number class for result
Returns:
the value as a Number
Throws:
java.lang.IllegalArgumentException - If the given attribute value cannot be parsed as a number of the given type or if the numberClass doesn't correspond to any supported number class.

getDate

public java.util.Date getDate(java.lang.String attributeName)
Gets the given attribute value as a date.

Parameters:
attributeName - the attribute name
Returns:
the value as a date
Throws:
java.lang.IllegalArgumentException - If the given token cannot be parsed as a float.

getBoolean

public boolean getBoolean(java.lang.String attributeName,
                          boolean defaultValue)
Gets the given attribute value as a float.

Parameters:
attributeName - the attribute name
defaultValue - the value to return for the attribute if no value is specified
Returns:
return true if the value equals (ignore case) "true", false otherwise.

getBoolean

public boolean getBoolean(java.lang.String attributeName)
Gets the given attribute value. Only calls getBoolean(attributeName, false)

Parameters:
attributeName - the attribute name.
Returns:
the value as a boolean
See Also:
getBoolean(String, boolean)

(c) January 2013 - W4 S.A.

Website: W4 S.A., contact us: support@w4global.com