BEA Systems, Inc.

WebLogic Server 8.1 API Reference

weblogic.apache.xerces.dom
Class ASModelImpl

java.lang.Object
  |
  +--weblogic.apache.xerces.dom.ASModelImpl

public class ASModelImpl
extends java.lang.Object
implements org.apache.xerces.dom3.as.ASModel

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.


Field Summary
protected  java.util.Vector fASModels
           
protected  SchemaGrammar fGrammar
           
 
Constructor Summary
ASModelImpl()
           
ASModelImpl(boolean isNamespaceAware)
           
 
Method Summary
 void addASModel(org.apache.xerces.dom3.as.ASModel abstractSchema)
          This method will allow the nesting or "importation" of ASModels.
 org.apache.xerces.dom3.as.ASObject cloneASObject(boolean deep)
          Creates a copy of this ASObject.
 org.apache.xerces.dom3.as.ASAttributeDeclaration createASAttributeDeclaration(java.lang.String namespaceURI, java.lang.String name)
          Creates an attribute declaration.
 org.apache.xerces.dom3.as.ASContentModel createASContentModel(int minOccurs, int maxOccurs, short operator)
          Creates an object which describes part of an ASElementDeclaration's content model.
 org.apache.xerces.dom3.as.ASElementDeclaration createASElementDeclaration(java.lang.String namespaceURI, java.lang.String name)
          Creates an element declaration for the element type specified.
 org.apache.xerces.dom3.as.ASEntityDeclaration createASEntityDeclaration(java.lang.String name)
          Creates an ASEntityDeclaration.
 org.apache.xerces.dom3.as.ASNotationDeclaration createASNotationDeclaration(java.lang.String namespaceURI, java.lang.String name, java.lang.String systemId, java.lang.String publicId)
          Creates a new notation declaration.
 java.lang.String getAsHint()
          The hint to locating an ASModel.
 java.lang.String getAsLocation()
          The URI reference.
 org.apache.xerces.dom3.as.ASObjectList getASModels()
          To retrieve a list of nested ASModels without reference to names.
 short getAsNodeType()
          A code representing the underlying object as defined above.
 org.apache.xerces.dom3.as.ASNamedObjectMap getAttributeDeclarations()
          Instead of returning an all-in-one ASObject with ASModel methods, have discernible top-level/"global" attribute declarations.
 boolean getContainer()
          If usage is EXTERNAL_SUBSET or NOT_USED, and the ASModel is simply a container of other ASModels.
 org.apache.xerces.dom3.as.ASNamedObjectMap getContentModelDeclarations()
          Instead of returning an all-in-one ASObject with ASModel methods, have discernible top-level/"global content model declarations.
 org.apache.xerces.dom3.as.ASNamedObjectMap getElementDeclarations()
          Instead of returning an all-in-one ASObject with ASModel methods, have discernible top-level/"global" element declarations.
 org.apache.xerces.dom3.as.ASNamedObjectMap getEntityDeclarations()
          Instead of returning an all-in-one ASObject with ASModel methods, have discernible top-level/"global" entity declarations.
 SchemaGrammar getGrammar()
           
 java.util.Vector getInternalASModels()
           
 boolean 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.
 java.lang.String getLocalName()
          Returns the local part of the qualified name of this ASObject.
 java.lang.String getNamespaceURI()
          The namespace URI of this node, or null if it is unspecified.
 java.lang.String getNodeName()
          The name of this ASObject depending on the ASObject type.
 org.apache.xerces.dom3.as.ASNamedObjectMap getNotationDeclarations()
          Instead of returning an all-in-one ASObject with ASModel methods, have discernible top-level/"global" notation declarations.
 org.apache.xerces.dom3.as.ASModel getOwnerASModel()
          The ASModel object associated with this ASObject.
 java.lang.String getPrefix()
          The namespace prefix of this node, or null if it is unspecified.
 short getUsageLocation()
          0 if used internally, 1 if used externally, 2 if not all.
 void importASObject(org.apache.xerces.dom3.as.ASObject asobject)
          Imports ASObject into ASModel.
 void insertASObject(org.apache.xerces.dom3.as.ASObject asobject)
          Inserts ASObject into ASModel.
 void removeAS(org.apache.xerces.dom3.as.ASModel as)
          Removes only the specified ASModel from the list of ASModels.
 void setAsHint(java.lang.String asHint)
          The hint to locating an ASModel.
 void setAsLocation(java.lang.String asLocation)
          The URI reference.
 void setGrammar(SchemaGrammar grammar)
           
 void setLocalName(java.lang.String localName)
          Returns the local part of the qualified name of this ASObject.
 void setNamespaceURI(java.lang.String namespaceURI)
          The namespace URI of this node, or null if it is unspecified.
 void setNodeName(java.lang.String nodeName)
          The name of this ASObject depending on the ASObject type.
 void setOwnerASModel(org.apache.xerces.dom3.as.ASModel ownerASModel)
          The ASModel object associated with this ASObject.
 void setPrefix(java.lang.String prefix)
          The namespace prefix of this node, or null if it is unspecified.
 boolean validate()
          Determines if an ASModel itself is valid, i.e., confirming that it's well-formed and valid per its own formal grammar.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fASModels

