org.exolab.castor.xml.schema
public class Schema extends Annotated
Version: $Revision: 1.3 $ $Date: 2003/03/03 18:13:37 $
Field Summary | |
---|---|
static String | DEFAULT_SCHEMA_NS
The Namespace supported by the W3C XML Schema
Recommendation. |
static String | XSI_NAMESPACE
The Namespace supported by the W3C XML Schema
Recommendation for the built-in types:
xsi:type, xsi:nil, and xsi:schemaLocation. |
Constructor Summary | |
---|---|
Schema()
Creates a new Schema definition | |
Schema(String schemaNS)
Creates a new Schema definition
| |
Schema(String prefix, String schemaNS)
Creates a new Schema definition
|
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(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(String prefix, 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(String name)
Creates a new ComplexType using this Schema as the owning Schema
document. |
SimpleType | createSimpleType(String name, String baseName, String derivation)
Creates a new SimpleType using this Schema as the owning Schema
document. |
SimpleType | createSimpleType(String name, SimpleType baseType)
Creates a new SimpleType using this Schema as the owning Schema
document. |
AttributeDecl | getAttribute(String name)
Returns the top-level Attribute associated with the given name.
|
Form | getAttributeFormDefault()
Returns the attributeFormDefault property of this Schema.
|
AttributeGroup | getAttributeGroup(String name)
Returns the AttributeGroup associated with the given name.
|
Enumeration | getAttributeGroups()
Returns an Enumeration of all top-level AttributeGroup declarations |
Enumeration | getAttributes()
Returns an Enumeration of all top-level Attribute declarations |
BlockList | getBlockDefault()
Returns the default BlockList for this Schema.
|
String | getBuiltInTypeName(int builtInTypeCode)
Gets a built in type's name given its code. |
ComplexType | getComplexType(String name)
Returns the ComplexType of associated with the given name |
Enumeration | getComplexTypes()
Returns an Enumeration of all top-level ComplexType declarations |
ElementDecl | getElementDecl(String name)
Returns the ElementDecl of associated with the given name |
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.
|
String | getId()
Returns the Id for this Schema, as specified by the
Id attribute, or null if no Id exists.
|
Enumeration | getImportedSchema()
Returns the imported schemas of this schema |
Schema | getImportedSchema(String ns)
Returns an imported schema by its namespace |
ModelGroup | getModelGroup(String name)
Returns the ModeGroup of associated with the given name |
Enumeration | getModelGroups()
Returns an Enumeration of all top-level ModelGroup declarations |
String | getNamespace(String prefix)
Returns the namespace associated with the given prefix.
|
protected String | getNamespacePrefix(String namespace)
Returns the namespace prefix associated with the
given namespace. |
Hashtable | getNamespaces()
Returns the namespaces declared for this Schema
|
String | getSchemaLocation()
Returns the schemaLocation hint provided of this schema |
String | getSchemaNamespace()
Returns the namespace of the XML Schema
Note: This is not the same as targetNamespace. |
SimpleType | getSimpleType(String name)
Returns the SimpleType associated with the given name,
or null if no such SimpleType exists.
|
SimpleType | getSimpleType(String name, String namespace)
Returns the SimpleType associated with the given name
and namespace, or null if no such SimpleType exists.
|
Enumeration | getSimpleTypes()
Returns an Enumeration of all SimpleType declarations |
short | getStructureType()
Returns the type of this Schema Structure |
String | getTargetNamespace()
Returns the target namespace for this Schema, or null if no
namespace has been defined. |
XMLType | getType(String typeName)
Returns the first simple or complex type which name equals TypeName |
static SimpleTypesFactory | getTypeFactory() Gets the type factory, package private |
String | getVersion()
Returns the version information of the XML Schema definition
represented by this Schema instance.
|
boolean | includeProcessed(String includeFile)
Returns True if the given XML Schema has already been included via |
boolean | isKnownNamespace(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 | removeNamespace(String prefix)
Removes the namespace from the set of namespace declarations for
this Schema definition.
|
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(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(String finalValues)
Sets the default final values for this Schema.
|
void | setId(String id)
Sets the Id for this Schema
|
void | setSchemaLocation(String schemaLocation)
Set the schemaLocation for this schema. |
void | setTargetNamespace(String targetNamespace)
Sets the target namespace for this Schema |
void | setVersion(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.
|
Parameters: schemaNS the namespace of the XML Schema itself. Note this is not the same as the targetNamespace.
Parameters: prefix the desired namespace prefix for the schemaNS. schemaNS the namespace of the XML Schema itself. Note this is not the same as the targetNamespace.
Parameters: attribute the AttributeDecl to add
Throws: SchemaException if an AttributeDecl already exisits with the same name
Parameters: attrGroup the AttributeGroupDecl to add
Throws: SchemaException if an AttributeGroupDecl already exisits with the same name
Parameters: complextype the Complextype to add to this Schema
Throws: SchemaException if the Complextype does not have a name or if another Complextype already exists with the same name
Parameters: elementDecl the ElementDecl to add to this SchemaDef
Throws: SchemaException when an ElementDecl already exists with the same name as the given ElementDecl
Parameters: schema the Schema to add to this Schema as an imported schema
Throws: SchemaException if the Schema already exists
Parameters: group the Group to add to this SchemaDef
Throws: SchemaException when an Group already exists with the same name as the given ElementDecl
Parameters: namespaces the list of namespaces
Parameters: simpletype the SimpleType to add to this Schema
Throws: SchemaException if the SimpleType does not have a name or if another SimpleType already exists with the same name
Returns: the new ComplexType
Parameters: name the name of the ComplexType
Returns: the new ComplexType
Parameters: name the name of the SimpleType baseName the name of the SimpleType's base type derivation the name of the derivation method (""/"list"/"restriction")
Returns: the new SimpleType.
Parameters: name the name of the SimpleType baseType the base type of the SimpleType to create
Returns: the new SimpleType.
Returns: the Attribute associated with the given name, or null if no Attribute association is found.
Returns: the attributeFormDefault property of this Schema, or null if no default Form was set. If no default Form has been set, the user should assume Form.Unqualified.
Returns: the AttributeGroup associated with the given name, or null if no AttributeGroup association is found.
Returns: an Enumeration of all top-level AttributeGroup declarations
Returns: an Enumeration of all top-level Attribute declarations
Returns: the default BlockList for this Schema.
Returns: the ComplexType of associated with the given name, or null if no ComplexType with the given name was found.
Returns: an Enumeration of all top-level ComplexType declarations
Returns: the ElementDecl of associated with the given name, or null if no ElementDecl with the given name was found.
Returns: an Enumeration of all top-level element declarations
Returns: the elementFormDefault property of this Schema, or null if no default Form was set. If no default Form has been set, the user should assume Form.Unqualified.
Returns: final the default FinalList for this Schema.
Returns: the Id for this Scheam, or null if no Id exists
Returns: the hashtable of the imported schemas
Returns: The imported schema
Returns: the ModelGroup of associated with the given name, or null if no ModelGroup with the given name was found.
Returns: an Enumeration of all top-level ModelGroup declarations
Returns: the namespace associated with the given prefix, or null if no associated namespace exists.
Returns: the namespace prefix associaed with the given namespace.
Returns: the namespaces declared for this Schema
Returns: the schemaLocation hint provided of this schema
Returns: the namespace of the XML Schema
Parameters: name the name of the SimpleType. The name may be a QName (contain a namespace prefix).
Returns: the SimpleType associated with the given name, or null if no such SimpleType exists.
Parameters: name the name of the simpleType. It is an error if this name contains a prefix, it must be an NCName. namespace the namespace URI of the simpleType.
Returns: the SimpleType, or null if no such SimpleType exists.
Returns: an Enumeration of all SimpleType declarations
Returns: the type of this Schema Structure
Returns: the target namespace for this Schema, or null if no namespace has been defined
Returns: the version information of the XML Schema definition, or null if no version information exists.
Returns: True if the file specified has already been processed
Parameters: namespace the namespace URL
Returns: True if the namespace was declared in the schema
Parameters: attribute the AttributeDecl to remove
Returns: true if the AttributeDecl has been removed, or false if the AttributeDecl wasn't top level or didn't exist in this Schema
Parameters: complexType the ComplexType to remove
Returns: true if the complexType has been removed, or false if the complexType wasn't top level or didn't exist in this Schema
Parameters: element the ElementDecl to remove
Returns: true if the ElementDecl has been removed, or false if the ElementDecl wasn't top level or didn't exist in this Schema
Parameters: group the ModelGroup definition to remove
Returns: true if the ModelGroup definition has been removed, or false if the ModelGroup definition wasn't top level or didn't exist in this Schema.
Parameters: prefix the namespace prefix of the namespace to remove.
Parameters: SimpleType the SimpleType to remove
Returns: true if the SimpleType has been removed, or false if the SimpleType wasn't top level or didn't exist in this Schema
Parameters: attributeFormDefault the Form value of the attributeFormDefault property for this Schema.
Parameters: block the default BlockList to set for this Schema.
Parameters: block the default Block values to set for this Schema.
Parameters: elementFormDefault the Form value of the elementFormDefault property for this Schema.
Parameters: final the default FinalList to set for this Schema.
Parameters: finalValues the default final values to set for this Schema.
Parameters: id the Id for this Schema
Parameters: schemaLocation the location hint for this Schema
Parameters: targetNamespace the target namespace for this Schema
See Also: § 2.7 XML Schema Part 1: Structures
Parameters: the version for this XML Schema defination.
Throws: ValidationException when this Schema definition is invalid.