org.enhydra.shark.xpdl
Class XMLComplexElement

java.lang.Object
  extended by org.enhydra.shark.xpdl.XMLElement
      extended by org.enhydra.shark.xpdl.XMLBaseForCollectionAndComplex
          extended by org.enhydra.shark.xpdl.XMLComplexElement
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable
Direct Known Subclasses:
ArrayType, Automatic, BasicType, BlockActivity, Condition, ConformanceClass, DataType, Deadline, DeclaredType, EnumerationValue, ExtendedAttribute, ExternalPackage, ExternalReference, FinishMode, Implementation, Join, ListType, Manual, Member, Namespace, No, Package, PackageHeader, ParticipantType, ProcessHeader, RedefinableHeader, Route, SchemaType, Script, SimulationInformation, Split, StartMode, SubFlow, TimeEstimation, TransitionRestriction, XMLCollectionElement, XMLEmptyChoiceElement

public abstract class XMLComplexElement
extends XMLBaseForCollectionAndComplex

Class that represents complex element from XML schema.

Author:
Sasa Bojanic
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.enhydra.shark.xpdl.XMLBaseForCollectionAndComplex
cachesInitialized, elementMap, elements
 
Fields inherited from class org.enhydra.shark.xpdl.XMLElement
isReadOnly, listeners, notifyListeners, notifyMainListeners, originalElementHashCode, parent, value
 
Constructor Summary
XMLComplexElement(XMLElement parent, boolean isRequired)
           
XMLComplexElement(XMLElement parent, java.lang.String name, boolean isRequired)
           
 
Method Summary
protected  boolean add(int no, XMLElement el)
          Adds new element to a certain position
protected  void add(XMLElement el)
          Adds new element.
 java.lang.Object clone()
          Used to create exact copy of the element.
 boolean containsName(java.lang.String name)
          Returns true if there is an element with such element in structure.
protected abstract  void fillStructure()
          The classes that are derived from this class has to give its definition for this method.
 XMLElement get(java.lang.String name)
          Gets the element with specified name from stucture.
 java.util.ArrayList getXMLAttributes()
          Returns the collection of XML attributes this element is made of.
 java.util.ArrayList getXMLElements()
          Returns the collection of XML elements this element is made of.
 boolean isEmpty()
          It is empty if its value is not set, and if all elements in the structure are empty.
 void makeAs(XMLElement el)
           
 boolean set(int no, java.lang.String value)
          Sets the element that is placed at specified location within structure to the specified value.
 void set(java.lang.String name, java.lang.String value)
          Sets the element from structure with specified name to the specified value.
 
Methods inherited from class org.enhydra.shark.xpdl.XMLBaseForCollectionAndComplex
clearCaches, contains, equals, get, initCaches, setNotifyListeners, setNotifyMainListeners, setReadOnly, setValue, size, toElementMap, toElements
 
Methods inherited from class org.enhydra.shark.xpdl.XMLElement
addListener, createInfo, getListeners, getMainElement, getOriginalElementHashCode, getParent, isMainElement, isReadOnly, isRequired, notifyListeners, notifyMainListeners, removeListener, setParent, toName, toValue
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLComplexElement

public XMLComplexElement(XMLElement parent,
                         boolean isRequired)

XMLComplexElement

public XMLComplexElement(XMLElement parent,
                         java.lang.String name,
                         boolean isRequired)
Method Detail

makeAs

public void makeAs(XMLElement el)
Overrides:
makeAs in class XMLElement

add

protected void add(XMLElement el)
Description copied from class: XMLBaseForCollectionAndComplex
Adds new element.

Specified by:
add in class XMLBaseForCollectionAndComplex

add

protected boolean add(int no,
                      XMLElement el)
Description copied from class: XMLBaseForCollectionAndComplex
Adds new element to a certain position

Specified by:
add in class XMLBaseForCollectionAndComplex

isEmpty

public boolean isEmpty()
It is empty if its value is not set, and if all elements in the structure are empty.

Overrides:
isEmpty in class XMLElement

getXMLElements

public java.util.ArrayList getXMLElements()
Returns the collection of XML elements this element is made of.


getXMLAttributes

public java.util.ArrayList getXMLAttributes()
Returns the collection of XML attributes this element is made of.


set

public void set(java.lang.String name,
                java.lang.String value)
Sets the element from structure with specified name to the specified value.


set

public boolean set(int no,
                   java.lang.String value)
Sets the element that is placed at specified location within structure to the specified value.


get

public XMLElement get(java.lang.String name)
Gets the element with specified name from stucture.


containsName

public boolean containsName(java.lang.String name)
Returns true if there is an element with such element in structure.


fillStructure

protected abstract void fillStructure()
The classes that are derived from this class has to give its definition for this method. It is used to insert all members of those classes that are derived from XMLElement.

NOTE: The order of inserted elements is relevant for XML to be valid (members of classes derived from this class must be inserted into first mentioned list in the same order that they are within a corresponding tag for those classes within WfMC XML).


clone

public java.lang.Object clone()
Description copied from class: XMLElement
Used to create exact copy of the element.

Overrides:
clone in class XMLElement