Qizx/open API

net.axyana.qizxopen.dm
Class IDocument

java.lang.Object
  extended byorg.xml.sax.helpers.DefaultHandler
      extended bynet.axyana.qizxopen.dm.DocumentWriter
          extended bynet.axyana.qizxopen.dm.IDocument
All Implemented Interfaces:
org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler, FONIDocument, org.xml.sax.ext.LexicalHandler, java.rmi.Remote

public class IDocument
extends DocumentWriter
implements FONIDocument

A fast and memory efficient FONIDocument implementation for parsed documents. After construction it is readonly and thread safe.


Constructor Summary
IDocument()
           
 
Method Summary
 void characters(char[] ch, int start, int length)
           
 void characters(java.lang.String chars)
           
 void close()
          Terminates creation of a document (required).
 void comment(char[] ch, int start, int length)
           
 void endCDATA()
           
 void endDocument()
           
 void endElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName)
           
 void endEntity(java.lang.String name)
           
 void endPrefixMapping(java.lang.String prefix)
           
 int estimateMemorySize()
          Cache management.
 int getAttrCount(int nodeId)
          Returns the number of attributes of an element (not guaranteed to be efficient).
 int getAttribute(int nodeId, int nameId)
          Gets an attribute node by name.
 char[] getCharValue(int nodeId, int reserve)
          Specially meant for indexing: gets the string value of a text node.
 int getCurrentNode()
           
 int getDefinedNSCount(int nodeId)
          Returns the number of NS defined on this node.
 QName getElementName(int nameId)
          Gets the QName of an element node by the internal id.
 int getElementNameCount()
          Gets the total number of element names.
 int getFirstChild(int nodeId)
           
 int getFirstNSNode(int nodeId, boolean inScope)
          Returns the first namespace node of a node.
 long getIntegerValue(int nodeId)
          Gets an integer value from an atome of type ATOM_INT.
 int getKind(int nodeId)
          Returns one of the kinds DOCUMENT, ELEMENT, TEXT, PROCESSING_INSTRUCTION, COMMENT, ATTRIBUTE, NAMESPACE, ATOM_XX.
 QName getName(int nodeId)
          Gets the name of a Node.
 int getNameId(int offset)
          Gets the name-id of a real Node.
 int getNextSibling(int nodeId)
           
 int getNodeAfter(int nodeId)
          Gets the node that is next in document order but not contained.
 int getNodeNext(int nodeId)
          Gets the node that is next in document order.
 int getNodeSpan(int nodeId)
           
 QName getOtherName(int nameId)
          Gets the QName of a non-element node by the internal id.
 int getOtherNameCount()
          Gets the total number of non-element node names.
 int getParent(int nodeId)
           
 int getRootNode()
          Returns the handle of the document node.
 java.lang.String getStringValue(int nodeId)
          Gets the string value for any node but Attributes and Namespaces.
 java.lang.Object getValue(int nodeId)
          Gets an atomic value from a leaf node.
 int internElementName(QName name)
          Gets the internal id of an element name.
 int internOtherName(QName name)
          Gets the internal id of a non-element node name.
 boolean isExported()
           
 char[] pnGetCharValue(int nodeId, int reserve)
          Specially meant for indexing: gets the string value of a "pseudo-node" (attribute or NS).
 QName pnGetName(int nodeId)
          Gets the name of a pseudo Node Attribute / Namespace.
 int pnGetNameId(int nodeId)
          Gets the name-id of a pseudo-node Attribute / Namespace.
 int pnGetNext(int nodeId)
          Returns the next pseudo-node (attribute or NS).
 java.lang.String pnGetStringValue(int nodeId)
          Gets the string value for pseudo-nodes Attributes and Namespaces.
 void processingInstruction(java.lang.String target, java.lang.String data)
           
 void skippedEntity(java.lang.String name)
           
 void startCDATA()
           
 void startElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes attrs)
           
 void startEntity(java.lang.String name)
           
 void startPrefixMapping(java.lang.String prefix, java.lang.String uri)
           
 RemoteByteInput transmitNode(Node node)
           
 
Methods inherited from class net.axyana.qizxopen.dm.DocumentWriter
atom, endDTD, getBaseURI, getDocumentId, getDtdName, getDtdPublicId, getDtdSystemid, setDocumentId, setDocumentLocator, startDocument, startDTD
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
error, fatalError, ignorableWhitespace, notationDecl, resolveEntity, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.axyana.qizxopen.dm.FONIDocument
getBaseURI, getDocumentId, setDocumentId
 

Constructor Detail

IDocument

public IDocument()
Method Detail

transmitNode

