org.enhydra.shark.xpdl
Class XMLAttribute

java.lang.Object
  extended by org.enhydra.shark.xpdl.XMLElement
      extended by org.enhydra.shark.xpdl.XMLAttribute
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class XMLAttribute
extends XMLElement

Represents attribute element from XML schema.

Author:
Sasa Bojanic
See Also:
Serialized Form

Field Summary
protected  java.util.ArrayList choices
          The possible choices.
protected  int defaultChoiceIndex
           
 
Fields inherited from class org.enhydra.shark.xpdl.XMLElement
isReadOnly, listeners, notifyListeners, notifyMainListeners, originalElementHashCode, parent, value
 
Constructor Summary
XMLAttribute(XMLElement parent, java.lang.String name, boolean isRequired)
           
XMLAttribute(XMLElement parent, java.lang.String name, boolean isRequired, java.lang.String[] choices, int choosenIndex)
           
 
Method Summary
 java.lang.Object clone()
          Used to create exact copy of the element.
 boolean equals(java.lang.Object e)
           
 java.util.ArrayList getChoices()
          The possible String choices.
 java.lang.String getDefaultChoice()
           
 int getDefaultChoiceIndex()
           
 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, isEmpty, isMainElement, isReadOnly, isRequired, makeAs, notifyListeners, notifyMainListeners, removeListener, setNotifyListeners, setNotifyMainListeners, setParent, setReadOnly, 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
The possible choices.


defaultChoiceIndex

protected int defaultChoiceIndex
Constructor Detail

XMLAttribute

public XMLAttribute(XMLElement parent,
                    java.lang.String name,
                    boolean isRequired)

XMLAttribute

public XMLAttribute(XMLElement parent,
                    java.lang.String name,
                    boolean isRequired,
                    java.lang.String[] choices,
                    int choosenIndex)
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

getChoices

public java.util.ArrayList getChoices()
The possible String choices.

Returns:
the possible choices for this element.

getDefaultChoice

public java.lang.String getDefaultChoice()

getDefaultChoiceIndex

public int getDefaultChoiceIndex()

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