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

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

public class XMLContextEventTypeUnmarshaller
extends java.lang.Object
implements Unmarshaller<XMLContextEventType>

Unmarshals and marshals a XMLContextEventType from/into an Element.

Author:
sanjin

Nested Class Summary
static class XMLContextEventTypeUnmarshaller.Builder
          Builder of XMLContextEventTypeUnmarshaller.
 
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 NAMESPACE_URI_ATTRIBUTE
          The name of attribute that holds marshaled namespace URI.
static java.lang.String PRIORITY_ATTRIBUTE
          The name of attribute that holds marshaled priority.
static java.lang.String ROOT_ELEMENT_NAME_ATTRIBUTE
          The name of attribute that holds marshaled root element name.
static java.lang.String SCHEMA_ELEMENT
          The local name of child Element that holds marshaled Schema URL.
static java.lang.String TTL_ATTRIBUTE
          The name of attribute that holds marshaled time-to-live.
 
Constructor Summary
XMLContextEventTypeUnmarshaller(java.lang.ClassLoader classLoader, org.w3c.dom.Element element)
          Creates instance of XMLContextEventType Unmarshaller which uses specified Element for unmarshalling and/or marshalling.
XMLContextEventTypeUnmarshaller(org.w3c.dom.Element element)
          Creates instance of XMLContextEventType Unmarshaller which uses specified Element for unmarshalling and/or marshalling.
 
Method Summary
 java.lang.ClassLoader getClassLoader()
          Returns the ClassLoader used for resolving Schema URL that is in the classpath.
 org.w3c.dom.Element getElement()
          Returns the Element used for unmarshalling and marshalling.
static ListUnmarshaller.Builder<XMLContextEventType> getListBuilder()
          Creates instance of ListUnmarshaller.Builder for XMLContextEventTypes.
static ListUnmarshaller.Builder<XMLContextEventType> getListBuilder(java.lang.ClassLoader classLoader)
          Creates instance of ListUnmarshaller.Builder for XMLContextEventTypes.
 void marshal(XMLContextEventType eventType)
          Marshals specified XMLContextEventType into the Element.
 void remove()
          Removes any marshaled XMLContextEventType from the Element.
 XMLContextEventType unmarshal()
          Unmarshals an XMLContextEventType from the Element.
 DefaultAction[] unmarshalActions()
          Unmarshals DefaultActions of XMLContextEventType from the Element.
 Attribute[] unmarshalAttributes()
          Unmarshals Attributes of XMLContextEventType from the Element.
 Authorization[] unmarshalAuthorizations()
          Unmarshals Authorizations of XMLContextEventType from the Element.
 java.lang.String unmarshalName()
          Unmarshals name of XMLContextEventType from the Element.
 java.net.URI unmarshalNamespaceURI()
          Unmarshals namespace URI of XMLContextEventType from the Element.
 int unmarshalPriority()
          Unmarshals priority of XMLContextEventType from the Element.
 java.lang.String unmarshalRootElementName()
          Unmarshals root element name of XMLContextEventType from the Element.
 java.net.URL unmarshalSchemaURL()
          Unmarshals Schema URL of XMLContextEventType from the Element.
 long unmarshalTTL()
          Unmarshals time-to-live of XMLContextEventType 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

ROOT_ELEMENT_NAME_ATTRIBUTE

public static final java.lang.String ROOT_ELEMENT_NAME_ATTRIBUTE
The name of attribute that holds marshaled root element name.

See Also:
Constant Field Values

NAMESPACE_URI_ATTRIBUTE

public static final java.lang.String NAMESPACE_URI_ATTRIBUTE
The name of attribute that holds marshaled namespace URI.

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

SCHEMA_ELEMENT

public static final java.lang.String SCHEMA_ELEMENT
The local name of child Element that holds marshaled Schema URL.

See Also:
Constant Field Values
Constructor Detail

XMLContextEventTypeUnmarshaller

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

XMLContextEventTypeUnmarshaller

public XMLContextEventTypeUnmarshaller(java.lang.ClassLoader classLoader,
                                       org.w3c.dom.Element element)
Creates instance of XMLContextEventType Unmarshaller which uses specified Element for unmarshalling and/or marshalling. The specified ClassLoader is used for resolving Schema URL that is in the classpath.

Parameters:
classLoader - the ClassLoader used for resolving Schema URL that is in the classpath.
element - the Element used for unmarshalling and marshalling.
Throws:
java.lang.NullPointerException - if specified Element is null.
Method Detail

getClassLoader

public java.lang.ClassLoader getClassLoader()
Returns the ClassLoader used for resolving Schema URL that is in the classpath.

Returns:
the ClassLoader used for resolving Schema URL that is in the classpath.

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 XMLContextEventType unmarshal()
                              throws FailedUnmarshallingException
Unmarshals an XMLContextEventType from the Element.

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

unmarshalName

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

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

unmarshalTTL

public long unmarshalTTL()
                  throws FailedUnmarshallingException
Unmarshals time-to-live of XMLContextEventType 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 XMLContextEventType.
Throws:
FailedUnmarshallingException - if unmarshalling was unsuccessful.

unmarshalPriority

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

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

unmarshalRootElementName

public java.lang.String unmarshalRootElementName()
                                          throws FailedUnmarshallingException
Unmarshals root element name of XMLContextEventType from the Element. If the root element name value is missing then the result of the unmarshalName() method is returned.

Returns:
the root element name of marshaled XMLContextEventType.
Throws:
FailedUnmarshallingException - if unmarshalling was unsuccessful.

unmarshalNamespaceURI

public java.net.URI unmarshalNamespaceURI()
                                   throws FailedUnmarshallingException
Unmarshals namespace URI of XMLContextEventType from the Element. If the namespace URI value is missing then null value is returned.

Returns:
the namespace URI of marshaled XMLContextEventType.
Throws:
FailedUnmarshallingException - if unmarshalling was unsuccessful.

unmarshalAttributes

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

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

unmarshalAuthorizations

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

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

unmarshalActions

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

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

unmarshalSchemaURL

public java.net.URL unmarshalSchemaURL()
                                throws FailedUnmarshallingException
Unmarshals Schema URL of XMLContextEventType from the Element. If the Schema URL value is missing then null value is returned.

Returns:
the Schema URL of marshaled XMLContextEventType.
Throws:
FailedUnmarshallingException - if unmarshalling was unsuccessful.

marshal

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

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

remove

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

Specified by:
remove in interface Marshaller<XMLContextEventType>

getListBuilder

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

Returns:
the ListUnmarshaller.Builder for XMLContextEventTypes.

getListBuilder

public static ListUnmarshaller.Builder<XMLContextEventType> getListBuilder(java.lang.ClassLoader classLoader)
Creates instance of ListUnmarshaller.Builder for XMLContextEventTypes. The Schema URLs in classpath will be resolved with specified ClassLoader. The returned ListUnmarshaller.Builder does not have the parent Element set and caller should set it before building the ListUnmarshaller for XMLContextEventTypes. The name for child Elements is set to ContextEventTypeUnmarshaller.EVENT_TYPE_ELEMENT.

Parameters:
classLoader - the ClassLoader used for resolving Schema URLs that are in the classpath.
Returns:
the ListUnmarshaller.Builder for XMLContextEventTypes.


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