Public Member Functions | Static Public Attributes | Protected Member Functions

org.exolab.castor.xml.schema.AttributeDecl Class Reference

Inheritance diagram for org.exolab.castor.xml.schema.AttributeDecl:
org.exolab.castor.xml.schema.Annotated org.exolab.castor.xml.schema.Structure

List of all members.

Public Member Functions

 AttributeDecl (Schema schema, String name)
 AttributeDecl (Schema schema)
Form getForm ()
String getId ()
String getName ()
String getName (boolean ignoreRef)
Structure getParent ()
SimpleType getSimpleType ()
AttributeDecl getReference ()
String getReferenceName ()
Schema getSchema ()
String getUse ()
String getDefaultValue ()
String getFixedValue ()
boolean isDefault ()
boolean isFixed ()
boolean isOptional ()
boolean isProhibited ()
boolean isRequired ()
boolean isReference ()
void setForm (Form form)
void setId (String id)
void setName (String name)
void setReference (AttributeDecl reference)
void setReference (String reference)
void setSimpleType (SimpleType simpleType)
void setSimpleTypeReference (String name)
void setUse (String value)
void setDefaultValue (String value)
void setFixedValue (String value)
short getStructureType ()
void validate () throws ValidationException

Static Public Attributes

static final String USE_OPTIONAL = "optional"
static final String USE_PROHIBITED = "prohibited"
static final String USE_REQUIRED = "required"

Protected Member Functions

void setParent (Structure parent)
void setSchema (Schema schema)

Detailed Description

An XML Schema Attribute Definition

Author:
Keith Visco
Version:
Revision:
1.3
Date:
2004/09/21 14:08:27

Constructor & Destructor Documentation

org.exolab.castor.xml.schema.AttributeDecl.AttributeDecl ( Schema  schema,
String  name 
)

Creates a new AttrDecl with the given name

Parameters:
name of the Attribute defined by this attribute declaration
schema the schema that contains the new attrDecl

References org.exolab.castor.xml.schema.AttributeDecl.setName().

org.exolab.castor.xml.schema.AttributeDecl.AttributeDecl ( Schema  schema  ) 

Creates a new AttrDecl in the given schema.

Parameters:
schema the schema that contains the new attrDecl

Member Function Documentation

String org.exolab.castor.xml.schema.AttributeDecl.getDefaultValue (  ) 

Returns the default value of this element definition.

Returns:
the default value of this element definition, or null if no default was specified.
String org.exolab.castor.xml.schema.AttributeDecl.getFixedValue (  ) 

Returns the fixed value of this element definition.

Returns:
the fixed value of this element definition, or null if no default was specified.
Form org.exolab.castor.xml.schema.AttributeDecl.getForm (  ) 

Returns the Form for this attribute declaration. The Form object species whether or not names are qualified or unqualified for instances of this attribute declaration. If null, the Form should be obtained from the parent Schema.

Returns:
the Form for this attribute declaration, or null if not set.

Referenced by org.exolab.castor.builder.binding.XMLBindingComponent.getTargetNamespace().

String org.exolab.castor.xml.schema.AttributeDecl.getId (  ) 

Returns the Id for this attribute declaration

Returns:
the Id for this attribute declaration
String org.exolab.castor.xml.schema.AttributeDecl.getName ( boolean  ignoreRef  ) 

Returns the name of this Attribute declaration. The name will always be an NCName, no namespace prefix will be included.

Parameters:
ingoreRef a boolean that when false, indicates that if this is an attribute reference to return the reference name. Otherwise the only the local name is used.
Returns:
the name of this attribute declaration

References org.exolab.castor.xml.schema.AttributeDecl.isReference().

String org.exolab.castor.xml.schema.AttributeDecl.getName (  ) 

Returns the name of attributes defined by this AttributeDecl. If this AttributeDecl is a reference to another AttributeDecl, the reference will be resolved and the name of the referenced AttributeDecl will be returned. The name will always be an NCName, no namespace prefix will be included.

Returns:
the name of attributes defined by this AttributeDecl.

