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

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

public class ContextEventTypeUnmarshaller
extends Object
implements Unmarshaller<ContextEventType>

Unmarshalls and marshalls a ContextEventType from/into an Element.

Author:
sanjin

Nested Class Summary
static class ContextEventTypeUnmarshaller.Builder
          Builder of ContextEventTypeUnmarshaller.
 
Field Summary
static String ACTIONS_ELEMENT
          The local name of child Element that holds marshalled DefaultActions.
static String ATTRIBUTES_ELEMENT
          The local name of child Element that holds marshalled Attributes.
static String AUTHORIZATIONS_ELEMENT
          The local name of child Element that holds marshalled Authorizations.
static String EVENT_TYPE_ELEMENT
          The local name of child Elements used in the ListUnmarshaller.Builder that is returned by the getListBuilder().
static String NAME_ATTRIBUTE
          The name of attribute that holds marshalled name.
static String PRIORITY_ATTRIBUTE
          The name of attribute that holds marshalled priority.
static String TTL_ATTRIBUTE
          The name of attribute that holds marshalled time-to-live.
 
Constructor Summary
ContextEventTypeUnmarshaller(Element element)
          Creates instance of ContextEventType Unmarshaller which uses specified Element for unmarshalling and/or marshalling.
 
Method Summary
 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)
          Marshalls specified ContextEventType into the Element.
 void remove()
          Removes any marshalled ContextEventType from the Element.
 ContextEventType unmarshal()
          Unmarshalls an ContextEventType from the Element.
 DefaultAction[] unmarshalActions()
          Unmarshalls DefaultActions of ContextEventType from the Element.
 Attribute[] unmarshalAttributes()
          Unmarshalls Attributes of ContextEventType from the Element.
 Authorization[] unmarshalAuthorizations()
          Unmarshalls Authorizations of ContextEventType from the Element.
 String unmarshalName()
          Unmarshalls name of ContextEventType from the Element.
 int unmarshalPriority()
          Unmarshalls priority of ContextEventType from the Element .
 long unmarshalTTL()
          Unmarshalls 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 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 String NAME_ATTRIBUTE
The name of attribute that holds marshalled name.

See Also:
Constant Field Values

TTL_ATTRIBUTE

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

See Also:
Constant Field Values

PRIORITY_ATTRIBUTE

public static final String PRIORITY_ATTRIBUTE
The name of attribute that holds marshalled priority.

See Also:
Constant Field Values

ATTRIBUTES_ELEMENT

public static final String ATTRIBUTES_ELEMENT
The local name of child Element that holds marshalled Attributes.

See Also:
Constant Field Values

AUTHORIZATIONS_ELEMENT

public static final String AUTHORIZATIONS_ELEMENT
The local name of child Element that holds marshalled Authorizations.

See Also:
Constant Field Values

ACTIONS_ELEMENT

public static final String ACTIONS_ELEMENT
The local name of child Element that holds marshalled DefaultActions.

See Also:
Constant Field Values
Constructor Detail

ContextEventTypeUnmarshaller

public ContextEventTypeUnmarshaller(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:
NullPointerException - if specified Element is null.
Method Detail

getElement

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

Returns:
the Element used for unmarshalling and marshalling.

unmarshal

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

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

unmarshalName

public String unmarshalName()
                     throws FailedUnmarshallingException
Unmarshalls name of ContextEventType from the Element.

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

unmarshalTTL

public long unmarshalTTL()
                  throws FailedUnmarshallingException
Unmarshalls 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 marshalled ContextEventType.
Throws:
FailedUnmarshallingException - if unmarshalling was unsuccessful.

unmarshalPriority

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

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

unmarshalAttributes

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

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

unmarshalAuthorizations

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

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

unmarshalActions

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

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

marshal

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

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

remove

public void remove()
Removes any marshalled 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 and the strategy is set to Append.

Returns:
the ListUnmarshaller.Builder for ContextEventType s.


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