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

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

public class LongAttribute
extends Attribute<java.lang.Long>

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

Author:
sanjin

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

LongAttribute

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

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

valueOf

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