FileDocCategorySizeDatePackage
DeferredTextImpl.javaAPI DocApache Xerces 3.0.13281Fri Sep 14 20:33:54 BST 2007org.apache.xerces.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.

xerces.internal
version
$Id: DeferredTextImpl.java 447266 2006-09-18 05:57:49Z mrglavas $
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);