FileDocCategorySizeDatePackage
ASModelImpl.javaAPI DocJava SE 5 API22712Fri Aug 26 14:55:42 BST 2005com.sun.org.apache.xerces.internal.dom

ASModelImpl

public class ASModelImpl extends Object implements 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.

deprecated
author
Pavani Mukthipudi
author
Neil Graham
version
$Id: ASModelImpl.java,v 1.5 2003/03/24 20:27:12 elena Exp $

Fields Summary
boolean
fNamespaceAware
protected Vector
fASModels
protected SchemaGrammar
fGrammar
Constructors Summary
public ASModelImpl()

    
    //
    // Constructors
    //
    
      
    	fASModels = new Vector();
    
public ASModelImpl(boolean isNamespaceAware)

    	fASModels = new Vector();
        fNamespaceAware = isNamespaceAware;
    
Methods Summary
public voidaddASModel(ASModel abstractSchema)
This method will allow the nesting or "importation" of ASModels.

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

    	fASModels.addElement(abstractSchema);
    
public ASObjectcloneASObject(boolean deep)
Creates a copy of this ASObject. See text for cloneNode off of Node but substitute AS functionality.

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

        String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_SUPPORTED_ERR", null);
        throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
    
public ASAttributeDeclarationcreateASAttributeDeclaration(java.lang.String namespaceURI, java.lang.String name)
Creates an attribute declaration.

param
namespaceURI The namespace URI of the attribute being declared.
param
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.
return
A new ASAttributeDeclaration object with appropriate attributes set by input parameters.
exception
DOMException INVALID_CHARACTER_ERR: Raised if the input name parameter contains an illegal character.

        String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_SUPPORTED_ERR", null);
        throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
    
public ASContentModelcreateASContentModel(int minOccurs, int maxOccurs, short operator)
Creates an object which describes part of an ASElementDeclaration's content model.

param
minOccurs The minimum occurrence for the subModels of this ASContentModel.
param
maxOccurs The maximum occurrence for the subModels of this ASContentModel.
param
operator operator of type AS_CHOICE, AS_SEQUENCE, AS_ALL or AS_NONE.
return
A new ASContentModel object.
exception
DOMASException A DOMASException, e.g., minOccurs > maxOccurs.

        String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_SUPPORTED_ERR", null);
        throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
    
public ASElementDeclarationcreateASElementDeclaration(java.lang.String namespaceURI, java.lang.String name)
Creates an element declaration for the element type specified.

param
namespaceURI The namespace URI of the element type being declared.
param
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.
return
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.
exception
DOMException INVALID_CHARACTER_ERR: Raised if the specified name contains an illegal character.

        String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_SUPPORTED_ERR", null);
        throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
    
public ASEntityDeclarationcreateASEntityDeclaration(java.lang.String name)
Creates an ASEntityDeclaration.

param
name The name of the entity being declared.
return
A new ASEntityDeclaration object with entityName attribute set to name.
exception
DOMException INVALID_CHARACTER_ERR: Raised if the specified name contains an illegal character.

        String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_SUPPORTED_ERR", null);
        throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
    
public ASNotationDeclarationcreateASNotationDeclaration(java.lang.String namespaceURI, java.lang.String name, java.lang.String systemId, java.lang.String publicId)
Creates a new notation declaration.

param
namespaceURI The namespace URI of the notation being declared.
param
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.
param
systemId The system identifier for the notation declaration.
param
publicId The public identifier for the notation declaration.
return
A new ASNotationDeclaration object with notationName attribute set to name and publicId and systemId set to the corresponding fields.
exception
DOMException INVALID_CHARACTER_ERR: Raised if the specified name contains an illegal character.

        String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_SUPPORTED_ERR", null);
        throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
    
public ASObjectListgetASModels()
To retrieve a list of nested ASModels without reference to names.

return
A list of ASModels.

        String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_SUPPORTED_ERR", null);
        throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
    
public java.lang.StringgetAsHint()
The hint to locating an ASModel.

        String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_SUPPORTED_ERR", null);
        throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
    
public java.lang.StringgetAsLocation()
The URI reference.

        String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_SUPPORTED_ERR", null);
        throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
    
