FileDocCategorySizeDatePackage
DeferredTextImpl.javaAPI DocJava SE 5 API5061Fri Aug 26 14:55:44 BST 2005com.sun.org.apache.xerces.internal.dom

DeferredTextImpl

public class DeferredTextImpl extends TextImpl implements DeferredNode
Text nodes hold the non-markup, non-Entity content of an Element or Attribute.

When a document is first made available to the DOM, there is only one Text object for each block of adjacent plain-text. Users (ie, applications) may create multiple adjacent Texts during editing -- see {@link org.w3c.dom.Element#normalize} for discussion.

Note that CDATASection is a subclass of Text. This is conceptually valid, since they're really just two different ways of quoting characters when they're written out as part of an XML stream.

version
$Id: DeferredTextImpl.java,v 1.12 2002/01/29 01:15:07 lehors Exp $
since
PR-DOM-Level-1-19980818.

Fields Summary
static final long
serialVersionUID
Serialization version.
protected transient int
fNodeIndex
Node index.
Constructors Summary
DeferredTextImpl(DeferredDocumentImpl ownerDocument, int nodeIndex)
This is the deferred constructor. Only the fNodeIndex is given here. All other data, can be requested from the ownerDocument via the index.


    //
    // Constructors
    //

                                
        
        super(ownerDocument, null);

        fNodeIndex = nodeIndex;
        needsSyncData(true);

    
Methods Summary
public intgetNodeIndex()
Returns the node index.

        return fNodeIndex;
    
protected voidsynchronizeData()
Synchronizes the underlying data.


        // no need for future synchronizations
        needsSyncData(false);

        // get initial text value
        DeferredDocumentImpl ownerDocument =
            (DeferredDocumentImpl) this.ownerDocument();
        data = ownerDocument.getNodeValueString(fNodeIndex);

        // NOTE: We used to normalize adjacent text node values here.
        //       This code has moved to the DeferredDocumentImpl
        //       getNodeValueString() method. -Ac

        // ignorable whitespace
        isIgnorableWhitespace(ownerDocument.getNodeExtra(fNodeIndex) == 1);