Public Member Functions | Protected Member Functions | Private Attributes

de.mfuchs.xmlstorage.stream.XMLStreamNode Class Reference

XMLStreamNode is used to hold the data of the current XML Node in XMLStreamReader. More...

Inheritance diagram for de.mfuchs.xmlstorage.stream.XMLStreamNode:
Inheritance graph
[legend]
Collaboration diagram for de.mfuchs.xmlstorage.stream.XMLStreamNode:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 XMLStreamNode ()
 Empty XMLStreamNode default constructor.
String getName ()
String toString ()
String get (final String attrName)
 read only access to an attribute
String get (final String attrName, final String def)
 read only access to an attribute with default value
String getContent ()
 Return content data.
XMLInt getInt (final String attrName)
XMLInt getInt (final String attrName, int def)
XMLNumber getNumber (final String attrName)
XMLNumber getNumber (final String attrName, BigDecimal def)
XMLBool getBool (final String attrName)
XMLBool getBool (final String attrName, boolean def)
XMLString getString (final String attrName)
XMLString getString (final String attrName, final String def)

Protected Member Functions

void assign (String name)
void setContent (String content)
void setAttributes (javax.xml.stream.XMLStreamReader reader)

Private Attributes

String _name = ""
String _content = ""
TreeMap< String, String > _attributes = new TreeMap<String, String>()

Detailed Description

XMLStreamNode is used to hold the data of the current XML Node in XMLStreamReader.

Definition at line 50 of file XMLStreamNode.java.


Constructor & Destructor Documentation

de.mfuchs.xmlstorage.stream.XMLStreamNode.XMLStreamNode (  )

Empty XMLStreamNode default constructor.

Definition at line 59 of file XMLStreamNode.java.

    {
    }

Member Function Documentation

void de.mfuchs.xmlstorage.stream.XMLStreamNode.assign ( String  name ) [protected]
String de.mfuchs.xmlstorage.stream.XMLStreamNode.get ( final String  attrName ) [virtual]

read only access to an attribute

Implements de.mfuchs.xmlstorage.AbstractXMLNode.

Definition at line 102 of file XMLStreamNode.java.

References de.mfuchs.xmlstorage.stream.XMLStreamNode._attributes.

Referenced by de.mfuchs.xmlstorage.stream.XMLStreamReader.find(), and de.mfuchs.xmlstorage.stream.XMLStreamReader.get().

    {
        String found = _attributes.get(attrName);

        if (found != null)
            return found;
        else
            return "";
    }
String de.mfuchs.xmlstorage.stream.XMLStreamNode.get ( final String  attrName,
final String  def 
) [virtual]

read only access to an attribute with default value

Implements de.mfuchs.xmlstorage.AbstractXMLNode.

Definition at line 113 of file XMLStreamNode.java.

References de.mfuchs.xmlstorage.stream.XMLStreamNode._attributes.

    {
        String found = _attributes.get(attrName);

        if (found != null)
            return found;
        else
            return def;
    }
XMLBool de.mfuchs.xmlstorage.AbstractXMLNode.getBool ( final String  attrName ) [inherited]

Definition at line 42 of file AbstractXMLNode.java.

    {
        return new XMLBool(this, attrName);
    }
XMLBool de.mfuchs.xmlstorage.AbstractXMLNode.getBool ( final String  attrName,
boolean  def 
) [inherited]

Definition at line 46 of file AbstractXMLNode.java.

    {
        return new XMLBool(this, attrName, def);
    }
String de.mfuchs.xmlstorage.stream.XMLStreamNode.getContent (  ) [virtual]

Return content data.

Implements de.mfuchs.xmlstorage.AbstractXMLNode.

Definition at line 126 of file XMLStreamNode.java.

References de.mfuchs.xmlstorage.stream.XMLStreamNode._content, and de.mfuchs.xmlstorage.XMLHelper.decodeXMLString().

Referenced by de.mfuchs.xmlstorage.stream.XMLStreamReader.getContent().

    {
        return XMLHelper.decodeXMLString(_content);
    }

Here is the call graph for this function:

XMLInt de.mfuchs.xmlstorage.AbstractXMLNode.getInt ( final String  attrName ) [inherited]

Definition at line 24 of file AbstractXMLNode.java.

    {
        return new XMLInt(this, attrName);
    }
XMLInt de.mfuchs.xmlstorage.AbstractXMLNode.getInt ( final String  attrName,
int  def 
) [inherited]

Definition at line 28 of file AbstractXMLNode.java.

    {
        return new XMLInt(this, attrName, def);
    }
String de.mfuchs.xmlstorage.stream.XMLStreamNode.getName (  ) [virtual]
XMLNumber de.mfuchs.xmlstorage.AbstractXMLNode.getNumber ( final String  attrName ) [inherited]

Definition at line 33 of file AbstractXMLNode.java.

    {
        return new XMLNumber(this, attrName);
    }
XMLNumber de.mfuchs.xmlstorage.AbstractXMLNode.getNumber ( final String  attrName,
BigDecimal  def 
) [inherited]

Definition at line 37 of file AbstractXMLNode.java.

    {
        return new XMLNumber(this, attrName, def);
    }
XMLString de.mfuchs.xmlstorage.AbstractXMLNode.getString ( final String  attrName,
final String  def 
) [inherited]

Definition at line 55 of file AbstractXMLNode.java.

    {
        return new XMLString(this, attrName, def);
    }
XMLString de.mfuchs.xmlstorage.AbstractXMLNode.getString ( final String  attrName ) [inherited]

Definition at line 51 of file AbstractXMLNode.java.

    {
        return new XMLString(this, attrName);
    }
void de.mfuchs.xmlstorage.stream.XMLStreamNode.setAttributes ( javax.xml.stream.XMLStreamReader  reader ) [protected]

Definition at line 85 of file XMLStreamNode.java.

References de.mfuchs.xmlstorage.stream.XMLStreamNode._attributes.

Referenced by de.mfuchs.xmlstorage.stream.XMLStreamReader.startElement().

    {
        int attributes = reader.getAttributeCount();

        for(int n=0; n<attributes; ++n) {
            final String attrNS = reader.getAttributeNamespace(n);
            final String attrName = reader.getAttributeLocalName(n);
            final String attrValue = reader.getAttributeValue(n);

            if (attrNS != null)
                _attributes.put(attrNS+":"+attrName, attrValue);
            else
                _attributes.put(attrName, attrValue);
        }
    }
void de.mfuchs.xmlstorage.stream.XMLStreamNode.setContent ( String  content ) [protected]
String de.mfuchs.xmlstorage.stream.XMLStreamNode.toString (  ) [virtual]

Member Data Documentation

TreeMap<String, String> de.mfuchs.xmlstorage.stream.XMLStreamNode._attributes = new TreeMap<String, String>() [private]

The documentation for this class was generated from the following file: