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

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

public class XMLContextEventTypeUnmarshaller
extends Object
implements Unmarshaller<XMLContextEventType>

Unmarshalls and marshalls a XMLContextEventType from/into an Element.

Author:
sanjin

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

ROOT_ELEMENT_NAME_ATTRIBUTE

public static final String ROOT_ELEMENT_NAME_ATTRIBUTE
The name of attribute that holds marshalled root element name.

See Also:
Constant Field Values

NAMESPACE_URI_ATTRIBUTE

public static final String NAMESPACE_URI_ATTRIBUTE
The name of attribute that holds marshalled namespace URI.

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

SCHEMA_ELEMENT

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

See Also:
Constant Field Values
Constructor Detail

XMLContextEventTypeUnmarshaller

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

XMLContextEventTypeUnmarshaller

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

getClassLoader

public 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 Element getElement()
Returns the Element used for unmarshalling and marshalling.

Returns:
the Element used for unmarshalling and marshalling.

unmarshal

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

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

unmarshalName

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

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

unmarshalTTL

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

unmarshalPriority

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

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

unmarshalRootElementName

public String unmarshalRootElementName()
                                throws FailedUnmarshallingException
Unmarshalls 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 marshalled XMLContextEventType.
Throws:
FailedUnmarshallingException - if unmarshalling was unsuccessful.

unmarshalNamespaceURI

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

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

unmarshalAttributes

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

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

unmarshalAuthorizations

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

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

unmarshalActions

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

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

unmarshalSchemaURL

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

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

marshal

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

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

remove

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

Returns:
the ListUnmarshaller.Builder for XMLContextEventTypes.

getListBuilder

public static ListUnmarshaller.Builder<XMLContextEventType> getListBuilder(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 and the strategy is set to Append.

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.