public RemoteByteInput transmitNode(Node node)
                             throws DataModelException,
                                    java.io.IOException
Specified by:
transmitNode in interface FONIDocument
Throws:
DataModelException
java.io.IOException

getRootNode

public int getRootNode()
Description copied from interface: FONIDocument
Returns the handle of the document node.

Specified by:
getRootNode in interface FONIDocument

getKind

public int getKind(int nodeId)
Description copied from interface: FONIDocument
Returns one of the kinds DOCUMENT, ELEMENT, TEXT, PROCESSING_INSTRUCTION, COMMENT, ATTRIBUTE, NAMESPACE, ATOM_XX.

Specified by:
getKind in interface FONIDocument

getName

public QName getName(int nodeId)
Description copied from interface: FONIDocument
Gets the name of a Node.

Specified by:
getName in interface FONIDocument

getNameId

public int getNameId(int offset)
Description copied from interface: FONIDocument
Gets the name-id of a real Node. All names are represented by an index in a name table.

Specified by:
getNameId in interface FONIDocument

pnGetName

public QName pnGetName(int nodeId)
Description copied from interface: FONIDocument
Gets the name of a pseudo Node Attribute / Namespace.

Specified by:
pnGetName in interface FONIDocument

pnGetNameId

public int pnGetNameId(int nodeId)
Description copied from interface: FONIDocument
Gets the name-id of a pseudo-node Attribute / Namespace.

Specified by:
pnGetNameId in interface FONIDocument

getParent

public int getParent(int nodeId)
Specified by:
getParent in interface FONIDocument

getNextSibling

public int getNextSibling(int nodeId)
Specified by:
getNextSibling in interface FONIDocument

getNodeNext

public int getNodeNext(int nodeId)
Description copied from interface: FONIDocument
Gets the node that is next in document order. (first child if non-atomic, otherwise returns getNodeAfter()).

Specified by:
getNodeNext in interface FONIDocument

getNodeAfter

public int getNodeAfter(int nodeId)
Description copied from interface: FONIDocument
Gets the node that is next in document order but not contained. It is the following sibling if any, else the parent's following sibling, recursively.

Specified by:
getNodeAfter in interface FONIDocument

getNodeSpan

public int getNodeSpan(int nodeId)
Specified by:
getNodeSpan in interface FONIDocument

getFirstChild

public int getFirstChild(int nodeId)
Specified by:
getFirstChild in interface FONIDocument

getStringValue

public java.lang.String getStringValue(int nodeId)
Description copied from interface: FONIDocument
Gets the string value for any node but Attributes and Namespaces.

Specified by:
getStringValue in interface FONIDocument

getAttrCount

public int getAttrCount(int nodeId)
Description copied from interface: FONIDocument
Returns the number of attributes of an element (not guaranteed to be efficient).

Specified by:
getAttrCount in interface FONIDocument

getAttribute

public int getAttribute(int nodeId,
                        int nameId)
Description copied from interface: FONIDocument
Gets an attribute node by name. If nameId < 0, returns the 1st attribute.

Specified by:
getAttribute in interface FONIDocument

pnGetNext

public int pnGetNext(int nodeId)
Description copied from interface: FONIDocument
Returns the next pseudo-node (attribute or NS).

Specified by:
pnGetNext in interface FONIDocument

pnGetStringValue

public java.lang.String pnGetStringValue(int nodeId)
Gets the string value for pseudo-nodes Attributes and Namespaces.

Specified by:
pnGetStringValue in interface FONIDocument

getCharValue

public char[] getCharValue(int nodeId,
                           int reserve)
Description copied from interface: FONIDocument
Specially meant for indexing: gets the string value of a text node. Returns the value into a char array, reserving chars (at head if reserve > 0).

Specified by:
getCharValue in interface FONIDocument

pnGetCharValue

public char[] pnGetCharValue(int nodeId,
                             int reserve)
Description copied from interface: FONIDocument
Specially meant for indexing: gets the string value of a "pseudo-node" (attribute or NS). Returns the value into a char array, possibly reserving leading chars.

Specified by:
pnGetCharValue in interface FONIDocument

getDefinedNSCount

public int getDefinedNSCount(int nodeId)
Description copied from interface: FONIDocument
Returns the number of NS defined on this node.

Specified by:
getDefinedNSCount in interface FONIDocument

getFirstNSNode

public int getFirstNSNode(int nodeId,
                          boolean inScope)
Description copied from interface: FONIDocument
Returns the first namespace node of a node. Use pnGetNext to iterate.

Specified by:
getFirstNSNode in interface FONIDocument

getValue

public java.lang.Object getValue(int nodeId)
Description copied from interface: FONIDocument
Gets an atomic value from a leaf node.

