Public Member Functions | Protected Attributes

de.mfuchs.xmlstorage.XMLBoolRef Class Reference

XMLBoolRef is a type converter for boolean data with write access. More...

Collaboration diagram for de.mfuchs.xmlstorage.XMLBoolRef:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 XMLBoolRef (XMLNode node, final String attrName)
 XMLBoolRef (XMLNode node, final String attrName, boolean def)
boolean boolValue ()
void assign (boolean value)
 Set boolean value in referenced node.

Protected Attributes

final XMLNode _node
final String _attrName

Detailed Description

XMLBoolRef is a type converter for boolean data with write access.

Definition at line 45 of file XMLBoolRef.java.


Constructor & Destructor Documentation

de.mfuchs.xmlstorage.XMLBoolRef.XMLBoolRef ( XMLNode  node,
final String  attrName 
)

Definition at line 47 of file XMLBoolRef.java.

    {
        this(node, attrName, false);
    }
de.mfuchs.xmlstorage.XMLBoolRef.XMLBoolRef ( XMLNode  node,
final String  attrName,
boolean  def 
)

Definition at line 52 of file XMLBoolRef.java.

References de.mfuchs.xmlstorage.XMLBoolRef._attrName, de.mfuchs.xmlstorage.XMLBoolRef._node, de.mfuchs.xmlstorage.XMLBoolRef.assign(), and de.mfuchs.xmlstorage.XMLNode.get().

    {
        _node = node;
        _attrName = attrName;

        if (node != null)
            if (node.get(attrName).length() == 0)
                assign(def);
    }

Here is the call graph for this function:


Member Function Documentation

void de.mfuchs.xmlstorage.XMLBoolRef.assign ( boolean  value )

Set boolean value in referenced node.

Parameters:
value

Definition at line 77 of file XMLBoolRef.java.

References de.mfuchs.xmlstorage.XMLBoolRef._attrName, de.mfuchs.xmlstorage.XMLBoolRef._node, and de.mfuchs.xmlstorage.XMLNode.put().

Referenced by de.mfuchs.xmlstorage.XMLBoolRef.XMLBoolRef().

    {
        if (_node != null)
            _node.put(_attrName, String.valueOf(value));
    }

Here is the call graph for this function:

boolean de.mfuchs.xmlstorage.XMLBoolRef.boolValue (  )
Returns:
boolean value of referenced node

Definition at line 65 of file XMLBoolRef.java.

References de.mfuchs.xmlstorage.XMLBoolRef._attrName, de.mfuchs.xmlstorage.XMLBoolRef._node, and de.mfuchs.xmlstorage.XMLNode.get().

    {
        if (_node != null)
            return Boolean.valueOf(_node.get(_attrName)).booleanValue();
        else
            return false;
    }

Here is the call graph for this function:


Member Data Documentation


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