at.ac.tuwien.infosys.sm4all.copal.api.event.xml.type
Class TimeToLive

java.lang.Object
  extended by at.ac.tuwien.infosys.sm4all.copal.api.xml.OptionalAttributeUnmarshaller<Long>
      extended by at.ac.tuwien.infosys.sm4all.copal.api.event.xml.type.TimeToLive
All Implemented Interfaces:
Marshaller<XMLContextEventType>, Unmarshaller<Long>

public class TimeToLive
extends OptionalAttributeUnmarshaller<Long>
implements Marshaller<XMLContextEventType>

Command that marshalls and unmarshalls time-to-live of a XMLContextEventType into/from an Element.

Author:
sanjin

Constructor Summary
TimeToLive(Element element)
          Creates instance of XMLContextEventType time-to-live marshaller and unmarshaller which uses specified Element to marshal and/or unmarshal the time-to-live.
 
Method Summary
 void marshal(XMLContextEventType eventType)
          Sets the ttl attribute of specified Element to time-to-live of specified XMLContextEventType.
protected  Long valueOf(String value)
          Converts specified String value of the optional attribute to desired class.
 
Methods inherited from class at.ac.tuwien.infosys.sm4all.copal.api.xml.OptionalAttributeUnmarshaller
unmarshal
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TimeToLive

public TimeToLive(Element element)
Creates instance of XMLContextEventType time-to-live marshaller and unmarshaller which uses specified Element to marshal and/or unmarshal the time-to-live.

Parameters:
element - the Element used for marshalling and unmarshalling.
Throws:
NullPointerException - if specified Element is null.
Method Detail

valueOf

protected Long valueOf(String value)
                throws InvalidFieldValueException
Description copied from class: OptionalAttributeUnmarshaller
Converts specified String value of the optional attribute to desired class.

Specified by:
valueOf in class OptionalAttributeUnmarshaller<Long>
Parameters:
value - the String value of the optional attribute.
Returns:
the optional attribute as instance of the desired class.
Throws:
InvalidFieldValueException - if specified value is not valid.

marshal

public void marshal(XMLContextEventType eventType)
Sets the ttl attribute of specified Element to time-to-live of specified XMLContextEventType.

Specified by:
marshal in interface Marshaller<XMLContextEventType>
Parameters:
eventType - the XMLContextEventType.
Throws:
NullPointerException - if specified XMLContextEventType is null.


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