|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.exolab.castor.xml.schema.Structure
org.exolab.castor.xml.schema.Annotated
org.exolab.castor.xml.schema.Schema
An XML Schema Definition. This class also contains the Factory methods for creating Top-Level structures.
Field Summary | |
static java.lang.String |
DEFAULT_SCHEMA_NS
The Namespace supported by the W3C XML Schema Recommendation. |
Fields inherited from class org.exolab.castor.xml.schema.Structure |
ANNOTATION, APPINFO, ATTRIBUTE, ATTRIBUTE_GROUP, COMPLEX_CONTENT, COMPLEX_TYPE, DOCUMENTATION, ELEMENT, FACET, GROUP, IDENTITY_FIELD, IDENTITY_SELECTOR, KEY, KEYREF, LIST, MODELGROUP, MODELGROUP_REF, REDEFINE, SCHEMA, SIMPLE_CONTENT, SIMPLE_TYPE, UNION, UNIQUE, UNKNOWN, WILDCARD |
Constructor Summary | |
Schema()
Creates a new SchemaDef |
|
Schema(java.lang.String schemaNS)
Creates a new SchemaDef |
Method Summary | |
void |
addAttribute(AttributeDecl attribute)
Adds the given attribute definition to this Schema definition |
void |
addAttributeGroup(AttributeGroupDecl attrGroup)
Adds the given attribute group definition to this Schema definition. |
void |
addComplexType(ComplexType complexType)
Adds the given Complextype definition to this Schema defintion |
void |
addElementDecl(ElementDecl elementDecl)
Adds the given Element declaration to this Schema defintion |
void |
addImportedSchema(Schema schema)
Adds the given Schema definition to this Schema definition as an imported schenma |
void |
addInclude(java.lang.String include)
Indicates that the given XML Schema file has been processed via an |
void |
addModelGroup(ModelGroup group)
Adds the given Group declaration to this Schema definition |
void |
addNamespace(java.lang.String prefix,
java.lang.String ns)
Adds to the namespaces declared in this Schema |
void |
addSimpleType(SimpleType simpleType)
Adds the given SimpletType definition to this Schema defintion |
ComplexType |
createComplexType()
Creates a new ComplexType using this Schema as the owning Schema document. |
ComplexType |
createComplexType(java.lang.String name)
Creates a new ComplexType using this Schema as the owning Schema document. |
SimpleType |
createSimpleType(java.lang.String name,
SimpleType baseType)
Creates a new SimpleType using this Schema as the owning Schema document. |
SimpleType |
createSimpleType(java.lang.String name,
java.lang.String baseName,
java.lang.String derivation)
Creates a new SimpleType using this Schema as the owning Schema document. |
AttributeDecl |
getAttribute(java.lang.String name)
Returns the top-level Attribute associated with the given name. |
Form |
getAttributeFormDefault()
Returns the attributeFormDefault property of this Schema. |
AttributeGroup |
getAttributeGroup(java.lang.String name)
Returns the AttributeGroup associated with the given name. |
java.util.Enumeration |
getAttributeGroups()
Returns an Enumeration of all top-level AttributeGroup declarations |
java.util.Enumeration |
getAttributes()
Returns an Enumeration of all top-level Attribute declarations |
BlockList |
getBlockDefault()
Returns the default BlockList for this Schema. |
java.lang.String |
getBuiltInTypeName(int builtInTypeCode)
Gets a built in type's name given its code. |
ComplexType |
getComplexType(java.lang.String name)
Returns the ComplexType of associated with the given name |
java.util.Enumeration |
getComplexTypes()
Returns an Enumeration of all top-level ComplexType declarations |
ElementDecl |
getElementDecl(java.lang.String name)
Returns the ElementDecl of associated with the given name |
java.util.Enumeration |
getElementDecls()
Returns an Enumeration of all top-level element declarations |
Form |
getElementFormDefault()
Returns the elementFormDefault property of this Schema. |
FinalList |
getFinalDefault()
Returns the default FinalList for this Schema. |
java.lang.String |
getId()
Returns the Id for this Schema, as specified by the Id attribute, or null if no Id exists. |
java.util.Enumeration |
getImportedSchema()
Returns the imported schemas of this schema |
Schema |
getImportedSchema(java.lang.String ns)
Returns an imported schema by its namespace |
ModelGroup |
getModelGroup(java.lang.String name)
Returns the ModeGroup of associated with the given name |
java.util.Enumeration |
getModelGroups()
Returns an Enumeration of all top-level ModelGroup declarations |
java.util.Hashtable |
getNamespaces()
Returns the namespaces declared for this Schema |
java.lang.String |
getSchemaLocation()
Returns the schemaLocation hint provided of this schema |
java.lang.String |
getSchemaNamespace()
Returns the namespace of the XML Schema Note: This is not the same as targetNamespace. |
SimpleType |
getSimpleType(java.lang.String name)
Returns the SimpleType associated with the given name, or null if no such SimpleType exists. |
java.util.Enumeration |
getSimpleTypes()
Returns an Enumeration of all SimpleType declarations |
short |
getStructureType()
Returns the type of this Schema Structure |
java.lang.String |
getTargetNamespace()
Returns the target namespace for this Schema, or null if no namespace has been defined. |
XMLType |
getType(java.lang.String typeName)
Returns the first simple or complex type which name equals TypeName |
(package private) static SimpleTypesFactory |
getTypeFactory()
Gets the type factory, package private |
java.lang.String |
getVersion()
Returns the version information of the XML Schema definition represented by this Schema instance. |
boolean |
includeProcessed(java.lang.String includeFile)
Returns True if the given XML Schema has already been included via |
boolean |
isKnownNamespace(java.lang.String namespaceURL)
Returns True if the namespace is known to this schema |
boolean |
removeAttribute(AttributeDecl attribute)
Removes the given top level Attribute from this Schema |
boolean |
removeComplexType(ComplexType complexType)
Removes the given top level ComplexType from this Schema |
boolean |
removeElement(ElementDecl element)
Removes the given top level Element from this Schema |
boolean |
removeGroup(ModelGroup group)
Removes the given top level ModelGroup definition from this Schema |
boolean |
removeSimpleType(SimpleType simpleType)
Removes the given top level SimpleType from this Schema |
void |
setAttributeFormDefault(Form attributeFormDefault)
Sets the attributeFormDefault property of this Schema. |
void |
setBlockDefault(BlockList block)
Sets the default BlockList for this Schema. |
void |
setBlockDefault(java.lang.String block)
Sets the default Block values for this Schema. |
void |
setElementFormDefault(Form elementFormDefault)
Sets the elementFormDefault property of this Schema. |
void |
setFinalDefault(FinalList finalList)
Sets the default FinalList for this Schema. |
void |
setFinalDefault(java.lang.String finalValues)
Sets the default final values for this Schema. |
void |
setId(java.lang.String id)
Sets the Id for this Schema |
void |
setSchemaLocation(java.lang.String schemaLocation)
Set the schemaLocation for this schema. |
void |
setTargetNamespace(java.lang.String targetNamespace)
Sets the target namespace for this Schema |
void |
setVersion(java.lang.String version)
Sets the version information for the XML Schema defintion represented by this Schema instance. |
void |
validate()
Checks the validity of this Schema defintion. |
Methods inherited from class org.exolab.castor.xml.schema.Annotated |
addAnnotation, getAnnotations, removeAnnotation |
Methods inherited from class org.exolab.castor.xml.schema.Structure |
isValid |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String DEFAULT_SCHEMA_NS
Constructor Detail |
public Schema()
public Schema(java.lang.String schemaNS)
Method Detail |
public void addAttribute(AttributeDecl attribute) throws SchemaException
attribute
- the AttributeDecl to add
SchemaException
- if an AttributeDecl
already exisits with the same namepublic void addAttributeGroup(AttributeGroupDecl attrGroup) throws SchemaException
attrGroup
- the AttributeGroupDecl to add
SchemaException
- if an AttributeGroupDecl
already exisits with the same namepublic void addComplexType(ComplexType complexType) throws SchemaException
SchemaException
- if the Complextype does not have
a name or if another Complextype already exists with the same namepublic void addElementDecl(ElementDecl elementDecl) throws SchemaException
elementDecl
- the ElementDecl to add to this SchemaDef
SchemaException
- when an ElementDecl already
exists with the same name as the given ElementDeclpublic void addModelGroup(ModelGroup group) throws SchemaException
group
- the Group to add to this SchemaDef
SchemaException
- when an Group already
exists with the same name as the given ElementDeclpublic void addImportedSchema(Schema schema) throws SchemaException
schema
- the Schema to add to this Schema as an imported schema
SchemaException
- if the Schema already existspublic void addNamespace(java.lang.String prefix, java.lang.String ns)
public void addSimpleType(SimpleType simpleType) throws SchemaException
SchemaException
- if the SimpleType does not have
a name or if another SimpleType already exists with the same namepublic ComplexType createComplexType()
public ComplexType createComplexType(java.lang.String name)
name
- the name of the ComplexType
public SimpleType createSimpleType(java.lang.String name, java.lang.String baseName, java.lang.String derivation)
name
- the name of the SimpleTypebaseName
- the name of the SimpleType's base typederivation
- the name of the derivation method (""/"list"/"restriction")
public SimpleType createSimpleType(java.lang.String name, SimpleType baseType)
name
- the name of the SimpleTypebaseType
- the base type of the SimpleType to create
public Form getAttributeFormDefault()
public java.util.Enumeration getAttributes()
public AttributeDecl getAttribute(java.lang.String name)
public java.util.Enumeration getAttributeGroups()
public AttributeGroup getAttributeGroup(java.lang.String name)
public BlockList getBlockDefault()
public java.lang.String getBuiltInTypeName(int builtInTypeCode)
public ComplexType getComplexType(java.lang.String name)
public java.util.Enumeration getComplexTypes()
public ElementDecl getElementDecl(java.lang.String name)
public java.util.Enumeration getElementDecls()
public Form getElementFormDefault()
public FinalList getFinalDefault()
public SimpleType getSimpleType(java.lang.String name)
public java.util.Enumeration getSimpleTypes()
public java.lang.String getSchemaLocation()
public ModelGroup getModelGroup(java.lang.String name)
public java.util.Enumeration getModelGroups()
public java.lang.String getId()
public java.util.Enumeration getImportedSchema()
public Schema getImportedSchema(java.lang.String ns)
public java.util.Hashtable getNamespaces()
public void addInclude(java.lang.String include)
public boolean includeProcessed(java.lang.String includeFile)
public java.lang.String getSchemaNamespace()
public java.lang.String getTargetNamespace()
public java.lang.String getVersion()
public boolean isKnownNamespace(java.lang.String namespaceURL)
public boolean removeComplexType(ComplexType complexType)
complexType
- the ComplexType to remove
public boolean removeElement(ElementDecl element)
element
- the ElementDecl to remove
public boolean removeAttribute(AttributeDecl attribute)
attribute
- the AttributeDecl to remove
public boolean removeGroup(ModelGroup group)
group
- the ModelGroup definition to remove
public boolean removeSimpleType(SimpleType simpleType)
public void setAttributeFormDefault(Form attributeFormDefault)
attributeFormDefault
- the Form value of the attributeFormDefault
property for this Schema.public void setBlockDefault(BlockList block)
block
- the default BlockList to set for this Schema.public void setBlockDefault(java.lang.String block)
block
- the default Block values to set for this Schema.public void setElementFormDefault(Form elementFormDefault)
elementFormDefault
- the Form value of the elementFormDefault
property for this Schema.public void setFinalDefault(FinalList finalList)
public void setFinalDefault(java.lang.String finalValues)
finalValues
- the default final values to set for this Schema.public void setSchemaLocation(java.lang.String schemaLocation)
schemaLocation
- the location hint for this Schemapublic XMLType getType(java.lang.String typeName)
public void setId(java.lang.String id)
id
- the Id for this Schemapublic void setTargetNamespace(java.lang.String targetNamespace)
targetNamespace
- the target namespace for this Schemapublic void setVersion(java.lang.String version)
static SimpleTypesFactory getTypeFactory()
public short getStructureType()
getStructureType
in class Structure
public void validate() throws ValidationException
validate
in class Structure
ValidationException
- when this Schema definition
is invalid.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |