at.ac.tuwien.infosys.sm4all.copal.api.query.xml
Class ContextQueryMarshaller

java.lang.Object
  extended by at.ac.tuwien.infosys.sm4all.copal.api.query.xml.ContextQueryMarshaller
All Implemented Interfaces:
Marshaller<ContextQuery>

public class ContextQueryMarshaller
extends java.lang.Object
implements Marshaller<ContextQuery>

Marshals a ContextQuery into an Element.

Author:
sanjin

Nested Class Summary
static class ContextQueryMarshaller.Builder
          Builder of ContextQueryMarshaller.
 
Field Summary
static java.lang.String CRITERIA_ATTRIBUTE
          The name of attribute that holds marshaled criteria.
static java.lang.String LISTENED_TYPE_ATTRIBUTE
          The name of attribute that holds marshaled listened ContextEventType.
static java.lang.String NAME_ATTRIBUTE
          The name of attribute that holds marshaled name.
static java.lang.String QUERY_ELEMENT
          The local name of child Elements used in the ListMarshaller.Builder that is returned by the getListBuilder().
 
Constructor Summary
ContextQueryMarshaller(org.w3c.dom.Element element)
          Creates instance of ContextQuery Marshaller which uses specified Element for marshalling.
 
Method Summary
 org.w3c.dom.Element getElement()
          Returns the Element used for marshalling.
static ListMarshaller.Builder<ContextQuery> getListBuilder()
          Creates instance of ListMarshaller.Builder for ContextQuerys.
 void marshal(ContextQuery query)
          Marshals specified ContextQuery into the Element.
 void remove()
          Removes any marshaled ContextQuery from the Element.
 java.lang.String unmarshalCriteria()
          Unmarshals criteria of ContextQuery from the Element.
 java.lang.String unmarshalListenedType()
          Unmarshals name of listened ContextEventType of ContextQuery from the Element.
 java.lang.String unmarshalName()
          Unmarshals name of ContextQuery from the Element.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

QUERY_ELEMENT

public static final java.lang.String QUERY_ELEMENT
The local name of child Elements used in the ListMarshaller.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

LISTENED_TYPE_ATTRIBUTE

public static final java.lang.String LISTENED_TYPE_ATTRIBUTE
The name of attribute that holds marshaled listened ContextEventType.

See Also:
Constant Field Values

CRITERIA_ATTRIBUTE

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

See Also:
Constant Field Values
Constructor Detail

ContextQueryMarshaller

public ContextQueryMarshaller(org.w3c.dom.Element element)
Creates instance of ContextQuery Marshaller which uses specified Element for marshalling.

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

getElement

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

Returns:
the Element used for marshalling.

unmarshalName

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

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

unmarshalListenedType

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

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

unmarshalCriteria

public java.lang.String unmarshalCriteria()
                                   throws FailedUnmarshallingException
Unmarshals criteria of ContextQuery from the Element.

Returns:
the criteria of marshaled ContextQuery.
Throws:
FailedUnmarshallingException - if unmarshalling was unsuccessful.

marshal

public void marshal(ContextQuery query)
Marshals specified ContextQuery into the Element.

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

remove

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

Specified by:
remove in interface Marshaller<ContextQuery>

getListBuilder

public static ListMarshaller.Builder<ContextQuery> getListBuilder()
Creates instance of ListMarshaller.Builder for ContextQuerys. The returned ListMarshaller.Builder does not have the parent Element set and caller should set it before building the ListMarshaller for ContextQuerys. The name for child Elements is set to QUERY_ELEMENT.

Returns:
the ListMarshaller.Builder for ContextQuerys.


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