Package org.apache.xerces.dom
Class ASModelImpl
- java.lang.Object
-
- org.apache.xerces.dom.ASModelImpl
-
- All Implemented Interfaces:
org.apache.xerces.dom3.as.ASModel,org.apache.xerces.dom3.as.ASObject
public class ASModelImpl extends java.lang.Object implements org.apache.xerces.dom3.as.ASModelDeprecated.To begin with, an abstract schema is a generic structure that could contain both internal and external subsets. AnASModelis an abstract object that could map to a DTD , an XML Schema , a database schema, etc. AnASModelcould represent either an internal or an external subset; hence an abstract schema could be composed of anASModelrepresenting the internal subset and anASModelrepresenting the external subset. Note that theASModelrepresenting the external subset could consult theASModelrepresenting the internal subset. Furthermore, theASModelrepresenting the internal subset could be set to null by thesetInternalASmethod as a mechanism for "removal". In addition, only oneASModelrepresenting the external subset can be specified as "active" and it is possible that none are "active". Finally, theASModelcontains the factory methods needed to create a various types of ASObjects likeASElementDeclaration,ASAttributeDeclaration, etc.See also the Document Object Model (DOM) Level 3 Abstract Schemas and Load and Save Specification.
- Version:
- $Id: ASModelImpl.java 699892 2008-09-28 21:08:27Z mrglavas $
- Author:
- Pavani Mukthipudi, Neil Graham
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.VectorfASModelsDeprecated.protected SchemaGrammarfGrammarDeprecated.
-
Constructor Summary
Constructors Constructor Description ASModelImpl()Deprecated.ASModelImpl(boolean isNamespaceAware)Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddASModel(org.apache.xerces.dom3.as.ASModel abstractSchema)Deprecated.This method will allow the nesting or "importation" of ASModels.org.apache.xerces.dom3.as.ASObjectcloneASObject(boolean deep)Deprecated.Creates a copy of thisASObject.org.apache.xerces.dom3.as.ASAttributeDeclarationcreateASAttributeDeclaration(java.lang.String namespaceURI, java.lang.String name)Deprecated.Creates an attribute declaration.org.apache.xerces.dom3.as.ASContentModelcreateASContentModel(int minOccurs, int maxOccurs, short operator)Deprecated.Creates an object which describes part of anASElementDeclaration's content model.org.apache.xerces.dom3.as.ASElementDeclarationcreateASElementDeclaration(java.lang.String namespaceURI, java.lang.String name)Deprecated.Creates an element declaration for the element type specified.org.apache.xerces.dom3.as.ASEntityDeclarationcreateASEntityDeclaration(java.lang.String name)Deprecated.Creates an ASEntityDeclaration.org.apache.xerces.dom3.as.ASNotationDeclarationcreateASNotationDeclaration(java.lang.String namespaceURI, java.lang.String name, java.lang.String systemId, java.lang.String publicId)Deprecated.Creates a new notation declaration.java.lang.StringgetAsHint()Deprecated.The hint to locating an ASModel.java.lang.StringgetAsLocation()Deprecated.The URI reference.org.apache.xerces.dom3.as.ASObjectListgetASModels()Deprecated.To retrieve a list of nested ASModels without reference to names.shortgetAsNodeType()Deprecated.A code representing the underlying object as defined above.org.apache.xerces.dom3.as.ASNamedObjectMapgetAttributeDeclarations()Deprecated.Instead of returning an all-in-oneASObjectwithASModelmethods, have discernible top-level/"global" attribute declarations.booleangetContainer()Deprecated.Ifusageis EXTERNAL_SUBSET or NOT_USED, and theASModelis simply a container of other ASModels.org.apache.xerces.dom3.as.ASNamedObjectMapgetContentModelDeclarations()Deprecated.Instead of returning an all-in-oneASObjectwithASModelmethods, have discernible top-level/"global content model declarations.org.apache.xerces.dom3.as.ASNamedObjectMapgetElementDeclarations()Deprecated.Instead of returning an all-in-oneASObjectwithASModelmethods, have discernible top-level/"global" element declarations.org.apache.xerces.dom3.as.ASNamedObjectMapgetEntityDeclarations()Deprecated.Instead of returning an all-in-oneASObjectwithASModelmethods, have discernible top-level/"global" entity declarations.SchemaGrammargetGrammar()Deprecated.java.util.VectorgetInternalASModels()Deprecated.booleangetIsNamespaceAware()Deprecated.trueif thisASModeldefines the document structure in terms of namespaces and local names ;falseif the document structure is defined only in terms ofQNames.java.lang.StringgetLocalName()Deprecated.Returns the local part of the qualified name of thisASObject.java.lang.StringgetNamespaceURI()Deprecated.The namespace URI of this node, ornullif it is unspecified.java.lang.StringgetNodeName()Deprecated.Thenameof thisASObjectdepending on theASObjecttype.org.apache.xerces.dom3.as.ASNamedObjectMapgetNotationDeclarations()Deprecated.Instead of returning an all-in-oneASObjectwithASModelmethods, have discernible top-level/"global" notation declarations.org.apache.xerces.dom3.as.ASModelgetOwnerASModel()Deprecated.TheASModelobject associated with thisASObject.java.lang.StringgetPrefix()Deprecated.The namespace prefix of this node, ornullif it is unspecified.shortgetUsageLocation()Deprecated.0 if used internally, 1 if used externally, 2 if not all.voidimportASObject(org.apache.xerces.dom3.as.ASObject asobject)Deprecated.ImportsASObjectinto ASModel.voidinsertASObject(org.apache.xerces.dom3.as.ASObject asobject)Deprecated.InsertsASObjectinto ASModel.voidremoveAS(org.apache.xerces.dom3.as.ASModel as)Deprecated.Removes only the specifiedASModelfrom the list ofASModels.voidsetAsHint(java.lang.String asHint)Deprecated.The hint to locating an ASModel.voidsetAsLocation(java.lang.String asLocation)Deprecated.The URI reference.voidsetGrammar(SchemaGrammar grammar)Deprecated.voidsetLocalName(java.lang.String localName)Deprecated.Returns the local part of the qualified name of thisASObject.voidsetNamespaceURI(java.lang.String namespaceURI)Deprecated.The namespace URI of this node, ornullif it is unspecified.voidsetNodeName(java.lang.String nodeName)Deprecated.Thenameof thisASObjectdepending on theASObjecttype.voidsetOwnerASModel(org.apache.xerces.dom3.as.ASModel ownerASModel)Deprecated.TheASModelobject associated with thisASObject.voidsetPrefix(java.lang.String prefix)Deprecated.The namespace prefix of this node, ornullif it is unspecified.booleanvalidate()Deprecated.Determines if anASModelitself is valid, i.e., confirming that it's well-formed and valid per its own formal grammar.
-
-
-
Field Detail
-
fASModels
protected java.util.Vector fASModels
Deprecated.
-
fGrammar
protected SchemaGrammar fGrammar
Deprecated.
-
-
Method Detail
-
getAsNodeType
public short getAsNodeType()
Deprecated.A code representing the underlying object as defined above.- Specified by:
getAsNodeTypein interfaceorg.apache.xerces.dom3.as.ASObject
-
getOwnerASModel
public org.apache.xerces.dom3.as.ASModel getOwnerASModel()
Deprecated.TheASModelobject associated with thisASObject. For a node of typeAS_MODEL, this isnull.- Specified by:
getOwnerASModelin interfaceorg.apache.xerces.dom3.as.ASObject
-
setOwnerASModel
public void setOwnerASModel(org.apache.xerces.dom3.as.ASModel ownerASModel)
Deprecated.TheASModelobject associated with thisASObject. For a node of typeAS_MODEL, this isnull.- Specified by:
setOwnerASModelin interfaceorg.apache.xerces.dom3.as.ASObject
-
getNodeName
public java.lang.String getNodeName()
Deprecated.Thenameof thisASObjectdepending on theASObjecttype.- Specified by:
getNodeNamein interfaceorg.apache.xerces.dom3.as.ASObject
-
setNodeName
public void setNodeName(java.lang.String nodeName)
Deprecated.Thenameof thisASObjectdepending on theASObjecttype.- Specified by:
setNodeNamein interfaceorg.apache.xerces.dom3.as.ASObject
-
getPrefix
public java.lang.String getPrefix()
Deprecated.The namespace prefix of this node, ornullif it is unspecified.- Specified by:
getPrefixin interfaceorg.apache.xerces.dom3.as.ASObject
-
setPrefix
public void setPrefix(java.lang.String prefix)
Deprecated.The namespace prefix of this node, ornullif it is unspecified.- Specified by:
setPrefixin interfaceorg.apache.xerces.dom3.as.ASObject
-
getLocalName
public java.lang.String getLocalName()
Deprecated.Returns the local part of the qualified name of thisASObject.- Specified by:
getLocalNamein interfaceorg.apache.xerces.dom3.as.ASObject
-
setLocalName
public void setLocalName(java.lang.String localName)
Deprecated.Returns the local part of the qualified name of thisASObject.- Specified by:
setLocalNamein interfaceorg.apache.xerces.dom3.as.ASObject
-
getNamespaceURI
public java.lang.String getNamespaceURI()
Deprecated.The namespace URI of this node, ornullif it is unspecified. defines how a namespace URI is attached to schema components.- Specified by:
getNamespaceURIin interfaceorg.apache.xerces.dom3.as.ASObject
-
setNamespaceURI
public void setNamespaceURI(java.lang.String namespaceURI)
Deprecated.The namespace URI of this node, ornullif it is unspecified. defines how a namespace URI is attached to schema components.- Specified by:
setNamespaceURIin interfaceorg.apache.xerces.dom3.as.ASObject
-
cloneASObject
public org.apache.xerces.dom3.as.ASObject cloneASObject(boolean deep)
Deprecated.Creates a copy of thisASObject. See text forcloneNodeoff ofNodebut substitute AS functionality.- Specified by:
cloneASObjectin interfaceorg.apache.xerces.dom3.as.ASObject- Parameters:
deep- Setting thedeepflag on, causes the whole subtree to be duplicated. Setting it tofalseonly duplicates its immediate child nodes.- Returns:
- Cloned
ASObject.
-
getIsNamespaceAware
public boolean getIsNamespaceAware()
Deprecated.trueif thisASModeldefines the document structure in terms of namespaces and local names ;falseif the document structure is defined only in terms ofQNames.- Specified by:
getIsNamespaceAwarein interfaceorg.apache.xerces.dom3.as.ASModel
-
getUsageLocation
public short getUsageLocation()
Deprecated.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.- Specified by:
getUsageLocationin interfaceorg.apache.xerces.dom3.as.ASModel
-
getAsLocation
public java.lang.String getAsLocation()
Deprecated.The URI reference.- Specified by:
getAsLocationin interfaceorg.apache.xerces.dom3.as.ASModel
-
setAsLocation
public void setAsLocation(java.lang.String asLocation)
Deprecated.The URI reference.- Specified by:
setAsLocationin interfaceorg.apache.xerces.dom3.as.ASModel
-
getAsHint
public java.lang.String getAsHint()
Deprecated.The hint to locating an ASModel.- Specified by:
getAsHintin interfaceorg.apache.xerces.dom3.as.ASModel
-
setAsHint
public void setAsHint(java.lang.String asHint)
Deprecated.The hint to locating an ASModel.- Specified by:
setAsHintin interfaceorg.apache.xerces.dom3.as.ASModel
-
getContainer
public boolean getContainer()
Deprecated.Ifusageis EXTERNAL_SUBSET or NOT_USED, and theASModelis simply a container of other ASModels.
-
getElementDeclarations
public org.apache.xerces.dom3.as.ASNamedObjectMap getElementDeclarations()
Deprecated.Instead of returning an all-in-oneASObjectwithASModelmethods, 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).- Specified by:
getElementDeclarationsin interfaceorg.apache.xerces.dom3.as.ASModel
-
getAttributeDeclarations
public org.apache.xerces.dom3.as.ASNamedObjectMap getAttributeDeclarations()
Deprecated.Instead of returning an all-in-oneASObjectwithASModelmethods, 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).- Specified by:
getAttributeDeclarationsin interfaceorg.apache.xerces.dom3.as.ASModel
-
getNotationDeclarations
public org.apache.xerces.dom3.as.ASNamedObjectMap getNotationDeclarations()
Deprecated.Instead of returning an all-in-oneASObjectwithASModelmethods, 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).- Specified by:
getNotationDeclarationsin interfaceorg.apache.xerces.dom3.as.ASModel
-
getEntityDeclarations
public org.apache.xerces.dom3.as.ASNamedObjectMap getEntityDeclarations()
Deprecated.Instead of returning an all-in-oneASObjectwithASModelmethods, 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).- Specified by:
getEntityDeclarationsin interfaceorg.apache.xerces.dom3.as.ASModel
-
getContentModelDeclarations
public org.apache.xerces.dom3.as.ASNamedObjectMap getContentModelDeclarations()
Deprecated.Instead of returning an all-in-oneASObjectwithASModelmethods, 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).- Specified by:
getContentModelDeclarationsin interfaceorg.apache.xerces.dom3.as.ASModel
-
addASModel
public void addASModel(org.apache.xerces.dom3.as.ASModel abstractSchema)
Deprecated.This method will allow the nesting or "importation" of ASModels.- Specified by:
addASModelin interfaceorg.apache.xerces.dom3.as.ASModel- Parameters:
abstractSchema- ASModel to be set. Subsequent calls will nest the ASModels within the specifiedownerASModel.
-
getASModels
public org.apache.xerces.dom3.as.ASObjectList getASModels()
Deprecated.To retrieve a list of nested ASModels without reference to names.- Specified by:
getASModelsin interfaceorg.apache.xerces.dom3.as.ASModel- Returns:
- A list of ASModels.
-
removeAS
public void removeAS(org.apache.xerces.dom3.as.ASModel as)
Deprecated.Removes only the specifiedASModelfrom the list ofASModels.- Specified by:
removeASin interfaceorg.apache.xerces.dom3.as.ASModel- Parameters:
as- AS to be removed.
-
validate
public boolean validate()
Deprecated.Determines if anASModelitself is valid, i.e., confirming that it's well-formed and valid per its own formal grammar.- Specified by:
validatein interfaceorg.apache.xerces.dom3.as.ASModel- Returns:
trueif theASModelis valid,falseotherwise.
-
importASObject
public void importASObject(org.apache.xerces.dom3.as.ASObject asobject)
Deprecated.ImportsASObjectinto ASModel.- Parameters:
asobject-ASObjectto be imported.
-
insertASObject
public void insertASObject(org.apache.xerces.dom3.as.ASObject asobject)
Deprecated.InsertsASObjectinto ASModel.- Parameters:
asobject-ASObjectto be inserted.
-
createASElementDeclaration
public org.apache.xerces.dom3.as.ASElementDeclaration createASElementDeclaration(java.lang.String namespaceURI, java.lang.String name) throws org.w3c.dom.DOMExceptionDeprecated.Creates an element declaration for the element type specified.- Specified by:
createASElementDeclarationin interfaceorg.apache.xerces.dom3.as.ASModel- Parameters:
namespaceURI- Thenamespace URIof the element type being declared.name- 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:
- A new
ASElementDeclarationobject withnameattribute set totagnameandnamespaceURIset tosystemId. Other attributes of the element declaration are set throughASElementDeclarationinterface methods. - Throws:
org.w3c.dom.DOMException- INVALID_CHARACTER_ERR: Raised if the specified name contains an illegal character.
-
createASAttributeDeclaration
public org.apache.xerces.dom3.as.ASAttributeDeclaration createASAttributeDeclaration(java.lang.String namespaceURI, java.lang.String name) throws org.w3c.dom.DOMExceptionDeprecated.Creates an attribute declaration.- Specified by:
createASAttributeDeclarationin interfaceorg.apache.xerces.dom3.as.ASModel- Parameters:
namespaceURI- The namespace URI of the attribute being declared.name- 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:
- A new
ASAttributeDeclarationobject with appropriate attributes set by input parameters. - Throws:
org.w3c.dom.DOMException- INVALID_CHARACTER_ERR: Raised if the inputnameparameter contains an illegal character.
-
createASNotationDeclaration
public org.apache.xerces.dom3.as.ASNotationDeclaration createASNotationDeclaration(java.lang.String namespaceURI, java.lang.String name, java.lang.String systemId, java.lang.String publicId) throws org.w3c.dom.DOMExceptionDeprecated.Creates a new notation declaration.- Specified by:
createASNotationDeclarationin interfaceorg.apache.xerces.dom3.as.ASModel- Parameters:
namespaceURI- The namespace URI of the notation being declared.name- 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- The system identifier for the notation declaration.publicId- The public identifier for the notation declaration.- Returns:
- A new
ASNotationDeclarationobject withnotationNameattribute set tonameandpublicIdandsystemIdset to the corresponding fields. - Throws:
org.w3c.dom.DOMException- INVALID_CHARACTER_ERR: Raised if the specified name contains an illegal character.
-
createASEntityDeclaration
public org.apache.xerces.dom3.as.ASEntityDeclaration createASEntityDeclaration(java.lang.String name) throws org.w3c.dom.DOMExceptionDeprecated.Creates an ASEntityDeclaration.- Specified by:
createASEntityDeclarationin interfaceorg.apache.xerces.dom3.as.ASModel- Parameters:
name- The name of the entity being declared.- Returns:
- A new
ASEntityDeclarationobject withentityNameattribute set to name. - Throws:
org.w3c.dom.DOMException- INVALID_CHARACTER_ERR: Raised if the specified name contains an illegal character.
-
createASContentModel
public org.apache.xerces.dom3.as.ASContentModel createASContentModel(int minOccurs, int maxOccurs, short operator) throws org.apache.xerces.dom3.as.DOMASExceptionDeprecated.Creates an object which describes part of anASElementDeclaration's content model.- Specified by:
createASContentModelin interfaceorg.apache.xerces.dom3.as.ASModel- Parameters:
minOccurs- The minimum occurrence for the subModels of thisASContentModel.maxOccurs- The maximum occurrence for the subModels of thisASContentModel.operator- operator of typeAS_CHOICE,AS_SEQUENCE,AS_ALLorAS_NONE.- Returns:
- A new
ASContentModelobject. - Throws:
org.apache.xerces.dom3.as.DOMASException- A DOMASException, e.g.,minOccurs > maxOccurs.
-
getGrammar
public SchemaGrammar getGrammar()
Deprecated.
-
setGrammar
public void setGrammar(SchemaGrammar grammar)
Deprecated.
-
getInternalASModels
public java.util.Vector getInternalASModels()
Deprecated.
-
-