Top Description Fields Constructors Methods
org.apache.xerces.impl.xs

public Class XSDDescription

extends XMLResourceIdentifierImpl
implements XMLSchemaDescription
Class Inheritance
All Implemented Interfaces
org.apache.xerces.xni.grammars.XMLSchemaDescription, org.apache.xerces.xni.grammars.XMLGrammarDescription, org.apache.xerces.xni.XMLResourceIdentifier
Imports
org.apache.xerces.util.XMLResourceIdentifierImpl, org.apache.xerces.xni.QName, .XMLAttributes, org.apache.xerces.xni.grammars.XMLGrammarDescription, .XMLSchemaDescription

All information specific to XML Schema grammars.
Authors
Neil Graham, IBM, Neeraj Bajaj, SUN Microsystems.
Version
$Id: XSDDescription.java 446734 2006-09-15 20:51:23Z mrglavas $

Field Summary

Modifier and TypeField and Description
public static final short
CONTEXT_ATTRIBUTE

Hides org.apache.xerces.xni.grammars.XMLSchemaDescription.CONTEXT_ATTRIBUTE.

Indicate that the parse of the current schema document is triggered by the occurrence of an attribute whose namespace is the target namespace of this schema document.
public static final short
CONTEXT_ELEMENT

Hides org.apache.xerces.xni.grammars.XMLSchemaDescription.CONTEXT_ELEMENT.

Indicate that the parse of the current schema document is triggered by the occurrence of an element whose namespace is the target namespace of this schema document.
public static final short
CONTEXT_IMPORT

Hides org.apache.xerces.xni.grammars.XMLSchemaDescription.CONTEXT_IMPORT.

Indicate that the current schema document is <import>ed by another schema document.
public static final short
CONTEXT_INCLUDE

Hides org.apache.xerces.xni.grammars.XMLSchemaDescription.CONTEXT_INCLUDE.

Indicate that the current schema document is <include>d by another schema document.
public static final short
CONTEXT_INITIALIZE

Indicate that this description was just initialized.

public static final short
CONTEXT_INSTANCE

Hides org.apache.xerces.xni.grammars.XMLSchemaDescription.CONTEXT_INSTANCE.

Indicate that the parse of the current schema document is triggered by xsi:schemaLocation/noNamespaceSchemaLocation attribute(s) in the instance document.
public static final short
CONTEXT_PREPARSE

Hides org.apache.xerces.xni.grammars.XMLSchemaDescription.CONTEXT_PREPARSE.

Indicate that the current schema document is being preparsed.
public static final short
CONTEXT_REDEFINE

Hides org.apache.xerces.xni.grammars.XMLSchemaDescription.CONTEXT_REDEFINE.

Indicate that the current schema document is <redefine>d by another schema document.
public static final short
CONTEXT_XSITYPE

Hides org.apache.xerces.xni.grammars.XMLSchemaDescription.CONTEXT_XSITYPE.

Indicate that the parse of the current schema document is triggered by the occurrence of an "xsi:type" attribute, whose value (a QName) has the target namespace of this schema document as its namespace.
protected XMLAttributes
protected short
protected QName
protected String[]
protected QName
Inherited from org.apache.xerces.util.XMLResourceIdentifierImpl:
fBaseSystemIdfExpandedSystemIdfLiteralSystemIdfNamespacefPublicId

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

True if they are equal, else false
equals
(Object
The description of the grammar to be compared with
descObj
)

Overrides java.lang.Object.equals.

Compares this grammar with the given grammar.
public boolean
public XMLAttributes

Returns:

all attributes of the tiggering/enclosing element
getAttributes
()

Implements org.apache.xerces.xni.grammars.XMLSchemaDescription.getAttributes.

If a call is triggered by an element/attribute/xsi:type in the instance, this call returns all attribute of such element (or enclosing element).
public short

Returns:

the value indicating the context
getContextType
()

Implements org.apache.xerces.xni.grammars.XMLSchemaDescription.getContextType.

Get the context.
public QName

Returns:

the name of the enclosing element
getEnclosingElementName
()

Implements org.apache.xerces.xni.grammars.XMLSchemaDescription.getEnclosingElementName.

If a call is triggered by an attribute or xsi:type, then this mehtod returns the enclosing element of such element.
public String
getGrammarType()