Referenced by org.exolab.castor.xml.schema.AttributeGroupDecl.getAttribute(), org.exolab.castor.xml.schema.Schema.removeAttribute(), and org.exolab.castor.xml.schema.AttributeDecl.setReference().

Structure org.exolab.castor.xml.schema.AttributeDecl.getParent (  ) 

Returns the parent of this AttributeDecl, this value may be null if no parent has been set.

Returns:
the parent Structure of this AttributeDecl.

Referenced by org.exolab.castor.builder.binding.XMLBindingComponent.getTargetNamespace().

AttributeDecl org.exolab.castor.xml.schema.AttributeDecl.getReference (  ) 
String org.exolab.castor.xml.schema.AttributeDecl.getReferenceName (  ) 

Returns the actual reference name of this AttributeDecl, or null if this AttributeDecl is not a reference. The name returned, if not null, will be a QName, possibly containing the namespace prefix.

Returns:
the reference name
Schema org.exolab.castor.xml.schema.AttributeDecl.getSchema (  ) 
short org.exolab.castor.xml.schema.AttributeDecl.getStructureType (  )  [virtual]

Returns the type of this Schema Structure

Returns:
the type of this Schema Structure

Implements org.exolab.castor.xml.schema.Structure.

String org.exolab.castor.xml.schema.AttributeDecl.getUse (  ) 

Returns the value of the use attribute for this attribute declaration or attribute reference. If this is a reference the value of the use attribute will *not* be obtained from the referenced attribute declaration as top-level attributes do not take into account the use attribute.

Returns:
the value of the use attribute for this attribute declaration

References org.exolab.castor.xml.schema.AttributeDecl.USE_OPTIONAL, org.exolab.castor.xml.schema.AttributeDecl.USE_PROHIBITED, and org.exolab.castor.xml.schema.AttributeDecl.USE_REQUIRED.

Referenced by org.exolab.castor.xml.schema.AttributeDecl.isOptional(), org.exolab.castor.xml.schema.AttributeDecl.isProhibited(), and org.exolab.castor.xml.schema.AttributeDecl.isRequired().

boolean org.exolab.castor.xml.schema.AttributeDecl.isDefault (  ) 

Returns true if the "default" flag is set.

Returns:
true if the "default" flag is set.

Referenced by org.exolab.castor.xml.schema.reader.AttributeUnmarshaller.AttributeUnmarshaller().

boolean org.exolab.castor.xml.schema.AttributeDecl.isFixed (  ) 

Returns true if the use attribute is equal to "optional".

Returns:
true if the use attribute is equal to "optional".
boolean org.exolab.castor.xml.schema.AttributeDecl.isOptional (  ) 

Returns true if the use attribute is equal to "optional".

Returns:
true if the use attribute is equal to "optional".

References org.exolab.castor.xml.schema.AttributeDecl.getUse(), and org.exolab.castor.xml.schema.AttributeDecl.USE_OPTIONAL.

boolean org.exolab.castor.xml.schema.AttributeDecl.isProhibited (  ) 

Returns true if the use attribute is equal to "prohibited".

Returns:
true if the use attribute is equal to "prohibited".

References org.exolab.castor.xml.schema.AttributeDecl.getUse(), and org.exolab.castor.xml.schema.AttributeDecl.USE_PROHIBITED.

boolean org.exolab.castor.xml.schema.AttributeDecl.isRequired (  ) 

Returns true if the 'use' attribute is equal to REQUIRED and there is no specified value. If a value is specifed and the 'use' attribute is "required" then required is will return false, because the attribute value automatically becomes fixed.

Returns:
true if the use attribute is equal to "required" and no default value has been specified, otherwise false

References org.exolab.castor.xml.schema.AttributeDecl.getUse(), and org.exolab.castor.xml.schema.AttributeDecl.USE_REQUIRED.

void org.exolab.castor.xml.schema.AttributeDecl.setDefaultValue ( String  value  ) 
void org.exolab.castor.xml.schema.AttributeDecl.setFixedValue ( String  value  ) 
void org.exolab.castor.xml.schema.AttributeDecl.setForm ( Form  form  ) 

