Top Description Fields Constructors Methods
org.apache.xerces.dom

public Class ASModelImpl

extends Object
implements ASModel
Class Inheritance
All Implemented Interfaces
org.apache.xerces.dom3.as.ASModel, org.apache.xerces.dom3.as.ASObject
Imports
java.util.Vector, org.apache.xerces.dom3.as.ASAttributeDeclaration, .ASContentModel, .ASElementDeclaration, .ASEntityDeclaration, .ASModel, .ASNamedObjectMap, .ASNotationDeclaration, .ASObject, .ASObjectList, .DOMASException, org.apache.xerces.impl.xs.SchemaGrammar, org.w3c.dom.DOMException

Deprecated

To begin with, an abstract schema is a generic structure that could contain both internal and external subsets. An ASModel is an abstract object that could map to a DTD , an XML Schema , a database schema, etc. An ASModel could represent either an internal or an external subset; hence an abstract schema could be composed of an ASModel representing the internal subset and an ASModel representing the external subset. Note that the ASModel representing the external subset could consult the ASModel representing the internal subset. Furthermore, the ASModel representing the internal subset could be set to null by the setInternalAS method as a mechanism for "removal". In addition, only one ASModel representing the external subset can be specified as "active" and it is possible that none are "active". Finally, the ASModel contains the factory methods needed to create a various types of ASObjects like ASElementDeclaration, ASAttributeDeclaration, etc.

See also the Document Object Model (DOM) Level 3 Abstract Schemas and Load and Save Specification.

Authors
Pavani Mukthipudi, Neil Graham
Version
$Id: ASModelImpl.java 699892 2008-09-28 21:08:27Z mrglavas $

Field Summary

Modifier and TypeField and Description
protected Vector<E>
protected SchemaGrammar
pack-priv boolean

Constructor Summary

AccessConstructor and Description
public
public
ASModelImpl(boolean isNamespaceAware)

Method Summary

Modifier and TypeMethod and Description
public void
addASModel(ASModel
ASModel to be set. Subsequent calls will nest the ASModels within the specified ownerASModel.
abstractSchema
)

Implements org.apache.xerces.dom3.as.ASModel.addASModel.

Deprecated as a consequence of ASModel being deprecated.
This method will allow the nesting or "importation" of ASModels.
public ASObject

Returns:

Cloned ASObject.
cloneASObject
(boolean
Setting the deep flag on, causes the whole subtree to be duplicated. Setting it to false only duplicates its immediate child nodes.
deep
)

Implements org.apache.xerces.dom3.as.ASObject.cloneASObject.

Deprecated as a consequence of ASObject being deprecated.
Creates a copy of this ASObject.
public ASAttributeDeclaration

Returns:

A new ASAttributeDeclaration object with appropriate attributes set by input parameters.
createASAttributeDeclaration
(String
The namespace URI of the attribute being declared.
namespaceURI
,
String
The name of the attribute. The format of the name could be an NCName as defined by XML Namespaces or a Name as defined by XML 1.0; it's ASModel-dependent.
name
)

Implements org.apache.xerces.dom3.as.ASModel.createASAttributeDeclaration.

Deprecated as a consequence of ASAttributeDeclaration being deprecated.
Creates an attribute declaration.
public ASContentModel

Returns:

A new ASContentModel object.
createASContentModel
(int
The minimum occurrence for the subModels of this ASContentModel.
minOccurs
,
int
The maximum occurrence for the subModels of this ASContentModel.
maxOccurs
,
short
operator of type AS_CHOICE, AS_SEQUENCE, AS_ALL or AS_NONE.
operator
)

Implements org.apache.xerces.dom3.as.ASModel.createASContentModel.

Deprecated as a consequence of ASContentModel being deprecated.
Creates an object which describes part of an ASElementDeclaration's content model.
public ASElementDeclaration

Returns:

A new ASElementDeclaration object with name attribute set to tagname and namespaceURI set to systemId. Other attributes of the element declaration are set through ASElementDeclaration interface methods.
createASElementDeclaration
(String
The namespace URI of the element type being declared.
namespaceURI
,
String
The name of the element. The format of the name could be an NCName as defined by XML Namespaces or a Name as defined by XML 1.0; it's ASModel-dependent.
name
)

