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

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

public class IntegerAttribute
extends Attribute<java.lang.Integer>

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

Author:
sanjin

Nested Class Summary
static class IntegerAttribute.Builder
          Builder of IntegerAttribute.
 
Constructor Summary
IntegerAttribute(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 Integer value of the attribute with specified name.
 
Method Summary
protected  java.lang.String toString(java.lang.Integer number)
          Converts specified value of attribute to String.
protected  java.lang.Integer 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

IntegerAttribute

public IntegerAttribute(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 Integer 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.Integer number)
Description copied from class: Attribute
Converts specified value of attribute to String.

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

valueOf

protected java.lang.Integer 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.Integer>
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.