Package com.volantis.mcs.dom

Examples of com.volantis.mcs.dom.Node


     * @return
     */
    private static int countChildren(Element element) {
        int childrenNum = 0;

        Node currentChild = element.getHead();

        while (currentChild != null) {
            childrenNum++;
            currentChild = currentChild.getNext();
        }

        return childrenNum;
    }
View Full Code Here


    private void transformChildren(
            DOMFactory factory,
            Element element) {

        Node next;
        Node child = element.getHead();
        for (; child != null; child = next) {
            next = child.getNext();
            transformNode(factory, child);
        }
    }
View Full Code Here

            }

            node = currentComment;
        } else {
            // Try and reuse existing Text nodes if we can.
            Node previous = currentPosition == null ?
                    currentElement.getTail() : currentPosition;
            if (previous instanceof Text) {
                Text text = (Text) previous;
                // If the encoding of the text node matches the encoding of
                // the text being added then we reuse it, otherwise we have to
View Full Code Here

        String pcdata = null;

        // Get the first node in the buffer.
        final Element root = getRoot();
        Node firstNode = root.getHead();
        // If there is at least one child.
        if (firstNode != null) {
            // Ensure there is only one child.
            if (firstNode != root.getTail()) {
                throw new IllegalStateException(
View Full Code Here

     * @param requiresProtocolString
     */
    protected void createDocument(boolean requiresProtocolString) {
        //  Create the document with the contents of the output buffers.
        document = domFactory.createDocument();
        Node next;

        if (requiresProtocolString) {
            doProtocolString(document);
        }

View Full Code Here

         * Remove all the nodes (siblings) that come after the given element
         * and release them and their children from the pool.
         */
        private void removeSubsequentNodes(Element menu) {

            Node next = menu.getNext();
            while(next!=null) {
                Node nextToRemove = next;
                next = next.getNext();
                nextToRemove.remove();
            }
        }
View Full Code Here

*/
public class WhiteSpaceInsideStrategy extends AbstractWhiteSpaceFixStrategy {

    // javadoc inherited
    public void fixUpSpace(Element element, boolean isOpen) {
        Node node = isOpen ? element.getHead() : element.getTail();
        if (node instanceof Text) {
            Text text = (Text) node;
            if (isOpen) {
                prependText(text, SINGLE_WHITESPACE);               
            } else {
View Full Code Here

     * element is not a Text element.
     *
     * @param element being fixed.
     */
    private void appendTextToPreviousElement(Element element) {
        Node node = element.getPrevious();
        if (node instanceof Text) {
            Text text = (Text)node;

            text.append(SINGLE_WHITESPACE);
            text.append(NON_BREAKING_SPACE);
View Full Code Here

     * not a Text element.
     *
     * @param element being fixed.
     */
    private void prependTextToNextElement(Element element) {
        Node node = element.getNext();
        if (node instanceof Text) {
            prependText((Text)node, SINGLE_WHITESPACE + NON_BREAKING_SPACE +
                                    NON_BREAKING_SPACE + NON_BREAKING_SPACE);
        }
    }
View Full Code Here

TOP

Related Classes of com.volantis.mcs.dom.Node

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.