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

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

public class DefaultActionUnmarshaller
extends Object
implements Unmarshaller<DefaultAction>

Unmarshalls and marshalls a DefaultAction from/into an Element.

Author:
sanjin

Nested Class Summary
static class DefaultActionUnmarshaller.Builder
          Builder of DefaultActionUnmarshaller.
 
Field Summary
static String ACTION_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 REQUIRED_ATTRIBUTE
          The name of attribute that holds marshalled requirement.
 
Constructor Summary
DefaultActionUnmarshaller(Element element)
          Creates instance of DefaultAction 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<DefaultAction> getListBuilder()
          Creates instance of ListUnmarshaller.Builder for DefaultActions.
 void marshal(DefaultAction action)
          Marshalls specified DefaultAction into the Element.
 void remove()
          Removes any marshalled DefaultAction from the Element.
 DefaultAction unmarshal()
          Unmarshalls an DefaultAction from the Element.
 String unmarshalName()
          Unmarshalls name of DefaultAction from the Element.
 boolean unmarshalRequirement()
          Unmarshalls requirement of DefaultAction from the Element .
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ACTION_ELEMENT

public static final String ACTION_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

REQUIRED_ATTRIBUTE

public static final String REQUIRED_ATTRIBUTE
The name of attribute that holds marshalled requirement.

See Also:
Constant Field Values
Constructor Detail

DefaultActionUnmarshaller

public DefaultActionUnmarshaller(Element element)
Creates instance of DefaultAction 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 DefaultAction unmarshal()
                        throws FailedUnmarshallingException
Unmarshalls an DefaultAction from the Element.

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

unmarshalName

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

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

unmarshalRequirement

public boolean unmarshalRequirement()
                             throws FailedUnmarshallingException
Unmarshalls requirement of DefaultAction from the Element . If the requirement value is missing then the DefaultAction.REQUIREMENT_DEFAULT is returned.

Returns:
the requirement of marshalled DefaultAction or null if the Element does not contain marshalled requirement.
Throws:
FailedUnmarshallingException - if unmarshalling was unsuccessful.

marshal

public void marshal(DefaultAction action)
Marshalls specified DefaultAction into the Element.

Specified by:
marshal in interface Marshaller<DefaultAction>
Parameters:
action - the DefaultAction.
Throws:
NullPointerException - if specified Attribute is null.

remove

public void remove()
Removes any marshalled DefaultAction from the Element.

Specified by:
remove in interface Marshaller<DefaultAction>

getListBuilder

public static ListUnmarshaller.Builder<DefaultAction> getListBuilder()
Creates instance of ListUnmarshaller.Builder for DefaultActions. The returned ListUnmarshaller.Builder does not have the parent Element set and caller should set it before building the ListUnmarshaller for DefaultActions. The name for child Elements is set to ACTION_ELEMENT and the strategy is set to Append.

Returns:
the ListUnmarshaller.Builder for DefaultActions.


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