Implements org.apache.xerces.dom3.as.ASModel.createASElementDeclaration.

Deprecated as a consequence of ASElementDeclaration being deprecated.
Creates an element declaration for the element type specified.
public ASEntityDeclaration

Returns:

A new ASEntityDeclaration object with entityName attribute set to name.
createASEntityDeclaration
(String
The name of the entity being declared.
name
)

Implements org.apache.xerces.dom3.as.ASModel.createASEntityDeclaration.

Deprecated as a consequence of ASEntityDeclaration being deprecated.
Creates an ASEntityDeclaration.
public ASNotationDeclaration

Returns:

A new ASNotationDeclaration object with notationName attribute set to name and publicId and systemId set to the corresponding fields.
createASNotationDeclaration
(String
The namespace URI of the notation being declared.
namespaceURI
,
String
The name of the notation. The format of the name could be an NCName as defined by XML Namespaces or a Name as defined by XML 1.0; it's ASModel-dependent.
name
,
String
The system identifier for the notation declaration.
systemId
,
String
The public identifier for the notation declaration.
publicId
)

Implements org.apache.xerces.dom3.as.ASModel.createASNotationDeclaration.

Deprecated as a consequence of ASNotationDeclaration being deprecated.
Creates a new notation declaration.
public String
getAsHint()

Implements org.apache.xerces.dom3.as.ASModel.getAsHint.

The hint to locating an ASModel.
public String
public ASObjectList

Returns:

A list of ASModels.
getASModels
()

Implements org.apache.xerces.dom3.as.ASModel.getASModels.

Deprecated as a consequence of ASObjectList being deprecated.
To retrieve a list of nested ASModels without reference to names.
public short
getAsNodeType()

Implements org.apache.xerces.dom3.as.ASObject.getAsNodeType.

A code representing the underlying object as defined above.
public ASNamedObjectMap
getAttributeDeclarations()

Implements org.apache.xerces.dom3.as.ASModel.getAttributeDeclarations.

Deprecated as a consequence of ASNamedObjectMap being deprecated.
Instead of returning an all-in-one ASObject with ASModel methods, have discernible top-level/"global" attribute declarations.
public boolean
getContainer()

If usage is EXTERNAL_SUBSET or NOT_USED, and the ASModel is simply a container of other ASModels.

public ASNamedObjectMap
getContentModelDeclarations()

Implements org.apache.xerces.dom3.as.ASModel.getContentModelDeclarations.

Deprecated as a consequence of ASNamedObjectMap being deprecated.
Instead of returning an all-in-one ASObject with ASModel methods, have discernible top-level/"global content model declarations.
public ASNamedObjectMap
getElementDeclarations()

Implements org.apache.xerces.dom3.as.ASModel.getElementDeclarations.

Deprecated as a consequence of ASNamedObjectMap being deprecated.
Instead of returning an all-in-one ASObject with ASModel methods, have discernible top-level/"global" element declarations.
public ASNamedObjectMap
getEntityDeclarations()

Implements org.apache.xerces.dom3.as.ASModel.getEntityDeclarations.

Deprecated as a consequence of ASNamedObjectMap being deprecated.
Instead of returning an all-in-one ASObject with ASModel methods, have discernible top-level/"global" entity declarations.
public SchemaGrammar
public Vector<E>
public boolean
getIsNamespaceAware()

Implements org.apache.xerces.dom3.as.ASModel.getIsNamespaceAware.

true if this ASModel defines the document structure in terms of namespaces and local names ; false if the document structure is defined only in terms of QNames.
public String
getLocalName()

Implements org.apache.xerces.dom3.as.ASObject.getLocalName.

Returns the local part of the qualified name of this ASObject.
public String
getNamespaceURI()

Implements org.apache.xerces.dom3.as.ASObject.getNamespaceURI.

The namespace URI of this node, or null if it is unspecified.
public String
getNodeName()

