IT. Expert System.

Android Reference

TextImpl


org.apache.harmony.xml.dom

Class TextImpl

  • All Implemented Interfaces:
    CharacterData, Node, Text
    Direct Known Subclasses:
    CDATASectionImpl


    public class TextImpl
    extends CharacterDataImpl
    implements Text
    Provides a straightforward implementation of the corresponding W3C DOM interface. The class is used internally only, thus only notable members that are not in the original interface are documented (the W3C docs are quite extensive). Hope that's ok.

    Some of the fields may have package visibility, so other classes belonging to the DOM implementation can easily access them while maintaining the DOM tree structure.

    • Method Detail

      • getNodeName

        public String getNodeName()
        Description copied from interface: Node
        The name of this node, depending on its type; see the table above.
        Specified by:
        getNodeName in interface Node
        Overrides:
        getNodeName in class NodeImpl
      • getNodeType

        public short getNodeType()
        Description copied from interface: Node
        A code representing the type of the underlying object, as defined above.
        Specified by:
        getNodeType in interface Node
        Specified by:
        getNodeType in class NodeImpl
      • splitText

        public final Text splitText(int offset)
                             throws DOMException
        Description copied from interface: Text
        Breaks this node into two nodes at the specified offset, keeping both in the tree as siblings. After being split, this node will contain all the content up to the offset point. A new node of the same type, which contains all the content at and after the offset point, is returned. If the original node had a parent node, the new node is inserted as the next sibling of the original node. When the offset is equal to the length of this node, the new node has no data.
        Specified by:
        splitText in interface Text
        Parameters:
        offset - The 16-bit unit offset at which to split, starting from 0.
        Returns:
        The new node, of the same type as this node.
        Throws:
        DOMException - INDEX_SIZE_ERR: Raised if the specified offset is negative or greater than the number of 16-bit units in data.
        NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
      • isElementContentWhitespace

        public final boolean isElementContentWhitespace()
        Description copied from interface: Text
        Returns whether this text node contains element content whitespace, often abusively called "ignorable whitespace". The text node is determined to contain whitespace in element content during the load of the document or if validation occurs while using Document.normalizeDocument().
        Specified by:
        isElementContentWhitespace in interface Text
      • getWholeText

        public final String getWholeText()
        Description copied from interface: Text
        Returns all text of Text nodes logically-adjacent text nodes to this node, concatenated in document order.
        For instance, in the example below wholeText on the Text node that contains "bar" returns "barfoo", while on the Text node that contains "foo" it returns "barfoo".
        Specified by:
        getWholeText in interface Text
      • replaceWholeText

        public final Text replaceWholeText(String content)
                                    throws DOMException
        Description copied from interface: Text
        Replaces the text of the current node and all logically-adjacent text nodes with the specified text. All logically-adjacent text nodes are removed including the current node unless it was the recipient of the replacement text.
        This method returns the node which received the replacement text. The returned node is:
        • null, when the replacement text is the empty string;
        • the current node, except when the current node is read-only;
        • a new Text node of the same type ( Text or CDATASection) as the current node inserted at the location of the replacement.

        For instance, in the above example calling replaceWholeText on the Text node that contains "bar" with "yo" in argument results in the following:
        Where the nodes to be removed are read-only descendants of an EntityReference, the EntityReference must be removed instead of the read-only nodes. If any EntityReference to be removed has descendants that are not EntityReference, Text, or CDATASection nodes, the replaceWholeText method must fail before performing any modification of the document, raising a DOMException with the code NO_MODIFICATION_ALLOWED_ERR.
        For instance, in the example below calling replaceWholeText on the Text node that contains "bar" fails, because the EntityReference node "ent" contains an Element node which cannot be removed.
        Specified by:
        replaceWholeText in interface Text
        Parameters:
        content - The content of the replacing Text node.
        Returns:
        The Text node created with the specified content.
        Throws:
        DOMException - NO_MODIFICATION_ALLOWED_ERR: Raised if one of the Text nodes being replaced is readonly.
      • minimize

        public final TextImpl minimize()
        Tries to remove this node using itself and the previous node as context. If this node's text is empty, this node is removed and null is returned. If the previous node exists and is a text node, this node's text will be appended to that node's text and this node will be removed.

        Although this method alters the structure of the DOM tree, it does not alter the document's semantics.

        Returns:
        the node holding this node's text and the end of the operation. Can be null if this node contained the empty string.


Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 38 / 158781077. Delta: 0.04414 с