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

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

public class StringAttribute
extends Attribute<java.lang.String>

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

Author:
sanjin

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

StringAttribute

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

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

valueOf

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

Specified by:
valueOf in class Attribute<java.lang.String>
Parameters:
str - the String value of the attribute.
Returns:
the attribute as instance of the desired class.


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