Implements org.apache.xerces.xni.grammars.XMLGrammarDescription.getGrammarType.

the type of the grammar (e.g., DTD or XSD);
public String[]

Returns:

an array of all location hints associated to the expected target namespace
getLocationHints
()

Implements org.apache.xerces.xni.grammars.XMLSchemaDescription.getLocationHints.

For import and references from the instance document, it's possible to have multiple hints for one namespace.
public String

Returns:

the expected/enclosing target namespace
getTargetNamespace
()

Implements org.apache.xerces.xni.grammars.XMLSchemaDescription.getTargetNamespace.

If the context is "include" or "redefine", then return the target namespace of the enclosing schema document; otherwise, the expected target namespace of this document.
public QName

Returns:

the name of the triggering component
getTriggeringComponent
()

Implements org.apache.xerces.xni.grammars.XMLSchemaDescription.getTriggeringComponent.

If a call is triggered by an element/attribute/xsi:type in the instance, this call returns the name of such triggering component: the name of the element/attribute, or the value of the xsi:type.
public int

Returns:

The hash code
hashCode
()

Overrides org.apache.xerces.util.XMLResourceIdentifierImpl.hashCode.

Returns the hash code of this grammar
public XSDDescription
public void
reset()

resets all the fields

public void
public void
setContextType(short contextType)

public void
setEnclosingElementName(QName enclosedElementName)

public void
setLocationHints(String[] locationHints)

public void
setTargetNamespace(String targetNamespace)

public void
setTriggeringComponent(QName triggeringComponent)

Inherited from org.apache.xerces.util.XMLResourceIdentifierImpl:
cleargetBaseSystemIdgetExpandedSystemIdgetLiteralSystemIdgetNamespacegetPublicIdsetBaseSystemIdsetExpandedSystemIdsetLiteralSystemIdsetNamespacesetPublicIdsetValuessetValuestoString

Field Detail

CONTEXT_ATTRIBUTEback to summary
public static final short CONTEXT_ATTRIBUTE

Hides org.apache.xerces.xni.grammars.XMLSchemaDescription.CONTEXT_ATTRIBUTE.

Indicate that the parse of the current schema document is triggered by the occurrence of an attribute whose namespace is the target namespace of this schema document. This value is only used if we do defer the loading of schema documents until a component from that namespace is referenced from the instance.

CONTEXT_ELEMENTback to summary
public static final short CONTEXT_ELEMENT

Hides org.apache.xerces.xni.grammars.XMLSchemaDescription.CONTEXT_ELEMENT.

Indicate that the parse of the current schema document is triggered by the occurrence of an element whose namespace is the target namespace of this schema document. This value is only used if we do defer the loading of schema documents until a component from that namespace is referenced from the instance.

CONTEXT_IMPORTback to summary
public static final short CONTEXT_IMPORT

Hides org.apache.xerces.xni.grammars.XMLSchemaDescription.CONTEXT_IMPORT.

Indicate that the current schema document is ed by another schema document.

CONTEXT_INCLUDEback to summary
public static final short CONTEXT_INCLUDE

Hides org.apache.xerces.xni.grammars.XMLSchemaDescription.CONTEXT_INCLUDE.

Indicate that the current schema document is d by another schema document.

CONTEXT_INITIALIZEback to summary
public static final short CONTEXT_INITIALIZE

Indicate that this description was just initialized.

CONTEXT_INSTANCEback to summary
public static final short CONTEXT_INSTANCE

Hides org.apache.xerces.xni.grammars.XMLSchemaDescription.CONTEXT_INSTANCE.

Indicate that the parse of the current schema document is triggered by xsi:schemaLocation/noNamespaceSchemaLocation attribute(s) in the instance document. This value is only used if we don't defer the loading of schema documents.

CONTEXT_PREPARSEback to summary
public static final short CONTEXT_PREPARSE

Hides org.apache.xerces.xni.grammars.XMLSchemaDescription.CONTEXT_PREPARSE.

Indicate that the current schema document is being preparsed.

CONTEXT_REDEFINEback to summary
public static final short CONTEXT_REDEFINE

Hides org.apache.xerces.xni.grammars.XMLSchemaDescription.CONTEXT_REDEFINE.

Indicate that the current schema document is d by another schema document.

