|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--com.saxonica.schema.SchemaElement
|
+--com.saxonica.schema.Schema
A class representing a collection of schema components corresponding to a single target namespaces. In other words, the contents of a schema document together with the schema documents it references using xs:include.
| Field Summary |
| Fields inherited from class com.saxonica.schema.SchemaElement |
ANNOTATION, ANYTYPE, APPINFO, ATTRIBUTE, ATTRIBUTE_GROUP, COMPLEX_CONTENT, COMPLEX_TYPE, COMPOSITOR, DOCUMENTATION, ELEMENT, FACET, GROUP, IDENTITY_FIELD, IDENTITY_SELECTOR, KEY, KEYREF, LIST, REDEFINE, SCHEMA, SIMPLE_CONTENT, SIMPLE_TYPE, UNION, UNIQUE, UNKNOWN, WILDCARD_ATTRIBUTE, WILDCARD_ELEMENT |
| Constructor Summary | |
Schema(NamePool pool,
SchemaAwareConfiguration config)
Create a new Schema definition |
|
| Method Summary | |
void |
addAttribute(AttributeDecl attribute)
Adds the given attribute definition to this Schema. |
void |
addComplexType(UserComplexType complexType)
Adds the given Complextype definition to this Schema defintion. |
void |
addComponent(SchemaComponent obj)
Add an object that might contain a forwards reference to be fixed up later |
void |
addElementDecl(ElementDecl elementDecl)
Adds the given Element declaration to this Schema defintion |
void |
addIdentityConstraint(IdentityConstraint constraint)
Add an identity constraint |
void |
addImportedSchema(Schema schema)
Adds the given Schema definition to this Schema definition as an imported schenma |
void |
addSimpleType(SimpleTypeDefinition simpleType)
Adds the given named SimpleType definition to this Schema. |
void |
copyTo(Schema destination)
Copy the contents of this schema to another schema |
void |
error(java.lang.String message,
javax.xml.transform.SourceLocator locator)
Report an error |
void |
fixupForwardsReferences(javax.xml.transform.ErrorListener listener)
Fix up references and check for circularities |
java.lang.String |
getAttributeFormDefault()
Returns the attributeFormDefault property of this Schema. |
int |
getBlockDefault()
Returns the default BlockList for this Schema. |
UserComplexType |
getComplexType(java.lang.String localName)
Get the top-level complex type within this schema that has a given local name. |
SchemaAwareConfiguration |
getConfiguration()
Get the configuration |
ElementDecl |
getElementDeclaration(java.lang.String localName)
Get the element declaration with a given local name |
java.lang.String |
getElementFormDefault()
Returns the elementFormDefault property of this Schema. |
int |
getErrorCount()
Test whether errors have been reported |
int |
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. |
IdentityConstraint |
getIdentityConstraint(int fingerprint)
Get the identity constraint whose name has a given fingerprint |
Schema |
getImportedSchema(java.lang.String ns)
Returns an imported schema by its namespace |
NamePool |
getNamePool()
Get the NamePool used by this schema |
java.lang.String |
getSchemaLocation()
Returns the schemaLocation hint provided for this schema |
SimpleTypeDefinition |
getSimpleType(int fingerprint)
Get the top-level simple type within this schema that has a given fingerprint. |
short |
getStructureType()
Returns the type of this Schema Structure |
SuperSchema |
getSuperSchema()
Get the SuperSchema holding indexes of names defined in any schema |
java.lang.String |
getTargetNamespace()
Returns the target namespace for this Schema, or "" if no namespace has been defined. |
java.lang.String |
getVersion()
Returns the version information of the XML Schema definition represented by this Schema instance. |
void |
registerId(java.lang.String id,
java.lang.Object object,
javax.xml.transform.SourceLocator locator)
Register an ID; throw an exception if it is not unique |
void |
registerSchemaType(SchemaType type)
Register a top-level SchemaType (simple type or complex type) in the NamePool, using its fingerprint |
void |
rollback()
After an error, remove all the global schema components from the namepool |
void |
setAttributeFormDefault(java.lang.String attributeFormDefault)
Sets the attributeFormDefault property of this Schema. |
void |
setBlockDefault(int value)
Sets the default Block values for this Schema. |
void |
setConfiguration(SchemaAwareConfiguration config)
Set the configuration |
void |
setElementFormDefault(java.lang.String elementFormDefault)
Sets the elementFormDefault property of this Schema. |
void |
setFinalDefault(int value)
Sets the default "final" list 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. |
boolean |
validate(javax.xml.transform.ErrorListener errorListener)
Checks the validity of this Schema definition. |
| Methods inherited from class com.saxonica.schema.SchemaElement |
getColumnNumber, getLineNumber, getPublicId, getSystemId, setLocator |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public Schema(NamePool pool,
SchemaAwareConfiguration config)
pool - A NamePool used to hold the names defined in this schemaconfig - The configuration object holding system configuration information| Method Detail |
public SuperSchema getSuperSchema()
public void setConfiguration(SchemaAwareConfiguration config)
public SchemaAwareConfiguration getConfiguration()
public void addComponent(SchemaComponent obj)
public void fixupForwardsReferences(javax.xml.transform.ErrorListener listener)
throws javax.xml.transform.TransformerException
javax.xml.transform.TransformerException
public void registerId(java.lang.String id,
java.lang.Object object,
javax.xml.transform.SourceLocator locator)
throws SchemaException
SchemaExceptionpublic void addAttribute(AttributeDecl attribute)
attribute - the AttributeDecl to add
public void addComplexType(UserComplexType complexType)
throws SchemaException
complexType - the Complextype to add to this Schema
SchemaException - if the Complextype does not have
a namepublic UserComplexType getComplexType(java.lang.String localName)
public SimpleTypeDefinition getSimpleType(int fingerprint)
public 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 ElementDecl getElementDeclaration(java.lang.String localName)
localName - the local name of the element
public void addImportedSchema(Schema schema)
throws SchemaException
schema - the Schema to add to this Schema as an imported schema
SchemaException - if the Schema already exists
public void addSimpleType(SimpleTypeDefinition simpleType)
throws SchemaException
simpleType - the SimpleType to add to this Schema
SchemaException - if the SimpleType does not have
a namepublic void registerSchemaType(SchemaType type)
type - The type to be registeredpublic NamePool getNamePool()
public java.lang.String getAttributeFormDefault()
public int getBlockDefault()
public java.lang.String getElementFormDefault()
public int getFinalDefault()
public java.lang.String getSchemaLocation()
public void addIdentityConstraint(IdentityConstraint constraint)
public IdentityConstraint getIdentityConstraint(int fingerprint)
public java.lang.String getId()
public Schema getImportedSchema(java.lang.String ns)
public java.lang.String getTargetNamespace()
public java.lang.String getVersion()
public void setAttributeFormDefault(java.lang.String attributeFormDefault)
attributeFormDefault - the Form value of the attributeFormDefault
property for this Schema, as a string, "qualified" or "unqualified".
The caller is responsible for validating the value.public void setBlockDefault(int value)
value - the default Block values to set for this Schema, as
a bit-significant integer.public void setElementFormDefault(java.lang.String elementFormDefault)
elementFormDefault - the Form value of the elementFormDefault
property for this Schema.public void setFinalDefault(int value)
value - the default final values to set for this Schema, as a bit-significant
integerpublic void setSchemaLocation(java.lang.String schemaLocation)
schemaLocation - the location hint for this Schemapublic 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)
version - the version for this XML Schema defination.
public void copyTo(Schema destination)
throws SchemaException
destination - the destination of the copy
SchemaException - if there are name clashes between this
schema and the destination schemapublic short getStructureType()
getStructureType in class SchemaElement
public boolean validate(javax.xml.transform.ErrorListener errorListener)
throws javax.xml.transform.TransformerException
errorListener - an error handler to which all errors should be reported
javax.xml.transform.TransformerException - if the ErrorListener decides that an error is fatalpublic int getErrorCount()
public void error(java.lang.String message,
javax.xml.transform.SourceLocator locator)
throws SchemaException
error in interface SchemaMarkerSchemaExceptionpublic void rollback()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||