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

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

public class DateAttribute
extends Attribute<java.util.Date>

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

Author:
sanjin

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

DateAttribute

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

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

valueOf

protected java.util.Date 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.util.Date>
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.