Implements org.apache.xerces.dom3.as.ASObject.getNodeName.

The name of this ASObject depending on the ASObject type.
public ASNamedObjectMap
getNotationDeclarations()

Implements org.apache.xerces.dom3.as.ASModel.getNotationDeclarations.

Deprecated as a consequence of ASNamedObjectMap being deprecated.
Instead of returning an all-in-one ASObject with ASModel methods, have discernible top-level/"global" notation declarations.
public ASModel
getOwnerASModel()

Implements org.apache.xerces.dom3.as.ASObject.getOwnerASModel.

Deprecated as a consequence of ASModel being deprecated.
The ASModel object associated with this ASObject.
public String
getPrefix()

Implements org.apache.xerces.dom3.as.ASObject.getPrefix.

The namespace prefix of this node, or null if it is unspecified.
public short
getUsageLocation()

Implements org.apache.xerces.dom3.as.ASModel.getUsageLocation.

0 if used internally, 1 if used externally, 2 if not all.
public void
importASObject(ASObject
ASObject to be imported.
asobject
)

Deprecated as a consequence of ASObject being deprecated.
Imports ASObject into ASModel.
public void
insertASObject(ASObject
ASObject to be inserted.
asobject
)

Deprecated as a consequence of ASObject being deprecated.
Inserts ASObject into ASModel.
public void
removeAS(ASModel
AS to be removed.
as
)

Implements org.apache.xerces.dom3.as.ASModel.removeAS.

Deprecated as a consequence of ASModel being deprecated.
Removes only the specified ASModel from the list of ASModels.
public void
setAsHint(String asHint)

Implements org.apache.xerces.dom3.as.ASModel.setAsHint.

The hint to locating an ASModel.
public void
setAsLocation(String asLocation)

Implements org.apache.xerces.dom3.as.ASModel.setAsLocation.

The URI reference.
public void
public void
setLocalName(String localName)

Implements org.apache.xerces.dom3.as.ASObject.setLocalName.

Returns the local part of the qualified name of this ASObject.
public void
setNamespaceURI(String namespaceURI)

Implements org.apache.xerces.dom3.as.ASObject.setNamespaceURI.

The namespace URI of this node, or null if it is unspecified.
public void
setNodeName(String nodeName)

Implements org.apache.xerces.dom3.as.ASObject.setNodeName.

The name of this ASObject depending on the ASObject type.
public void
setOwnerASModel(ASModel ownerASModel)

Implements org.apache.xerces.dom3.as.ASObject.setOwnerASModel.

Deprecated as a consequence of ASModel being deprecated.
The ASModel object associated with this ASObject.
public void
setPrefix(String prefix)

Implements org.apache.xerces.dom3.as.ASObject.setPrefix.

The namespace prefix of this node, or null if it is unspecified.
public boolean

Returns:

true if the ASModel is valid, false otherwise.
validate
()

Implements org.apache.xerces.dom3.as.ASModel.validate.

Determines if an ASModel itself is valid, i.e., confirming that it's well-formed and valid per its own formal grammar.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

fASModelsback to summary
protected Vector<E> fASModels
fGrammarback to summary
protected SchemaGrammar fGrammar
fNamespaceAwareback to summary
pack-priv boolean fNamespaceAware

Constructor Detail

ASModelImplback to summary
public ASModelImpl()
ASModelImplback to summary
public ASModelImpl(boolean isNamespaceAware)

Method Detail

addASModelback to summary
public void addASModel(ASModel abstractSchema)

Implements org.apache.xerces.dom3.as.ASModel.addASModel.

Deprecated

as a consequence of ASModel being deprecated. See corresponding docs for further information.

This method will allow the nesting or "importation" of ASModels.

Parameters
abstractSchema:ASModel

ASModel to be set. Subsequent calls will nest the ASModels within the specified ownerASModel.

cloneASObjectback to summary
public ASObject cloneASObject(boolean deep)

Implements org.apache.xerces.dom3.as.ASObject.cloneASObject.

Deprecated

as a consequence of ASObject being deprecated. See corresponding docs for further information.