Sets the Form for this attribute declaration. The Form object species whether or not names are qualified or unqualified for instances of this attribute declaration. If null, the Form is to be obtained from the parent Schema.

Parameters:
form the Form type for this attribute declaration.

Referenced by org.exolab.castor.xml.schema.reader.AttributeUnmarshaller.AttributeUnmarshaller().

void org.exolab.castor.xml.schema.AttributeDecl.setId ( String  id  ) 

Sets the Id for this attribute declaration

Parameters:
id the Id for this attribute declaration

Referenced by org.exolab.castor.xml.schema.reader.AttributeUnmarshaller.AttributeUnmarshaller().

void org.exolab.castor.xml.schema.AttributeDecl.setName ( String  name  ) 

Sets the name of attributes defined by this attribute definition

Parameters:
name the name of the this AttributeDecl. Must be a valid NCName.
Exceptions:
IllegalArgumentException when the name is not valid

Referenced by org.exolab.castor.xml.schema.AttributeDecl.AttributeDecl(), and org.exolab.castor.xml.schema.reader.AttributeUnmarshaller.AttributeUnmarshaller().

void org.exolab.castor.xml.schema.AttributeDecl.setParent ( Structure  parent  )  [protected]
void org.exolab.castor.xml.schema.AttributeDecl.setReference ( String  reference  ) 

Sets the reference for this attribute definition

Parameters:
reference the name of the attribute definition that this definition references
void org.exolab.castor.xml.schema.AttributeDecl.setReference ( AttributeDecl  reference  ) 

Sets the reference for this attribute definition

Parameters:
reference the Attribute definition that this definition references

References org.exolab.castor.xml.schema.AttributeDecl.getName().

Referenced by org.exolab.castor.xml.schema.reader.AttributeUnmarshaller.AttributeUnmarshaller().

void org.exolab.castor.xml.schema.AttributeDecl.setSchema ( Schema  schema  )  [protected]

Set the parent schema of the current ElementDecl. The parent schema should at least have the same targetNamespace of the current schema.

This method is protected since it is only meant to be used by the internal API to propagate the parent XML Schema in case of a redefinition for instance.

Parameters:
schema 
void org.exolab.castor.xml.schema.AttributeDecl.setSimpleType ( SimpleType  simpleType  ) 
void org.exolab.castor.xml.schema.AttributeDecl.setSimpleTypeReference ( String  name  ) 

Sets the simple type of this attribute to be a reference.

Parameters:
name the name of the simpleType being referenced, must not be null.

References org.exolab.castor.xml.schema.AttributeDecl.setSimpleType().

Referenced by org.exolab.castor.xml.schema.reader.AttributeUnmarshaller.AttributeUnmarshaller(), and org.exolab.castor.xml.schema.util.XMLInstance2SchemaHandler.startElement().

void org.exolab.castor.xml.schema.AttributeDecl.setUse ( String  value  ) 

Sets the 'use' attribute of this attribute declaration Note: this should not be used to set the flag to FIXED or DEFAULT

Parameters:
value one of the following: ("prohibited" | "optional" | "required")
See also:
USE_PROHIBITED
USE_OPTIONAL
USE_REQUIRED

References org.exolab.castor.xml.schema.AttributeDecl.USE_OPTIONAL, org.exolab.castor.xml.schema.AttributeDecl.USE_PROHIBITED, and org.exolab.castor.xml.schema.AttributeDecl.USE_REQUIRED.

Referenced by org.exolab.castor.xml.schema.reader.AttributeUnmarshaller.AttributeUnmarshaller(), and org.exolab.castor.xml.dtd.Converter.convertAttribute().

void org.exolab.castor.xml.schema.AttributeDecl.validate (  )  throws ValidationException [virtual]

Checks the validity of this Attribute declaration

Exceptions:
ValidationException when this Attribute declaration is invalid

Implements org.exolab.castor.xml.schema.Structure.

References org.exolab.castor.xml.schema.Schema.getAttribute().


Member Data Documentation


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Enumerations Properties