at.ac.tuwien.infosys.sm4all.copal.api.publisher.xml
Class ContextPublisherMarshaller

java.lang.Object
  extended by at.ac.tuwien.infosys.sm4all.copal.api.publisher.xml.ContextPublisherMarshaller
All Implemented Interfaces:
Marshaller<ContextPublisher>

public class ContextPublisherMarshaller
extends java.lang.Object
implements Marshaller<ContextPublisher>

Marshals a ContextPublisher into an Element.

Author:
sanjin

Nested Class Summary
static class ContextPublisherMarshaller.Builder
          Builder of ContextPublisherMarshaller.
 
Field Summary
static java.lang.String PUBLISHED_TYPE_ELEMENT
          The local name of child Element that holds marshaled published ContextEventType.
static java.lang.String PUBLISHED_TYPE_NAME_ATTRIBUTE
          The name of attribute that holds marshaled name of published ContextEventType.
static java.lang.String PUBLISHED_TYPES_ELEMENT
          The local name of child Element that holds marshaled published ContextEventTypes.
static java.lang.String PUBLISHER_ELEMENT
          The local name of child Elements used in the ListMarshaller.Builder that is returned by the getListBuilder().
static java.lang.String SOURCE_ID_ATTRIBUTE
          The name of attribute that holds marshaled source ID.
 
Constructor Summary
ContextPublisherMarshaller(org.w3c.dom.Element element)
          Creates instance of ContextPublisher Marshaller which uses specified Element for marshalling.
 
Method Summary
 org.w3c.dom.Element getElement()
          Returns the Element used for marshalling.
static ListMarshaller.Builder<ContextPublisher> getListBuilder()
          Creates instance of ListMarshaller.Builder for ContextPublishers.
 void marshal(ContextPublisher publisher)
          Marshals specified ContextPublisher into the Element.
 void remove()
          Removes any marshaled ContextPublisher from the Element.
 java.lang.String[] unmarshalPublishedTypes()
          Unmarshals names of published ContextEventTypes of ContextPublisher from the Element.
 java.lang.String unmarshalSourceID()
          Unmarshals source ID of ContextPublisher from the Element .
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PUBLISHER_ELEMENT

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

See Also:
Constant Field Values

SOURCE_ID_ATTRIBUTE

public static final java.lang.String SOURCE_ID_ATTRIBUTE
The name of attribute that holds marshaled source ID.

See Also:
Constant Field Values

PUBLISHED_TYPES_ELEMENT

public static final java.lang.String PUBLISHED_TYPES_ELEMENT
The local name of child Element that holds marshaled published ContextEventTypes.

See Also:
Constant Field Values

PUBLISHED_TYPE_ELEMENT

public static final java.lang.String PUBLISHED_TYPE_ELEMENT
The local name of child Element that holds marshaled published ContextEventType.

See Also:
Constant Field Values

PUBLISHED_TYPE_NAME_ATTRIBUTE

public static final java.lang.String PUBLISHED_TYPE_NAME_ATTRIBUTE
The name of attribute that holds marshaled name of published ContextEventType.

See Also:
Constant Field Values
Constructor Detail

ContextPublisherMarshaller

public ContextPublisherMarshaller(org.w3c.dom.Element element)
Creates instance of ContextPublisher 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.

unmarshalSourceID

public java.lang.String unmarshalSourceID()
                                   throws FailedUnmarshallingException
Unmarshals source ID of ContextPublisher from the Element .

Returns:
the source ID of marshaled ContextPublisher.
Throws:
FailedUnmarshallingException - if unmarshalling was unsuccessful.

unmarshalPublishedTypes

public java.lang.String[] unmarshalPublishedTypes()
                                           throws FailedUnmarshallingException
Unmarshals names of published ContextEventTypes of ContextPublisher from the Element.

Returns:
names of published ContextEventTypes of marshaled ContextPublisher
Throws:
FailedUnmarshallingException - if unmarshalling was unsuccessful.

marshal

public void marshal(ContextPublisher publisher)
Marshals specified ContextPublisher into the Element.

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

remove

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

Specified by:
remove in interface Marshaller<ContextPublisher>

getListBuilder

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

Returns:
the ListMarshaller.Builder for ContextPublishers.


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