Methods Summary |
---|
public void | appendChild(int newChild, boolean clone, boolean cloneDepth)
|
public void | appendTextChild(java.lang.String str)
|
public void | characters(int node, com.sun.org.apache.xml.internal.serializer.SerializationHandler handler)Dispatch the character content of a node to an output handler.
The escape setting should be taken care of when outputting to
a handler.
int nodeID = getNodeIdent(node);
if (nodeID == RTF_ROOT || nodeID == RTF_TEXT) {
boolean escapeBit = false;
boolean oldEscapeSetting = false;
try {
for (int i = 0; i < _size; i++) {
if (_dontEscape != null) {
escapeBit = _dontEscape.getBit(i);
if (escapeBit) {
oldEscapeSetting = handler.setEscaping(false);
}
}
handler.characters(_textArray[i]);
if (escapeBit) {
handler.setEscaping(oldEscapeSetting);
}
}
} catch (SAXException e) {
throw new TransletException(e);
}
}
|
public void | characters(java.lang.String str)
// Resize the text array if necessary
if (_size >= _textArray.length) {
String[] newTextArray = new String[_textArray.length * 2];
System.arraycopy(_textArray, 0, newTextArray, 0, _textArray.length);
_textArray = newTextArray;
}
// If the escape setting is false, set the corresponding bit in
// the _dontEscape BitArray.
if (!_escaping) {
// The _dontEscape array is only created when needed.
if (_dontEscape == null) {
_dontEscape = new BitArray(8);
}
// Resize the _dontEscape array if necessary
if (_size >= _dontEscape.size())
_dontEscape.resize(_dontEscape.size() * 2);
_dontEscape.setBit(_size);
}
_textArray[_size++] = str;
|
public void | characters(char[] ch, int offset, int length)
if (_size >= _textArray.length) {
String[] newTextArray = new String[_textArray.length * 2];
System.arraycopy(_textArray, 0, newTextArray, 0, _textArray.length);
_textArray = newTextArray;
}
if (!_escaping) {
if (_dontEscape == null) {
_dontEscape = new BitArray(8);
}
if (_size >= _dontEscape.size())
_dontEscape.resize(_dontEscape.size() * 2);
_dontEscape.setBit(_size);
}
_textArray[_size++] = new String(ch, offset, length);
|
public void | copy(int node, com.sun.org.apache.xml.internal.serializer.SerializationHandler handler)
characters(node, handler);
|
public void | copy(com.sun.org.apache.xml.internal.dtm.DTMAxisIterator nodes, com.sun.org.apache.xml.internal.serializer.SerializationHandler handler)
int node;
while ((node = nodes.next()) != DTM.NULL)
{
copy(node, handler);
}
|
public void | dispatchCharactersEvents(int nodeHandle, org.xml.sax.ContentHandler ch, boolean normalize)
|
public void | dispatchToEvents(int nodeHandle, org.xml.sax.ContentHandler ch)
|
public void | documentRegistration()
|
public void | documentRelease()
|
public void | endDocument()
// Set the String value when the document is built.
if (_size == 1)
_text = _textArray[0];
else {
StringBuffer buffer = new StringBuffer();
for (int i = 0; i < _size; i++) {
buffer.append(_textArray[i]);
}
_text = buffer.toString();
}
|
public int | getAttributeNode(int gType, int element)
return DTM.NULL;
|
public int | getAttributeNode(int elementHandle, java.lang.String namespaceURI, java.lang.String name)
return DTM.NULL;
|
public com.sun.org.apache.xml.internal.dtm.DTMAxisIterator | getAxisIterator(int axis)
switch (axis)
{
case Axis.CHILD:
case Axis.DESCENDANT:
return new SimpleIterator(SimpleIterator.DIRECTION_DOWN);
case Axis.PARENT:
case Axis.ANCESTOR:
return new SimpleIterator(SimpleIterator.DIRECTION_UP);
case Axis.ANCESTORORSELF:
return (new SimpleIterator(SimpleIterator.DIRECTION_UP)).includeSelf();
case Axis.DESCENDANTORSELF:
return (new SimpleIterator(SimpleIterator.DIRECTION_DOWN)).includeSelf();
case Axis.SELF:
return new SingletonIterator();
default:
return EMPTY_ITERATOR;
}
|
public com.sun.org.apache.xml.internal.dtm.DTMAxisTraverser | getAxisTraverser(int axis)
return null;
|
public com.sun.org.apache.xml.internal.dtm.DTMAxisIterator | getChildren(int node)
return new SimpleIterator().setStartNode(node);
|
public org.xml.sax.ContentHandler | getContentHandler()
return null;
|
public org.xml.sax.DTDHandler | getDTDHandler()
return null;
|
public com.sun.org.apache.xml.internal.dtm.ref.DTMManagerDefault | getDTMManager()
return _dtmManager;
|
public org.xml.sax.ext.DeclHandler | getDeclHandler()
return null;
|
public int | getDocument()
return _documentID;
|
public boolean | getDocumentAllDeclarationsProcessed()
return false;
|
public java.lang.String | getDocumentBaseURI()
return EMPTY_STR;
|
public java.lang.String | getDocumentEncoding(int nodeHandle)
return null;
|
public int | getDocumentRoot(int nodeHandle)
return getDocument();
|
public java.lang.String | getDocumentStandalone(int nodeHandle)
return null;
|
public java.lang.String | getDocumentSystemIdentifier(int nodeHandle)
return null;
|
public java.lang.String | getDocumentTypeDeclarationPublicIdentifier()
return null;
|
public java.lang.String | getDocumentTypeDeclarationSystemIdentifier()
return null;
|
public java.lang.String | getDocumentURI(int node)
return "simple_rtf" + _documentURIIndex++;
|
public java.lang.String | getDocumentVersion(int documentHandle)
return null;
|
public int | getElementById(java.lang.String elementId)
return DTM.NULL;
|
public com.sun.org.apache.xalan.internal.xsltc.runtime.Hashtable | getElementsWithIDs()
return null;
|
public org.xml.sax.EntityResolver | getEntityResolver()
return null;
|
public org.xml.sax.ErrorHandler | getErrorHandler()
return null;
|
public int | getExpandedTypeID(int nodeHandle)
int nodeID = getNodeIdent(nodeHandle);
if (nodeID == RTF_TEXT)
return DTM.TEXT_NODE;
else if (nodeID == RTF_ROOT)
return DTM.ROOT_NODE;
else
return DTM.NULL;
|
public int | getExpandedTypeID(java.lang.String namespace, java.lang.String localName, int type)
return DTM.NULL;
|
public int | getFirstAttribute(int nodeHandle)
return DTM.NULL;
|
public int | getFirstChild(int nodeHandle)
int nodeID = getNodeIdent(nodeHandle);
if (nodeID == RTF_ROOT)
return getNodeHandle(RTF_TEXT);
else
return DTM.NULL;
|
public int | getFirstNamespaceNode(int nodeHandle, boolean inScope)
return DTM.NULL;
|
public com.sun.org.apache.xml.internal.dtm.DTMAxisIterator | getIterator()
return new SingletonIterator(getDocument());
|
public java.lang.String | getLanguage(int node)
return null;
|
public int | getLastChild(int nodeHandle)
return getFirstChild(nodeHandle);
|
public short | getLevel(int nodeHandle)
int nodeID = getNodeIdent(nodeHandle);
if (nodeID == RTF_TEXT)
return 2;
else if (nodeID == RTF_ROOT)
return 1;
else
return DTM.NULL;
|
public org.xml.sax.ext.LexicalHandler | getLexicalHandler()
return null;
|
public java.lang.String | getLocalName(int nodeHandle)
return EMPTY_STR;
|
public java.lang.String | getLocalNameFromExpandedNameID(int ExpandedNameID)
return EMPTY_STR;
|
public int | getNSType(int node)
return 0;
|
public com.sun.org.apache.xml.internal.dtm.DTMAxisIterator | getNamespaceAxisIterator(int axis, int ns)
return null;
|
public java.lang.String | getNamespaceFromExpandedNameID(int ExpandedNameID)
return EMPTY_STR;
|
public java.lang.String | getNamespaceName(int node)
return EMPTY_STR;
|
public int | getNamespaceType(int node)
return 0;
|
public java.lang.String | getNamespaceURI(int nodeHandle)
return EMPTY_STR;
|
public int | getNextAttribute(int nodeHandle)
return DTM.NULL;
|
public int | getNextNamespaceNode(int baseHandle, int namespaceHandle, boolean inScope)
return DTM.NULL;
|
public int | getNextSibling(int nodeHandle)
return DTM.NULL;
|
public org.w3c.dom.Node | getNode(int nodeHandle)
return makeNode(nodeHandle);
|
public int | getNodeHandle(int nodeId)Return the node handle from a node identity.
return (nodeId != DTM.NULL) ? (nodeId + _documentID) : DTM.NULL;
|
public int | getNodeIdent(int nodehandle)Return the node identity from a node handle.
return (nodehandle != DTM.NULL) ? (nodehandle - _documentID) : DTM.NULL;
|
public java.lang.String | getNodeName(int node)
if (getNodeIdent(node) == RTF_TEXT)
return "#text";
else
return EMPTY_STR;
|
public java.lang.String | getNodeNameX(int node)
return EMPTY_STR;
|
public short | getNodeType(int nodeHandle)
int nodeID = getNodeIdent(nodeHandle);
if (nodeID == RTF_TEXT)
return DTM.TEXT_NODE;
else if (nodeID == RTF_ROOT)
return DTM.ROOT_NODE;
else
return DTM.NULL;
|
public java.lang.String | getNodeValue(int nodeHandle)
return (getNodeIdent(nodeHandle) == RTF_TEXT) ? _text : null;
|
public com.sun.org.apache.xml.internal.dtm.DTMAxisIterator | getNodeValueIterator(com.sun.org.apache.xml.internal.dtm.DTMAxisIterator iter, int returnType, java.lang.String value, boolean op)
return null;
|
public com.sun.org.apache.xml.internal.dtm.DTMAxisIterator | getNthDescendant(int node, int n, boolean includeself)
return null;
|
public com.sun.org.apache.xml.internal.serializer.SerializationHandler | getOutputDomBuilder()
return this;
|
public int | getOwnerDocument(int nodeHandle)
return getDocument();
|
public int | getParent(int nodeHandle)
int nodeID = getNodeIdent(nodeHandle);
return (nodeID == RTF_TEXT) ? getNodeHandle(RTF_ROOT) : DTM.NULL;
|
public java.lang.String | getPrefix(int nodeHandle)
return null;
|
public int | getPreviousSibling(int nodeHandle)
return DTM.NULL;
|
public com.sun.org.apache.xalan.internal.xsltc.DOM | getResultTreeFrag(int initialSize, int rtfType)
return null;
|
public com.sun.org.apache.xalan.internal.xsltc.DOM | getResultTreeFrag(int initialSize, int rtfType, boolean addToManager)
return null;
|
public int | getSize()
return 2;
|
public javax.xml.transform.SourceLocator | getSourceLocatorFor(int node)
return null;
|
public java.lang.String | getStringValue()
return _text;
|
public com.sun.org.apache.xml.internal.utils.XMLString | getStringValue(int nodeHandle)
return new XMLStringDefault(getStringValueX(nodeHandle));
|
public char[] | getStringValueChunk(int nodeHandle, int chunkIndex, int[] startAndLen)
return null;
|
public int | getStringValueChunkCount(int nodeHandle)
return 0;
|
public java.lang.String | getStringValueX(int nodeHandle)
int nodeID = getNodeIdent(nodeHandle);
if (nodeID == RTF_ROOT || nodeID == RTF_TEXT)
return _text;
else
return EMPTY_STR;
|
public com.sun.org.apache.xml.internal.dtm.DTMAxisIterator | getTypedAxisIterator(int axis, int type)
switch (axis)
{
case Axis.CHILD:
case Axis.DESCENDANT:
return new SimpleIterator(SimpleIterator.DIRECTION_DOWN, type);
case Axis.PARENT:
case Axis.ANCESTOR:
return new SimpleIterator(SimpleIterator.DIRECTION_UP, type);
case Axis.ANCESTORORSELF:
return (new SimpleIterator(SimpleIterator.DIRECTION_UP, type)).includeSelf();
case Axis.DESCENDANTORSELF:
return (new SimpleIterator(SimpleIterator.DIRECTION_DOWN, type)).includeSelf();
case Axis.SELF:
return new SingletonIterator(type);
default:
return EMPTY_ITERATOR;
}
|
public com.sun.org.apache.xml.internal.dtm.DTMAxisIterator | getTypedChildren(int type)
return new SimpleIterator(SimpleIterator.DIRECTION_DOWN, type);
|
public java.lang.String | getUnparsedEntityURI(java.lang.String name)
return null;
|
public boolean | hasChildNodes(int nodeHandle)
return (getNodeIdent(nodeHandle) == RTF_ROOT);
|
public boolean | isAttribute(int node)
return false;
|
public boolean | isAttributeSpecified(int attributeHandle)
return false;
|
public boolean | isCharacterElementContentWhitespace(int nodeHandle)
return false;
|
public boolean | isDocumentAllDeclarationsProcessed(int documentHandle)
return false;
|
public boolean | isElement(int node)
return false;
|
public boolean | isNodeAfter(int firstNodeHandle, int secondNodeHandle)
return lessThan(firstNodeHandle, secondNodeHandle);
|
public boolean | isSupported(java.lang.String feature, java.lang.String version)
return false;
|
public boolean | lessThan(int node1, int node2)
if (node1 == DTM.NULL) {
return false;
}
else if (node2 == DTM.NULL) {
return true;
}
else
return (node1 < node2);
|
public java.lang.String | lookupNamespace(int node, java.lang.String prefix)
return null;
|
public org.w3c.dom.Node | makeNode(int index)
return null;
|
public org.w3c.dom.Node | makeNode(com.sun.org.apache.xml.internal.dtm.DTMAxisIterator iter)
return null;
|
public org.w3c.dom.NodeList | makeNodeList(int index)
return null;
|
public org.w3c.dom.NodeList | makeNodeList(com.sun.org.apache.xml.internal.dtm.DTMAxisIterator iter)
return null;
|
public void | migrateTo(com.sun.org.apache.xml.internal.dtm.DTMManager manager)
|
public boolean | needsTwoThreads()
return false;
|
public com.sun.org.apache.xml.internal.dtm.DTMAxisIterator | orderNodes(com.sun.org.apache.xml.internal.dtm.DTMAxisIterator source, int node)
return source;
|
public void | setDocumentBaseURI(java.lang.String baseURI)
|
public boolean | setEscaping(boolean escape)
final boolean temp = _escaping;
_escaping = escape;
return temp;
|
public void | setFeature(java.lang.String featureId, boolean state)The DTM interfaces are not used in this class. Implementing the DTM
interface is a requirement from MultiDOM. If we have a better way
of handling multiple documents, we can get rid of the DTM dependency.
The following interfaces are just placeholders. The implementation
does not have an impact because they will not be used.
|
public void | setFilter(com.sun.org.apache.xalan.internal.xsltc.StripFilter filter)
|
public void | setProperty(java.lang.String property, java.lang.Object value)
|
public void | setupMapping(java.lang.String[] names, java.lang.String[] uris, int[] types, java.lang.String[] namespaces)
|
public java.lang.String | shallowCopy(int node, com.sun.org.apache.xml.internal.serializer.SerializationHandler handler)
characters(node, handler);
return null;
|
public void | startDocument()We only need to override the endDocument, characters, and
setEscaping interfaces. A simple RTF does not have element
nodes. We do not need to touch startElement and endElement.
|
public boolean | supportsPreStripping()
return false;
|