com.bea.schema
Class SOMAttribute

java.lang.Object
  extended bycom.bea.schema.SOMObject
      extended bycom.bea.schema.SOMBasic
          extended bycom.bea.schema.SOMAttribute
All Implemented Interfaces:
Serializable, SOMReference

public class SOMAttribute
extends SOMBasic

<attribute> The XML representation for an attribute declaration schema component is an <attribute> element information item. It specifies a simple type definition for an attribute either by reference or explicitly, and may provide default information.

Version:
1.0
Author:
sharpe
See Also:
SOMSchema, Serialized Form

Field Summary
static short DEFAULT
          Deprecated. replaced by default attribute
static short FIXED
          Deprecated. replaced by fixed attribute
static short OPTIONAL
           
static short PROHIBITED
           
static short REQUIRED
           
 
Constructor Summary
SOMAttribute(String name)
          Construct an <attribute> where type is defaulted to SOMType.STRING
SOMAttribute(String name, SOMType type)
          Construct an <attribute>
 
Method Summary
 Map getAttributes(boolean getAll)
          retrieve the attributes for this schema element.
 String getDefault()
          get the "default" attribute.
 String getFixed()
          get the "fixed" attribute.
 String getID()
          <xsd:attribute>
 short getUse()
          get the "use" attribute.
 String getUseString()
          get the "use" attribute.
 String getValue()
          Deprecated. "fixed" and "default" attributes replaced "value"
 SOMType setType(SOMType type)
          Valid types for SOMAttribute are SOMElementalType's, SOMSimpleType, and SOMAnnotation
 void setUse(short p_use)
          set the use attribute.
 void setUse(String p_use)
          set the use attribute.
 void setValue(String p_value)
          Deprecated. "fixed" and "default" attributes replaced "value"
 
Methods inherited from class com.bea.schema.SOMBasic
addAnnotation, addAnnotation, addComplexType, addDocumentation, addSequence, addSimpleType, contains, createDefault, getAnnotation, getForm, getName, getRef, getType, getTypeName, isRef, isValidatingContent, removeAnnotation, setDefault, setFixed, setForm, setName, setRef, setRef, toXML
 
Methods inherited from class com.bea.schema.SOMObject
addPrefixMapping, getContainmentXPath, getEffectivePrefixMappings, getID_UQ, getParent, getParentName, getParentSchema, getPrefixForTargetNamespace, getPrefixMapping, getTargetNamespace, getURIForPrefix, isCircularReference, isSchemaChild, msg, msg, removeNamespaceQualifier, removePrefixMapping, setIndent, setParent, setTargetNamespace, toString, toXML, toXML, toXML
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

OPTIONAL

public static final short OPTIONAL
See Also:
Constant Field Values

PROHIBITED

public static final short PROHIBITED
See Also:
Constant Field Values

REQUIRED

public static final short REQUIRED
See Also:
Constant Field Values

DEFAULT

public static final short DEFAULT
Deprecated. replaced by default attribute

Since:
May 2, 2001
See Also:
Constant Field Values

FIXED

public static final short FIXED
Deprecated. replaced by fixed attribute

Since:
May 2, 2001
See Also:
Constant Field Values
Constructor Detail

SOMAttribute

public SOMAttribute(String name)
Construct an <attribute> where type is defaulted to SOMType.STRING

Parameters:
name - <attribute name="...">

SOMAttribute

public SOMAttribute(String name,
                    SOMType type)
Construct an <attribute>

Parameters:
name - <attribute name="...">
type - <attribute type="..."> If the type parameter is null, the default type is set to SOMType.STRING.
Method Detail

setType

public SOMType setType(SOMType type)
Valid types for SOMAttribute are SOMElementalType's, SOMSimpleType, and SOMAnnotation

Overrides:
setType in class SOMBasic
Parameters:
type -
Returns:
a reference to the SOMType object that was just inserted as 'type'

setUse

public void setUse(String p_use)
set the use attribute. Valid values for use are optional, prohibited, required, default, and fixed. Any other value will throw an IllegalArgumentException

Parameters:
p_use - optional, prohibited, required, default, and fixed.

setUse

public void setUse(short p_use)
set the use attribute. Valid values for use are the constants OPTIONAL, PROHIBITED, REQUIRED, DEFAULT, and FIXED. Any other value will throw an IllegalArgumentException.

Parameters:
p_use - OPTIONAL, PROHIBITED, REQUIRED, DEFAULT, and FIXED.

setValue

public void setValue(String p_value)
Deprecated. "fixed" and "default" attributes replaced "value"

set the value attribute. A value is required if the use attribute is set to default or fixed.

Parameters:
p_value -
Since:
Mar 16, 2001

getUse

public short getUse()
get the "use" attribute. optional | prohibited | required


getUseString

public String getUseString()
get the "use" attribute. optional | prohibited | required


getValue

public String getValue()
Deprecated. "fixed" and "default" attributes replaced "value"

Returns:
value attribute
Since:
Mar 16, 2001

getFixed

public String getFixed()
get the "fixed" attribute.

Overrides:
getFixed in class SOMBasic

getDefault

public String getDefault()
get the "default" attribute.

Overrides:
getDefault in class SOMBasic

getID

public String getID()
<xsd:attribute>

Specified by:
getID in interface SOMReference
Specified by:
getID in class SOMObject
Returns:
String representation of the element tag

getAttributes

public Map getAttributes(boolean getAll)
retrieve the attributes for this schema element. If getAll is false, only the attributes that are not set to their default value are returned. If getAll is true, all possible attributes for this element will be returned.

Overrides:
getAttributes in class SOMBasic
Parameters:
getAll - get all attributes
Returns:
a Hashtable of attributes, where the attribute name and value are stored as strings.