Creates a copy of this ASObject. See text for cloneNode off of Node but substitute AS functionality.

Parameters
deep:boolean

Setting the deep flag on, causes the whole subtree to be duplicated. Setting it to false only duplicates its immediate child nodes.

Returns:ASObject

Cloned ASObject.

createASAttributeDeclarationback to summary
public ASAttributeDeclaration createASAttributeDeclaration(String namespaceURI, String name) throws DOMException

Implements org.apache.xerces.dom3.as.ASModel.createASAttributeDeclaration.

Deprecated

as a consequence of ASAttributeDeclaration being deprecated. See corresponding docs for further information.

Creates an attribute declaration.

Parameters
namespaceURI:String

The namespace URI of the attribute being declared.

name:String

The name of the attribute. The format of the name could be an NCName as defined by XML Namespaces or a Name as defined by XML 1.0; it's ASModel-dependent.

Returns:ASAttributeDeclaration

A new ASAttributeDeclaration object with appropriate attributes set by input parameters.

Exceptions
DOMException:
INVALID_CHARACTER_ERR: Raised if the input name parameter contains an illegal character.
createASContentModelback to summary
public ASContentModel createASContentModel(int minOccurs, int maxOccurs, short operator) throws DOMASException

Implements org.apache.xerces.dom3.as.ASModel.createASContentModel.

Deprecated

as a consequence of ASContentModel being deprecated. See corresponding docs for further information.

Creates an object which describes part of an ASElementDeclaration's content model.

Parameters
minOccurs:int

The minimum occurrence for the subModels of this ASContentModel.

maxOccurs:int

The maximum occurrence for the subModels of this ASContentModel.

operator:short

operator of type AS_CHOICE, AS_SEQUENCE, AS_ALL or AS_NONE.

Returns:ASContentModel

A new ASContentModel object.

Exceptions
DOMASException:
A DOMASException, e.g., minOccurs > maxOccurs.
createASElementDeclarationback to summary
public ASElementDeclaration createASElementDeclaration(String namespaceURI, String name) throws DOMException

Implements org.apache.xerces.dom3.as.ASModel.createASElementDeclaration.

Deprecated

as a consequence of ASElementDeclaration being deprecated. See corresponding docs for further information.

Creates an element declaration for the element type specified.

Parameters
namespaceURI:String

The namespace URI of the element type being declared.

name:String

The name of the element. The format of the name could be an NCName as defined by XML Namespaces or a Name as defined by XML 1.0; it's ASModel-dependent.

Returns:ASElementDeclaration

A new ASElementDeclaration object with name attribute set to tagname and namespaceURI set to systemId. Other attributes of the element declaration are set through ASElementDeclaration interface methods.

Exceptions
DOMException:
INVALID_CHARACTER_ERR: Raised if the specified name contains an illegal character.
createASEntityDeclarationback to summary
public ASEntityDeclaration createASEntityDeclaration(String name) throws DOMException

Implements org.apache.xerces.dom3.as.ASModel.createASEntityDeclaration.

Deprecated

as a consequence of ASEntityDeclaration being deprecated. See corresponding docs for further information.

Creates an ASEntityDeclaration.

Parameters
name:String

The name of the entity being declared.

Returns:ASEntityDeclaration

A new ASEntityDeclaration object with entityName attribute set to name.

Exceptions
DOMException:
INVALID_CHARACTER_ERR: Raised if the specified name contains an illegal character.
createASNotationDeclarationback to summary
public ASNotationDeclaration createASNotationDeclaration(String namespaceURI, String name, String systemId, String publicId) throws DOMException

Implements org.apache.xerces.dom3.as.ASModel.createASNotationDeclaration.

Deprecated

as a consequence of ASNotationDeclaration being deprecated. See corresponding docs for further information.

Creates a new notation declaration.

Parameters
namespaceURI:String

The namespace URI of the notation being declared.

name:String

The name of the notation. The format of the name could be an NCName as defined by XML Namespaces or a Name as defined by XML 1.0; it's ASModel-dependent.

systemId:String

The system identifier for the notation declaration.

publicId:String

The public identifier for the notation declaration.

