org.menagery.dtd
Class Option

java.lang.Object
  |
  +--org.menagery.dtd.Option
Direct Known Subclasses:
OptionList

public class Option
extends java.lang.Object


Field Summary
static int OPTION_NONE
          Indicates that the option cardinality is not specified.
static int OPTION_NONE_TO_MANY
          Indicates that the option cardinality is none-to-many (*)
static int OPTION_ONE_TO_MANY
          Indicates that the option cardinality is one-to-many (+)
static int OPTION_OPTIONAL
          Indicates that the option cardinality is optional (?)
 
Constructor Summary
Option()
          Creates a new Option object.
Option(java.lang.String optionname)
          Creates a new Option object.
 
Method Summary
 Element getElement()
          Gets the associated Element for this option.
 java.lang.String getName()
          Get the option name.
 int getOptionType()
          Gets the type (cardinality) of this option.
 void setElement(Element element)
          Sets the Element associated with this option.
 void setOptionType(int optiontype)
          Sets the type (cardinality) of this option.
 java.lang.String toString()
          Returns a String representation of this Option.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

OPTION_NONE

public static final int OPTION_NONE
Indicates that the option cardinality is not specified.

OPTION_NONE_TO_MANY

public static final int OPTION_NONE_TO_MANY
Indicates that the option cardinality is none-to-many (*)

OPTION_OPTIONAL

public static final int OPTION_OPTIONAL
Indicates that the option cardinality is optional (?)

OPTION_ONE_TO_MANY

public static final int OPTION_ONE_TO_MANY
Indicates that the option cardinality is one-to-many (+)
Constructor Detail

Option

public Option(java.lang.String optionname)
Creates a new Option object.
Parameters:
optionname - The name of this option (from the DTD).

Option

public Option()
Creates a new Option object.
Method Detail

getName

public java.lang.String getName()
Get the option name.
Returns:
The option name.

getElement

public Element getElement()
Gets the associated Element for this option.
Returns:
The Element object, or none if not yet associated.

setElement

public void setElement(Element element)
Sets the Element associated with this option.
Parameters:
element - The associated Element object.

getOptionType

public int getOptionType()
Gets the type (cardinality) of this option. The type is one of OPTION_NONE_TO_MANY, OPTION_OPTIONAL, OPTION_ONE_TO_MANY, or OPTION_NONE.
Returns:
An integer representing the cardinality of this option.

setOptionType

public void setOptionType(int optiontype)
Sets the type (cardinality) of this option. The type is one of OPTION_NONE_TO_MANY, OPTION_OPTIONAL, OPTION_ONE_TO_MANY, or OPTION_NONE.
Parameters:
optiontype - The integer option type.

toString

public java.lang.String toString()
Returns a String representation of this Option.
Overrides:
toString in class java.lang.Object
Returns:
A string representation of this Option object.