org.enhydra.shark.xpdl
Class XMLComplexChoice

java.lang.Object
  extended by org.enhydra.shark.xpdl.XMLElement
      extended by org.enhydra.shark.xpdl.XMLComplexChoice
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable
Direct Known Subclasses:
ActivityTypes, ApplicationTypes, DataTypes, ImplementationTypes, StartFinishModes

public abstract class XMLComplexChoice
extends XMLElement

Class that represents choice of complex elements from XML schema.

Author:
Sasa Bojanic
See Also:
Serialized Form

Field Summary
protected  boolean cachesInitialized
           
protected  java.util.ArrayList choices
           
protected  XMLElement choosen
           
 
Fields inherited from class org.enhydra.shark.xpdl.XMLElement
isReadOnly, listeners, notifyListeners, notifyMainListeners, originalElementHashCode, parent, value
 
Constructor Summary
XMLComplexChoice(XMLComplexElement parent, java.lang.String name, boolean isRequired)
           
 
Method Summary
 void clearCaches()
           
 java.lang.Object clone()
          Used to create exact copy of the element.
 boolean equals(java.lang.Object e)
           
protected abstract  void fillChoices()
           
 java.util.ArrayList getChoices()
          The possible choices - instances of XMLElement class.
 XMLElement getChoosen()
           
 void initCaches()
          Initializes caches in read-only mode.
 boolean isEmpty()
          Indicates if element is empty.
 void makeAs(XMLElement el)
           
 void setChoosen(XMLElement ch)
           
 void setNotifyListeners(boolean notify)
           
 void setNotifyMainListeners(boolean notify)
           
 void setReadOnly(boolean ro)
          Overrides super-method to set this element and all of its choice elements read only value to the one specified.
 void setValue(java.lang.String v)
          Sets the element value.
 
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
 

Field Detail

choices

protected java.util.ArrayList choices

choosen

protected XMLElement choosen

cachesInitialized

protected transient boolean cachesInitialized
Constructor Detail

XMLComplexChoice

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

setValue

public void setValue(java.lang.String v)
Description copied from class: XMLElement
Sets the element value. If it is simple element or an non-choice attribute, this sets the actual value of the element. If it is choice attribute, it sets the choosen value. Only some complex elements (Condition, SchemaType, and ExtendedAttribute) allows you to use this method, while others will throw RuntimeException.

Overrides:
setValue in class XMLElement

makeAs

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

setReadOnly

public void setReadOnly(boolean ro)
Overrides super-method to set this element and all of its choice elements read only value to the one specified.

Overrides:
setReadOnly in class XMLElement

setNotifyListeners

public void setNotifyListeners(boolean notify)
Overrides:
setNotifyListeners in class XMLElement

setNotifyMainListeners

public void setNotifyMainListeners(boolean notify)
Overrides:
setNotifyMainListeners in class XMLElement

initCaches

public void initCaches()
Initializes caches in read-only mode. If mode is not read-only, throws RuntimeException.


clearCaches

public void clearCaches()

isEmpty

public boolean isEmpty()
Description copied from class: XMLElement
Indicates if element is empty.

Overrides:
isEmpty in class XMLElement

getChoices

public java.util.ArrayList getChoices()
The possible choices - instances of XMLElement class.

Returns:
the possible choices for this element.

getChoosen

public XMLElement getChoosen()

setChoosen

public void setChoosen(XMLElement ch)

fillChoices

protected abstract void fillChoices()

clone

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

Overrides:
clone in class XMLElement

equals

public boolean equals(java.lang.Object e)
Overrides:
equals in class XMLElement