at.ac.tuwien.infosys.sm4all.copal.api.xml
Class BooleanAttribute

java.lang.Object
  extended by at.ac.tuwien.infosys.sm4all.copal.api.xml.Attribute<java.lang.Boolean>
      extended by at.ac.tuwien.infosys.sm4all.copal.api.xml.BooleanAttribute
All Implemented Interfaces:
Marshaller<java.lang.Boolean>, Unmarshaller<java.lang.Boolean>

public class BooleanAttribute
extends Attribute<java.lang.Boolean>

Unmarshals and marshals a Boolean value of an attribute from/to an Element.

Author:
sanjin

Nested Class Summary
static class BooleanAttribute.Builder
          Builder of BooleanAttribute.
 
Constructor Summary
BooleanAttribute(java.lang.String name, org.w3c.dom.Element element)
          Creates instance of an attribute Unmarshaller and Marshaller which uses specified Element to unmarshal and/or marshal the Boolean value of the attribute with specified name.
 
Method Summary
protected  java.lang.String toString(java.lang.Boolean bool)
          Converts specified value of attribute to String.
protected  java.lang.Boolean valueOf(java.lang.String str)
          Converts specified String value of the attribute to desired class.
 
Methods inherited from class at.ac.tuwien.infosys.sm4all.copal.api.xml.Attribute
getElement, getName, marshal, remove, unmarshal
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BooleanAttribute

public BooleanAttribute(java.lang.String name,
                        org.w3c.dom.Element element)
Creates instance of an attribute Unmarshaller and Marshaller which uses specified Element to unmarshal and/or marshal the Boolean value of the attribute with specified name.

Parameters:
name - the name of the attribute in the Element used for unmarshalling and marshalling.
element - the Element used for unmarshalling and marshalling.
Throws:
java.lang.NullPointerException - if specified Element or name is null.
java.lang.IllegalArgumentException - if specified name is an empty or blank string.
Method Detail

toString

protected java.lang.String toString(java.lang.Boolean bool)
Description copied from class: Attribute
Converts specified value of attribute to String.

Specified by:
toString in class Attribute<java.lang.Boolean>
Parameters:
bool - the value of the attribute.
Returns:
the attribute as String.

valueOf

protected java.lang.Boolean valueOf(java.lang.String str)
                             throws InvalidFieldValueException
Description copied from class: Attribute
Converts specified String value of the attribute to desired class.

Specified by:
valueOf in class Attribute<java.lang.Boolean>
Parameters:
str - the String value of the attribute.
Returns:
the attribute as instance of the desired class.
Throws:
InvalidFieldValueException - if specified value is not valid.


Copyright © 2010 Distributed Systems Group, Vienna University of Technology. All Rights Reserved.