protected java.util.Vector fASModels

fGrammar

protected SchemaGrammar fGrammar
Constructor Detail

ASModelImpl

public ASModelImpl()

ASModelImpl

public ASModelImpl(boolean isNamespaceAware)
Method Detail

getAsNodeType

public short getAsNodeType()
A code representing the underlying object as defined above.


getOwnerASModel

public org.apache.xerces.dom3.as.ASModel getOwnerASModel()
The ASModel object associated with this ASObject. For a node of type AS_MODEL, this is null.


setOwnerASModel

public void setOwnerASModel(org.apache.xerces.dom3.as.ASModel ownerASModel)
The ASModel object associated with this ASObject. For a node of type AS_MODEL, this is null.


getNodeName

public java.lang.String getNodeName()
The name of this ASObject depending on the ASObject type.


setNodeName

public void setNodeName(java.lang.String nodeName)
The name of this ASObject depending on the ASObject type.


getPrefix

public java.lang.String getPrefix()
The namespace prefix of this node, or null if it is unspecified.


setPrefix

public void setPrefix(java.lang.String prefix)
The namespace prefix of this node, or null if it is unspecified.


getLocalName

public java.lang.String getLocalName()
Returns the local part of the qualified name of this ASObject.


setLocalName

public void setLocalName(java.lang.String localName)
Returns the local part of the qualified name of this ASObject.


getNamespaceURI

public java.lang.String getNamespaceURI()
The namespace URI of this node, or null if it is unspecified. defines how a namespace URI is attached to schema components.


setNamespaceURI

public void setNamespaceURI(java.lang.String namespaceURI)
The namespace URI of this node, or null if it is unspecified. defines how a namespace URI is attached to schema components.


cloneASObject

public org.apache.xerces.dom3.as.ASObject cloneASObject(boolean deep)
Creates a copy of this ASObject. See text for cloneNode off of Node but substitute AS functionality.

Parameters:
deep - Setting the deep flag on, causes the whole subtree to be duplicated. Setting it to false only duplicates its immediate child nodes.
Returns:
Cloned ASObject.

getIsNamespaceAware

public boolean 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.
Specified by:
getIsNamespaceAware in interface org.apache.xerces.dom3.as.ASModel


getUsageLocation

public short 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.
Specified by:
getUsageLocation in interface org.apache.xerces.dom3.as.ASModel


getAsLocation

public java.lang.String getAsLocation()
The URI reference.
Specified by:
getAsLocation in interface org.apache.xerces.dom3.as.ASModel


setAsLocation

public void setAsLocation(java.lang.String asLocation)
The URI reference.
Specified by:
setAsLocation in interface org.apache.xerces.dom3.as.ASModel


getAsHint

public java.lang.String getAsHint()
The hint to locating an ASModel.
Specified by:
getAsHint in interface org.apache.xerces.dom3.as.ASModel


setAsHint

public void setAsHint(java.lang.String asHint)
The hint to locating an ASModel.
Specified by:
setAsHint in interface org.apache.xerces.dom3.as.ASModel


getContainer

public boolean getContainer()
If usage is EXTERNAL_SUBSET or NOT_USED, and the ASModel is simply a container of other ASModels.


getElementDeclarations

public org.apache.xerces.dom3.as.ASNamedObjectMap getElementDeclarations()
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).
Specified by:
getElementDeclarations in interface org.apache.xerces.dom3.as.ASModel


getAttributeDeclarations