CONTEXT_XSITYPEback to summary
public static final short CONTEXT_XSITYPE

Hides org.apache.xerces.xni.grammars.XMLSchemaDescription.CONTEXT_XSITYPE.

Indicate that the parse of the current schema document is triggered by the occurrence of an "xsi:type" attribute, whose value (a QName) has the target namespace of this schema document as its namespace. This value is only used if we do defer the loading of schema documents until a component from that namespace is referenced from the instance.

fAttributesback to summary
protected XMLAttributes fAttributes
fContextTypeback to summary
protected short fContextType
fEnclosedElementNameback to summary
protected QName fEnclosedElementName
fLocationHintsback to summary
protected String[] fLocationHints
fTriggeringComponentback to summary
protected QName fTriggeringComponent

Constructor Detail

XSDDescriptionback to summary
public XSDDescription()

Method Detail

equalsback to summary
public boolean equals(Object descObj)

Overrides java.lang.Object.equals.

Compares this grammar with the given grammar. Currently, we compare the target namespaces.

Parameters
descObj:Object

The description of the grammar to be compared with

Returns:boolean

True if they are equal, else false

fromInstanceback to summary
public boolean fromInstance()
getAttributesback to summary
public XMLAttributes getAttributes()

Implements org.apache.xerces.xni.grammars.XMLSchemaDescription.getAttributes.

If a call is triggered by an element/attribute/xsi:type in the instance, this call returns all attribute of such element (or enclosing element).

Returns:XMLAttributes

all attributes of the tiggering/enclosing element

getContextTypeback to summary
public short getContextType()

Implements org.apache.xerces.xni.grammars.XMLSchemaDescription.getContextType.

Get the context. The returned value is one of the pre-defined CONTEXT_xxx constants.

Returns:short

the value indicating the context

getEnclosingElementNameback to summary
public QName getEnclosingElementName()

Implements org.apache.xerces.xni.grammars.XMLSchemaDescription.getEnclosingElementName.

If a call is triggered by an attribute or xsi:type, then this mehtod returns the enclosing element of such element.

Returns:QName

the name of the enclosing element

getGrammarTypeback to summary
public String getGrammarType()

Implements org.apache.xerces.xni.grammars.XMLGrammarDescription.getGrammarType.

the type of the grammar (e.g., DTD or XSD);

Returns:String

Doc from org.apache.xerces.xni.grammars.XMLGrammarDescription.getGrammarType.

the type of this grammar

See Also
org.apache.xerces.xni.grammars.Grammar
getLocationHintsback to summary
public String[] getLocationHints()

Implements org.apache.xerces.xni.grammars.XMLSchemaDescription.getLocationHints.

For import and references from the instance document, it's possible to have multiple hints for one namespace. So this method returns an array, which contains all location hints.

Returns:String[]

an array of all location hints associated to the expected target namespace

getTargetNamespaceback to summary
public String getTargetNamespace()

Implements org.apache.xerces.xni.grammars.XMLSchemaDescription.getTargetNamespace.

If the context is "include" or "redefine", then return the target namespace of the enclosing schema document; otherwise, the expected target namespace of this document.

Returns:String

the expected/enclosing target namespace

getTriggeringComponentback to summary
public QName getTriggeringComponent()

Implements org.apache.xerces.xni.grammars.XMLSchemaDescription.getTriggeringComponent.

If a call is triggered by an element/attribute/xsi:type in the instance, this call returns the name of such triggering component: the name of the element/attribute, or the value of the xsi:type.

Returns:QName

the name of the triggering component

hashCodeback to summary
public int hashCode()

Overrides org.apache.xerces.util.XMLResourceIdentifierImpl.hashCode.

Returns the hash code of this grammar

Returns:int

The hash code

makeCloneback to summary
public XSDDescription makeClone()
resetback to summary
public void reset()

resets all the fields

setAttributesback to summary
public void setAttributes(XMLAttributes attributes)
setContextTypeback to summary
public void setContextType(short contextType)
setEnclosingElementNameback to summary
public void setEnclosingElementName(QName enclosedElementName)
setLocationHintsback to summary
public void setLocationHints(String[] locationHints)
setTargetNamespaceback to summary
public void setTargetNamespace(String targetNamespace)
setTriggeringComponentback to summary
public void setTriggeringComponent(QName triggeringComponent)