public shortgetAsNodeType()
A code representing the underlying object as defined above.

        String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_SUPPORTED_ERR", null);
        throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
    
public ASNamedObjectMapgetAttributeDeclarations()
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).

        String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_SUPPORTED_ERR", null);
        throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
    
public booleangetContainer()
If usage is EXTERNAL_SUBSET or NOT_USED, and the ASModel is simply a container of other ASModels.

    	return (fGrammar != null);
    
public ASNamedObjectMapgetContentModelDeclarations()
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).

        String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_SUPPORTED_ERR", null);
        throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
    
public ASNamedObjectMapgetElementDeclarations()
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).

        String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_SUPPORTED_ERR", null);
        throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
    
public ASNamedObjectMapgetEntityDeclarations()
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).

        String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_SUPPORTED_ERR", null);
        throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
    
public com.sun.org.apache.xerces.internal.impl.xs.SchemaGrammargetGrammar()

        return fGrammar;
    
public java.util.VectorgetInternalASModels()

        return fASModels;
    
public booleangetIsNamespaceAware()
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.

    	return fNamespaceAware;
    
public java.lang.StringgetLocalName()
Returns the local part of the qualified name of this ASObject.

        String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_SUPPORTED_ERR", null);
        throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
    
public java.lang.StringgetNamespaceURI()
The namespace URI of this node, or null if it is unspecified. defines how a namespace URI is attached to schema components.

        String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_SUPPORTED_ERR", null);
        throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
    
public java.lang.StringgetNodeName()
The name of this ASObject depending on the ASObject type.

        String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_SUPPORTED_ERR", null);
        throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
    
public ASNamedObjectMapgetNotationDeclarations()
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).

        String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_SUPPORTED_ERR", null);
        throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
    
public ASModelgetOwnerASModel()
The ASModel object associated with this ASObject. For a node of type AS_MODEL, this is null.

        String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_SUPPORTED_ERR", null);
        throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
    
public java.lang.StringgetPrefix()
The namespace prefix of this node, or null if it is unspecified.

        String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_SUPPORTED_ERR", null);
        throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
    
public shortgetUsageLocation()
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.

        String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_SUPPORTED_ERR", null);
        throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
    
public voidimportASObject(ASObject asobject)
Imports ASObject into ASModel.

param
asobject ASObject to be imported.

        String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_SUPPORTED_ERR", null);
        throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
    
public voidinsertASObject(ASObject asobject)
Inserts ASObject into ASModel.

param
asobject ASObject to be inserted.

        String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_SUPPORTED_ERR", null);
        throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
    
public voidremoveAS(ASModel as)
Removes only the specified ASModel from the list of ASModels.

param
as AS to be removed.

    	fASModels.removeElement(as);
    
public voidsetAsHint(java.lang.String asHint)
The hint to locating an ASModel.

        String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_SUPPORTED_ERR", null);
        throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
    
public voidsetAsLocation(java.lang.String asLocation)
The URI reference.

        String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_SUPPORTED_ERR", null);
        throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
    
public voidsetGrammar(com.sun.org.apache.xerces.internal.impl.xs.SchemaGrammar grammar)

        fGrammar = grammar;
    
public voidsetLocalName(java.lang.String localName)
Returns the local part of the qualified name of this ASObject.

        String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_SUPPORTED_ERR", null);
        throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
    
public voidsetNamespaceURI(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.

        String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_SUPPORTED_ERR", null);
        throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
    
public voidsetNodeName(java.lang.String nodeName)
The name of this ASObject depending on the ASObject type.

        String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_SUPPORTED_ERR", null);
        throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
    
public voidsetOwnerASModel(ASModel ownerASModel)
The ASModel object associated with this ASObject. For a node of type AS_MODEL, this is null.

        String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_SUPPORTED_ERR", null);
        throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
    
public voidsetPrefix(java.lang.String prefix)
The namespace prefix of this node, or null if it is unspecified.

        String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_SUPPORTED_ERR", null);
        throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
    
public booleanvalidate()
Determines if an ASModel itself is valid, i.e., confirming that it's well-formed and valid per its own formal grammar.

return
true if the ASModel is valid, false otherwise.

        String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_SUPPORTED_ERR", null);
        throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);