Returns:ASNotationDeclaration

A new ASNotationDeclaration object with notationName attribute set to name and publicId and systemId set to the corresponding fields.

Exceptions
DOMException:
INVALID_CHARACTER_ERR: Raised if the specified name contains an illegal character.
getAsHintback to summary
public String getAsHint()

Implements org.apache.xerces.dom3.as.ASModel.getAsHint.

The hint to locating an ASModel.

getAsLocationback to summary
public String getAsLocation()

Implements org.apache.xerces.dom3.as.ASModel.getAsLocation.

The URI reference.

getASModelsback to summary
public ASObjectList getASModels()

Implements org.apache.xerces.dom3.as.ASModel.getASModels.

Deprecated

as a consequence of ASObjectList being deprecated. See corresponding docs for further information.

To retrieve a list of nested ASModels without reference to names.

Returns:ASObjectList

A list of ASModels.

getAsNodeTypeback to summary
public short getAsNodeType()

Implements org.apache.xerces.dom3.as.ASObject.getAsNodeType.

A code representing the underlying object as defined above.

getAttributeDeclarationsback to summary
public ASNamedObjectMap getAttributeDeclarations()

Implements org.apache.xerces.dom3.as.ASModel.getAttributeDeclarations.

Deprecated

as a consequence of ASNamedObjectMap being deprecated. See corresponding docs for further information.

Instead of returning an all-in-one ASObject with ASModel methods, have discernible top-level/"global" attribute declarations. If one attempts to add, set, or remove a node type other than the intended one, a hierarchy exception (or equivalent is thrown).

getContainerback to summary
public boolean getContainer()

If usage is EXTERNAL_SUBSET or NOT_USED, and the ASModel is simply a container of other ASModels.

getContentModelDeclarationsback to summary
public ASNamedObjectMap getContentModelDeclarations()

Implements org.apache.xerces.dom3.as.ASModel.getContentModelDeclarations.

Deprecated

as a consequence of ASNamedObjectMap being deprecated. See corresponding docs for further information.

Instead of returning an all-in-one ASObject with ASModel methods, have discernible top-level/"global content model declarations. If one attempts to add, set, or remove a node type other than the intended one, a hierarchy exception (or equivalent is thrown).

getElementDeclarationsback to summary
public ASNamedObjectMap getElementDeclarations()

Implements org.apache.xerces.dom3.as.ASModel.getElementDeclarations.

Deprecated

as a consequence of ASNamedObjectMap being deprecated. See corresponding docs for further information.

Instead of returning an all-in-one ASObject with ASModel methods, have discernible top-level/"global" element declarations. If one attempts to add, set, or remove a node type other than the intended one, a hierarchy exception (or equivalent is thrown).

getEntityDeclarationsback to summary
public ASNamedObjectMap getEntityDeclarations()

Implements org.apache.xerces.dom3.as.ASModel.getEntityDeclarations.

Deprecated

as a consequence of ASNamedObjectMap being deprecated. See corresponding docs for further information.

Instead of returning an all-in-one ASObject with ASModel methods, have discernible top-level/"global" entity declarations. If one attempts to add, set, or remove a node type other than the intended one, a hierarchy exception (or equivalent is thrown).

getGrammarback to summary
public SchemaGrammar getGrammar()
getInternalASModelsback to summary
public Vector<E> getInternalASModels()
getIsNamespaceAwareback to summary
public boolean getIsNamespaceAware()

Implements org.apache.xerces.dom3.as.ASModel.getIsNamespaceAware.

true if this ASModel defines the document structure in terms of namespaces and local names ; false if the document structure is defined only in terms of QNames.

getLocalNameback to summary
public String getLocalName()

Implements org.apache.xerces.dom3.as.ASObject.getLocalName.

Returns the local part of the qualified name of this ASObject.

getNamespaceURIback to summary
public String getNamespaceURI()

Implements org.apache.xerces.dom3.as.ASObject.getNamespaceURI.

The namespace URI of this node, or null if it is unspecified. defines how a namespace URI is attached to schema components.

getNodeNameback to summary
public String getNodeName()