Specified by:
getValue in interface FONIDocument

getIntegerValue

public long getIntegerValue(int nodeId)
Description copied from interface: FONIDocument
Gets an integer value from an atome of type ATOM_INT.

Specified by:
getIntegerValue in interface FONIDocument

getElementNameCount

public int getElementNameCount()
Description copied from interface: FONIDocument
Gets the total number of element names.

Specified by:
getElementNameCount in interface FONIDocument

getElementName

public QName getElementName(int nameId)
Description copied from interface: FONIDocument
Gets the QName of an element node by the internal id.

Specified by:
getElementName in interface FONIDocument

internElementName

public int internElementName(QName name)
Description copied from interface: FONIDocument
Gets the internal id of an element name.

Specified by:
internElementName in interface FONIDocument

getOtherNameCount

public int getOtherNameCount()
Description copied from interface: FONIDocument
Gets the total number of non-element node names.

Specified by:
getOtherNameCount in interface FONIDocument

getOtherName

public QName getOtherName(int nameId)
Description copied from interface: FONIDocument
Gets the QName of a non-element node by the internal id.

Specified by:
getOtherName in interface FONIDocument

internOtherName

public int internOtherName(QName name)
Description copied from interface: FONIDocument
Gets the internal id of a non-element node name.

Specified by:
internOtherName in interface FONIDocument

close

public void close()
           throws java.io.IOException,
                  org.xml.sax.SAXException
Description copied from class: DocumentWriter
Terminates creation of a document (required).

Overrides:
close in class DocumentWriter
Throws:
java.io.IOException
org.xml.sax.SAXException

endDocument

public void endDocument()
                 throws org.xml.sax.SAXException
Specified by:
endDocument in interface org.xml.sax.ContentHandler
Throws:
org.xml.sax.SAXException

startElement

public void startElement(java.lang.String namespaceURI,
                         java.lang.String localName,
                         java.lang.String qName,
                         org.xml.sax.Attributes attrs)
                  throws org.xml.sax.SAXException
Specified by:
startElement in interface org.xml.sax.ContentHandler
Throws:
org.xml.sax.SAXException

endElement

public void endElement(java.lang.String namespaceURI,
                       java.lang.String localName,
                       java.lang.String qName)
                throws org.xml.sax.SAXException
Specified by:
endElement in interface org.xml.sax.ContentHandler
Throws:
org.xml.sax.SAXException

characters

public void characters(char[] ch,
                       int start,
                       int length)
Specified by:
characters in interface org.xml.sax.ContentHandler

characters

public void characters(java.lang.String chars)
Specified by:
characters in class DocumentWriter

processingInstruction

public void processingInstruction(java.lang.String target,
                                  java.lang.String data)
                           throws org.xml.sax.SAXException
Specified by:
processingInstruction in interface org.xml.sax.ContentHandler
Throws:
org.xml.sax.SAXException

skippedEntity

public void skippedEntity(java.lang.String name)
                   throws org.xml.sax.SAXException
Specified by:
skippedEntity in interface org.xml.sax.ContentHandler
Throws:
org.xml.sax.SAXException

startPrefixMapping

public void startPrefixMapping(java.lang.String prefix,
                               java.lang.String uri)
                        throws org.xml.sax.SAXException
Specified by:
startPrefixMapping in interface org.xml.sax.ContentHandler
Throws:
org.xml.sax.SAXException

endPrefixMapping

public void endPrefixMapping(java.lang.String prefix)
                      throws org.xml.sax.SAXException
Specified by:
endPrefixMapping in interface org.xml.sax.ContentHandler
Throws:
org.xml.sax.SAXException

comment

public void comment(char[] ch,
                    int start,
                    int length)
Specified by:
comment in interface org.xml.sax.ext.LexicalHandler

startCDATA

public void startCDATA()
Specified by:
startCDATA in interface org.xml.sax.ext.LexicalHandler

endCDATA

public void endCDATA()
Specified by:
endCDATA in interface org.xml.sax.ext.LexicalHandler

startEntity

public void startEntity(java.lang.String name)
Specified by:
startEntity in interface org.xml.sax.ext.LexicalHandler

endEntity

public void endEntity(java.lang.String name)
Specified by:
endEntity in interface org.xml.sax.ext.LexicalHandler

getCurrentNode

public int getCurrentNode()

isExported

public boolean isExported()
Specified by:
isExported in interface FONIDocument

estimateMemorySize

public int estimateMemorySize()
Description copied from interface: FONIDocument
Cache management.

Specified by:
estimateMemorySize in interface FONIDocument

© 2005 Axyana Software