public org.apache.xerces.dom3.as.ASNamedObjectMap getAttributeDeclarations()
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).
Specified by:
getAttributeDeclarations in interface org.apache.xerces.dom3.as.ASModel


getNotationDeclarations

public org.apache.xerces.dom3.as.ASNamedObjectMap getNotationDeclarations()
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).
Specified by:
getNotationDeclarations in interface org.apache.xerces.dom3.as.ASModel


getEntityDeclarations

public org.apache.xerces.dom3.as.ASNamedObjectMap getEntityDeclarations()
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).
Specified by:
getEntityDeclarations in interface org.apache.xerces.dom3.as.ASModel


getContentModelDeclarations

public org.apache.xerces.dom3.as.ASNamedObjectMap getContentModelDeclarations()
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).
Specified by:
getContentModelDeclarations in interface org.apache.xerces.dom3.as.ASModel


addASModel

public void addASModel(org.apache.xerces.dom3.as.ASModel abstractSchema)
This method will allow the nesting or "importation" of ASModels.
Specified by:
addASModel in interface org.apache.xerces.dom3.as.ASModel

Parameters:
abstractSchema - ASModel to be set. Subsequent calls will nest the ASModels within the specified ownerASModel.

getASModels

public org.apache.xerces.dom3.as.ASObjectList getASModels()
To retrieve a list of nested ASModels without reference to names.
Specified by:
getASModels in interface org.apache.xerces.dom3.as.ASModel

Returns:
A list of ASModels.

removeAS

public void removeAS(org.apache.xerces.dom3.as.ASModel as)
Removes only the specified ASModel from the list of ASModels.
Specified by:
removeAS in interface org.apache.xerces.dom3.as.ASModel

Parameters:
as - AS to be removed.

validate

public boolean validate()
Determines if an ASModel itself is valid, i.e., confirming that it's well-formed and valid per its own formal grammar.
Specified by:
validate in interface org.apache.xerces.dom3.as.ASModel

Returns:
true if the ASModel is valid, false otherwise.

importASObject

public void importASObject(org.apache.xerces.dom3.as.ASObject asobject)
Imports ASObject into ASModel.

Parameters:
asobject - ASObject to be imported.

insertASObject

public void insertASObject(org.apache.xerces.dom3.as.ASObject asobject)
Inserts ASObject into ASModel.

Parameters:
asobject - ASObject to be inserted.

createASElementDeclaration

public org.apache.xerces.dom3.as.ASElementDeclaration createASElementDeclaration(java.lang.String namespaceURI,
                                                                                 java.lang.String name)
                                                                          throws org.w3c.dom.DOMException
Creates an element declaration for the element type specified.
Specified by:
createASElementDeclaration in interface org.apache.xerces.dom3.as.ASModel

Parameters:
namespaceURI - The namespace URI of 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 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.
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.DOMException
Creates an attribute declaration.
Specified by:
createASAttributeDeclaration in interface org.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 ASAttributeDeclaration object with appropriate attributes set by input parameters.
Throws:
org.w3c.dom.DOMException - INVALID_CHARACTER_ERR: Raised if the input name parameter 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.DOMException
Creates a new notation declaration.
Specified by:
createASNotationDeclaration in interface org.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 ASNotationDeclaration object with notationName attribute set to name and publicId and systemId set 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.DOMException
Creates an ASEntityDeclaration.
Specified by:
createASEntityDeclaration in interface org.apache.xerces.dom3.as.ASModel

Parameters:
name - The name of the entity being declared.
Returns:
A new ASEntityDeclaration object with entityName attribute 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.DOMASException
Creates an object which describes part of an ASElementDeclaration's content model.
Specified by:
createASContentModel in interface org.apache.xerces.dom3.as.ASModel

Parameters:
minOccurs - The minimum occurrence for the subModels of this ASContentModel.
maxOccurs - The maximum occurrence for the subModels of this ASContentModel.
operator - operator of type AS_CHOICE, AS_SEQUENCE, AS_ALL or AS_NONE.
Returns:
A new ASContentModel object.
Throws:
org.apache.xerces.dom3.as.DOMASException - A DOMASException, e.g., minOccurs > maxOccurs.

getGrammar

public SchemaGrammar getGrammar()


setGrammar

public void setGrammar(SchemaGrammar grammar)


getInternalASModels

public java.util.Vector getInternalASModels()


Documentation is available at
http://download.oracle.com/docs/cd/E13222_01/wls/docs81