Implements org.apache.xerces.dom3.as.ASObject.getNodeName.

The name of this ASObject depending on the ASObject type.

getNotationDeclarationsback to summary
public ASNamedObjectMap getNotationDeclarations()

Implements org.apache.xerces.dom3.as.ASModel.getNotationDeclarations.

Deprecated

as a consequence of ASNamedObjectMap being deprecated. See corresponding docs for further information.

Instead of returning an all-in-one ASObject with ASModel methods, have discernible top-level/"global" notation declarations. If one attempts to add, set, or remove a node type other than the intended one, a hierarchy exception (or equivalent is thrown).

getOwnerASModelback to summary
public ASModel getOwnerASModel()

Implements org.apache.xerces.dom3.as.ASObject.getOwnerASModel.

Deprecated

as a consequence of ASModel being deprecated. See corresponding docs for further information.

The ASModel object associated with this ASObject. For a node of type AS_MODEL, this is null.

getPrefixback to summary
public String getPrefix()

Implements org.apache.xerces.dom3.as.ASObject.getPrefix.

The namespace prefix of this node, or null if it is unspecified.

getUsageLocationback to summary
public short getUsageLocation()

Implements org.apache.xerces.dom3.as.ASModel.getUsageLocation.

0 if used internally, 1 if used externally, 2 if not all. An exception will be raised if it is incompatibly shared or in use as an internal subset.

importASObjectback to summary
public void importASObject(ASObject asobject)

Deprecated

as a consequence of ASObject being deprecated. See corresponding docs for further information.

Imports ASObject into ASModel.

Parameters
asobject:ASObject

ASObject to be imported.

insertASObjectback to summary
public void insertASObject(ASObject asobject)

Deprecated

as a consequence of ASObject being deprecated. See corresponding docs for further information.

Inserts ASObject into ASModel.

Parameters
asobject:ASObject

ASObject to be inserted.

removeASback to summary
public void removeAS(ASModel as)

Implements org.apache.xerces.dom3.as.ASModel.removeAS.

Deprecated

as a consequence of ASModel being deprecated. See corresponding docs for further information.

Removes only the specified ASModel from the list of ASModels.

Parameters
as:ASModel

AS to be removed.

setAsHintback to summary
public void setAsHint(String asHint)

Implements org.apache.xerces.dom3.as.ASModel.setAsHint.

The hint to locating an ASModel.

setAsLocationback to summary
public void setAsLocation(String asLocation)

Implements org.apache.xerces.dom3.as.ASModel.setAsLocation.

The URI reference.

setGrammarback to summary
public void setGrammar(SchemaGrammar grammar)
setLocalNameback to summary
public void setLocalName(String localName)

Implements org.apache.xerces.dom3.as.ASObject.setLocalName.

Returns the local part of the qualified name of this ASObject.

setNamespaceURIback to summary
public void setNamespaceURI(String namespaceURI)

Implements org.apache.xerces.dom3.as.ASObject.setNamespaceURI.

The namespace URI of this node, or null if it is unspecified. defines how a namespace URI is attached to schema components.

setNodeNameback to summary
public void setNodeName(String nodeName)

Implements org.apache.xerces.dom3.as.ASObject.setNodeName.

The name of this ASObject depending on the ASObject type.

setOwnerASModelback to summary
public void setOwnerASModel(ASModel ownerASModel)

Implements org.apache.xerces.dom3.as.ASObject.setOwnerASModel.

Deprecated

as a consequence of ASModel being deprecated. See corresponding docs for further information.

The ASModel object associated with this ASObject. For a node of type AS_MODEL, this is null.

setPrefixback to summary
public void setPrefix(String prefix)

Implements org.apache.xerces.dom3.as.ASObject.setPrefix.

The namespace prefix of this node, or null if it is unspecified.

validateback to summary
public boolean validate()

Implements org.apache.xerces.dom3.as.ASModel.validate.

Determines if an ASModel itself is valid, i.e., confirming that it's well-formed and valid per its own formal grammar.

Returns:boolean

true if the ASModel is valid, false otherwise.