at.ac.tuwien.infosys.sm4all.copal.api.event.xml
Class ContextEventTypeUnmarshaller

java.lang.Object
  extended by at.ac.tuwien.infosys.sm4all.copal.api.event.xml.ContextEventTypeUnmarshaller
All Implemented Interfaces:
Marshaller<ContextEventType>, Unmarshaller<ContextEventType>

public class ContextEventTypeUnmarshaller
extends java.lang.Object
implements Unmarshaller<ContextEventType>

Unmarshals and marshals a ContextEventType from/into an Element.

Author:
sanjin

Nested Class Summary
static class ContextEventTypeUnmarshaller.Builder
          Builder of ContextEventTypeUnmarshaller.
 
Field Summary
static java.lang.String ACTIONS_ELEMENT
          The local name of child Element that holds marshaled DefaultActions.
static java.lang.String ATTRIBUTES_ELEMENT
          The local name of child Element that holds marshaled Attributes.
static java.lang.String AUTHORIZATIONS_ELEMENT
          The local name of child Element that holds marshaled Authorizations.
static java.lang.String EVENT_TYPE_ELEMENT
          The local name of child Elements used in the ListUnmarshaller.Builder that is returned by the getListBuilder().
static java.lang.String NAME_ATTRIBUTE
          The name of attribute that holds marshaled name.
static java.lang.String PRIORITY_ATTRIBUTE
          The name of attribute that holds marshaled priority.
static java.lang.String TTL_ATTRIBUTE
          The name of attribute that holds marshaled time-to-live.
 
Constructor Summary
ContextEventTypeUnmarshaller(org.w3c.dom.Element element)
          Creates instance of ContextEventType Unmarshaller which uses specified Element for unmarshalling and/or marshalling.
 
Method Summary
 org.w3c.dom.Element getElement()
          Returns the Element used for unmarshalling and marshalling.
static ListUnmarshaller.Builder<ContextEventType> getListBuilder()
          Creates instance of ListUnmarshaller.Builder for ContextEventTypes.
 void marshal(ContextEventType eventType)
          Marshals specified ContextEventType into the Element.
 void remove()
          Removes any marshaled ContextEventType from the Element.
 ContextEventType unmarshal()
          Unmarshals an ContextEventType from the Element.
 DefaultAction[] unmarshalActions()
          Unmarshals DefaultActions of ContextEventType from the Element.
 Attribute[] unmarshalAttributes()
          Unmarshals Attributes of ContextEventType from the Element.
 Authorization[] unmarshalAuthorizations()
          Unmarshals Authorizations of ContextEventType from the Element.
 java.lang.String unmarshalName()
          Unmarshals name of ContextEventType from the Element.
 int unmarshalPriority()
          Unmarshals priority of ContextEventType from the Element .
 long unmarshalTTL()
          Unmarshals time-to-live of ContextEventType from the Element.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EVENT_TYPE_ELEMENT

public static final java.lang.String EVENT_TYPE_ELEMENT
The local name of child Elements used in the ListUnmarshaller.Builder that is returned by the getListBuilder().

See Also:
Constant Field Values

NAME_ATTRIBUTE

public static final java.lang.String NAME_ATTRIBUTE
The name of attribute that holds marshaled name.

See Also:
Constant Field Values

TTL_ATTRIBUTE

public static final java.lang.String TTL_ATTRIBUTE
The name of attribute that holds marshaled time-to-live.

See Also:
Constant Field Values

PRIORITY_ATTRIBUTE

public static final java.lang.String PRIORITY_ATTRIBUTE
The name of attribute that holds marshaled priority.

See Also:
Constant Field Values

ATTRIBUTES_ELEMENT

public static final java.lang.String ATTRIBUTES_ELEMENT
The local name of child Element that holds marshaled Attributes.

See Also:
Constant Field Values

AUTHORIZATIONS_ELEMENT

public static final java.lang.String AUTHORIZATIONS_ELEMENT
The local name of child Element that holds marshaled Authorizations.

See Also:
Constant Field Values

ACTIONS_ELEMENT

public static final java.lang.String ACTIONS_ELEMENT
The local name of child Element that holds marshaled DefaultActions.

See Also:
Constant Field Values
Constructor Detail

ContextEventTypeUnmarshaller

public ContextEventTypeUnmarshaller(org.w3c.dom.Element element)
Creates instance of ContextEventType Unmarshaller which uses specified Element for unmarshalling and/or marshalling.

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

getElement

public org.w3c.dom.Element getElement()
Returns the Element used for unmarshalling and marshalling.

Returns:
the Element used for unmarshalling and marshalling.

unmarshal

public ContextEventType unmarshal()
                           throws FailedUnmarshallingException
Unmarshals an ContextEventType from the Element.

Specified by:
unmarshal in interface Unmarshaller<ContextEventType>
Returns:
the unmarshaled ContextEventType.
Throws:
FailedUnmarshallingException - if unmarshalling was unsuccessful.

unmarshalName

public java.lang.String unmarshalName()
                               throws FailedUnmarshallingException
Unmarshals name of ContextEventType from the Element.

Returns:
the name of marshaled ContextEventType.
Throws:
FailedUnmarshallingException - if unmarshalling was unsuccessful.

unmarshalTTL

public long unmarshalTTL()
                  throws FailedUnmarshallingException
Unmarshals time-to-live of ContextEventType from the Element. If the time-to-live value is missing then the ContextEventType.TTL_DEFAULT is returned.

Returns:
the time-to-live of marshaled ContextEventType.
Throws:
FailedUnmarshallingException - if unmarshalling was unsuccessful.

unmarshalPriority

public int unmarshalPriority()
                      throws FailedUnmarshallingException
Unmarshals priority of ContextEventType from the Element . If the priority value is missing then the ContextEventType.PRIORITY_DEFAULT is returned.

Returns:
the priority of marshaled ContextEventType.
Throws:
FailedUnmarshallingException - if unmarshalling was unsuccessful.

unmarshalAttributes

public Attribute[] unmarshalAttributes()
                                throws FailedUnmarshallingException
Unmarshals Attributes of ContextEventType from the Element.

Returns:
the Attributes of marshaled ContextEventType.
Throws:
FailedUnmarshallingException - if unmarshalling was unsuccessful.

unmarshalAuthorizations

public Authorization[] unmarshalAuthorizations()
                                        throws FailedUnmarshallingException
Unmarshals Authorizations of ContextEventType from the Element.

Returns:
the Authorizations of marshaled ContextEventType .
Throws:
FailedUnmarshallingException - if unmarshalling was unsuccessful.

unmarshalActions

public DefaultAction[] unmarshalActions()
                                 throws FailedUnmarshallingException
Unmarshals DefaultActions of ContextEventType from the Element.

Returns:
the DefaultActions of marshaled ContextEventType .
Throws:
FailedUnmarshallingException - if unmarshalling was unsuccessful.

marshal

public void marshal(ContextEventType eventType)
Marshals specified ContextEventType into the Element.

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

remove

public void remove()
Removes any marshaled ContextEventType from the Element.

Specified by:
remove in interface Marshaller<ContextEventType>

getListBuilder

public static ListUnmarshaller.Builder<ContextEventType> getListBuilder()
Creates instance of ListUnmarshaller.Builder for ContextEventTypes. The returned ListUnmarshaller.Builder does not have the parent Element set and caller should set it before building the ListUnmarshaller for ContextEventType s. The name for child Elements is set to EVENT_TYPE_ELEMENT.

Returns:
the ListUnmarshaller.Builder for ContextEventType s.


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