Java Code Examples for com.sun.org.apache.xml.internal.serializer.SerializationHandler#characters()

The following examples show how to use com.sun.org.apache.xml.internal.serializer.SerializationHandler#characters() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AbstractTranslet.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
/**
 * Used by some compiled code as a shortcut for passing strings to the
 * output handler
 */
public final void characters(final String string,
                             SerializationHandler handler)
    throws TransletException {
    if (string != null) {
       //final int length = string.length();
       try {
           handler.characters(string);
       } catch (Exception e) {
           throw new TransletException(e);
       }
    }
}
 
Example 2
Source File: AbstractTranslet.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Used by some compiled code as a shortcut for passing strings to the
 * output handler
 */
public final void characters(final String string,
                             SerializationHandler handler)
    throws TransletException {
    if (string != null) {
       //final int length = string.length();
       try {
           handler.characters(string);
       } catch (Exception e) {
           throw new TransletException(e);
       }
    }
}
 
Example 3
Source File: SimpleResultTreeImpl.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Dispatch the character content of a node to an output handler.
 *
 * The escape setting should be taken care of when outputting to
 * a handler.
 */
public void characters(final int node, SerializationHandler handler)
    throws TransletException
{
    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);
        }
    }
}
 
Example 4
Source File: BasisLibrary.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public static void copy(Object obj,
                        SerializationHandler handler,
                        int node,
                        DOM dom) {
    try {
        if (obj instanceof DTMAxisIterator)
  {
            DTMAxisIterator iter = (DTMAxisIterator) obj;
            dom.copy(iter.reset(), handler);
        }
        else if (obj instanceof Node) {
            dom.copy(((Node) obj).node, handler);
        }
        else if (obj instanceof DOM) {
            //((DOM)obj).copy(((com.sun.org.apache.xml.internal.dtm.ref.DTMDefaultBase)((DOMAdapter)obj).getDOMImpl()).getDocument(), handler);
            DOM newDom = (DOM)obj;
            newDom.copy(newDom.getDocument(), handler);
        }
        else {
            String string = obj.toString();         // or call stringF()
            final int length = string.length();
            if (length > _characterArray.length)
                _characterArray = new char[length];
            string.getChars(0, length, _characterArray, 0);
            handler.characters(_characterArray, 0, length);
        }
    }
    catch (SAXException e) {
        runTimeError(RUN_TIME_COPY_ERR);
    }
}
 
Example 5
Source File: AbstractTranslet.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Used by some compiled code as a shortcut for passing strings to the
 * output handler
 */
public final void characters(final String string,
                             SerializationHandler handler)
    throws TransletException {
    if (string != null) {
       //final int length = string.length();
       try {
           handler.characters(string);
       } catch (Exception e) {
           throw new TransletException(e);
       }
    }
}
 
Example 6
Source File: AbstractTranslet.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Used by some compiled code as a shortcut for passing strings to the
 * output handler
 */
public final void characters(final String string,
                             SerializationHandler handler)
    throws TransletException {
    if (string != null) {
       //final int length = string.length();
       try {
           handler.characters(string);
       } catch (Exception e) {
           throw new TransletException(e);
       }
    }
}
 
Example 7
Source File: BasisLibrary.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public static void copy(Object obj,
                        SerializationHandler handler,
                        int node,
                        DOM dom) {
    try {
        if (obj instanceof DTMAxisIterator)
  {
            DTMAxisIterator iter = (DTMAxisIterator) obj;
            dom.copy(iter.reset(), handler);
        }
        else if (obj instanceof Node) {
            dom.copy(((Node) obj).node, handler);
        }
        else if (obj instanceof DOM) {
            //((DOM)obj).copy(((com.sun.org.apache.xml.internal.dtm.ref.DTMDefaultBase)((DOMAdapter)obj).getDOMImpl()).getDocument(), handler);
            DOM newDom = (DOM)obj;
            newDom.copy(newDom.getDocument(), handler);
        }
        else {
            String string = obj.toString();         // or call stringF()
            final int length = string.length();
            if (length > _characterArray.length)
                _characterArray = new char[length];
            string.getChars(0, length, _characterArray, 0);
            handler.characters(_characterArray, 0, length);
        }
    }
    catch (SAXException e) {
        runTimeError(RUN_TIME_COPY_ERR);
    }
}
 
Example 8
Source File: AbstractTranslet.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Used by some compiled code as a shortcut for passing strings to the
 * output handler
 */
public final void characters(final String string,
                             SerializationHandler handler)
    throws TransletException {
    if (string != null) {
       //final int length = string.length();
       try {
           handler.characters(string);
       } catch (Exception e) {
           throw new TransletException(e);
       }
    }
}
 
Example 9
Source File: SimpleResultTreeImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Dispatch the character content of a node to an output handler.
 *
 * The escape setting should be taken care of when outputting to
 * a handler.
 */
public void characters(final int node, SerializationHandler handler)
    throws TransletException
{
    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);
        }
    }
}
 
Example 10
Source File: BasisLibrary.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
public static void copy(Object obj,
                        SerializationHandler handler,
                        int node,
                        DOM dom) {
    try {
        if (obj instanceof DTMAxisIterator)
  {
            DTMAxisIterator iter = (DTMAxisIterator) obj;
            dom.copy(iter.reset(), handler);
        }
        else if (obj instanceof Node) {
            dom.copy(((Node) obj).node, handler);
        }
        else if (obj instanceof DOM) {
            //((DOM)obj).copy(((com.sun.org.apache.xml.internal.dtm.ref.DTMDefaultBase)((DOMAdapter)obj).getDOMImpl()).getDocument(), handler);
            DOM newDom = (DOM)obj;
            newDom.copy(newDom.getDocument(), handler);
        }
        else {
            String string = obj.toString();         // or call stringF()
            final int length = string.length();
            if (length > _characterArray.length)
                _characterArray = new char[length];
            string.getChars(0, length, _characterArray, 0);
            handler.characters(_characterArray, 0, length);
        }
    }
    catch (SAXException e) {
        runTimeError(RUN_TIME_COPY_ERR);
    }
}
 
Example 11
Source File: SimpleResultTreeImpl.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
/**
 * Dispatch the character content of a node to an output handler.
 *
 * The escape setting should be taken care of when outputting to
 * a handler.
 */
public void characters(final int node, SerializationHandler handler)
    throws TransletException
{
    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);
        }
    }
}
 
Example 12
Source File: BasisLibrary.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public static void copy(Object obj,
                        SerializationHandler handler,
                        int node,
                        DOM dom) {
    try {
        if (obj instanceof DTMAxisIterator)
  {
            DTMAxisIterator iter = (DTMAxisIterator) obj;
            dom.copy(iter.reset(), handler);
        }
        else if (obj instanceof Node) {
            dom.copy(((Node) obj).node, handler);
        }
        else if (obj instanceof DOM) {
            //((DOM)obj).copy(((com.sun.org.apache.xml.internal.dtm.ref.DTMDefaultBase)((DOMAdapter)obj).getDOMImpl()).getDocument(), handler);
            DOM newDom = (DOM)obj;
            newDom.copy(newDom.getDocument(), handler);
        }
        else {
            String string = obj.toString();         // or call stringF()
            final int length = string.length();
            if (length > _characterArray.length)
                _characterArray = new char[length];
            string.getChars(0, length, _characterArray, 0);
            handler.characters(_characterArray, 0, length);
        }
    }
    catch (SAXException e) {
        runTimeError(RUN_TIME_COPY_ERR);
    }
}
 
Example 13
Source File: BasisLibrary.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
public static void copy(Object obj,
                        SerializationHandler handler,
                        int node,
                        DOM dom) {
    try {
        if (obj instanceof DTMAxisIterator)
  {
            DTMAxisIterator iter = (DTMAxisIterator) obj;
            dom.copy(iter.reset(), handler);
        }
        else if (obj instanceof Node) {
            dom.copy(((Node) obj).node, handler);
        }
        else if (obj instanceof DOM) {
            //((DOM)obj).copy(((com.sun.org.apache.xml.internal.dtm.ref.DTMDefaultBase)((DOMAdapter)obj).getDOMImpl()).getDocument(), handler);
            DOM newDom = (DOM)obj;
            newDom.copy(newDom.getDocument(), handler);
        }
        else {
            String string = obj.toString();         // or call stringF()
            final int length = string.length();
            if (length > _characterArray.length)
                _characterArray = new char[length];
            string.getChars(0, length, _characterArray, 0);
            handler.characters(_characterArray, 0, length);
        }
    }
    catch (SAXException e) {
        runTimeError(RUN_TIME_COPY_ERR);
    }
}
 
Example 14
Source File: BasisLibrary.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public static void copy(Object obj,
                        SerializationHandler handler,
                        int node,
                        DOM dom) {
    try {
        if (obj instanceof DTMAxisIterator)
  {
            DTMAxisIterator iter = (DTMAxisIterator) obj;
            dom.copy(iter.reset(), handler);
        }
        else if (obj instanceof Node) {
            dom.copy(((Node) obj).node, handler);
        }
        else if (obj instanceof DOM) {
            //((DOM)obj).copy(((com.sun.org.apache.xml.internal.dtm.ref.DTMDefaultBase)((DOMAdapter)obj).getDOMImpl()).getDocument(), handler);
            DOM newDom = (DOM)obj;
            newDom.copy(newDom.getDocument(), handler);
        }
        else {
            String string = obj.toString();         // or call stringF()
            final int length = string.length();
            if (length > _characterArray.length)
                _characterArray = new char[length];
            string.getChars(0, length, _characterArray, 0);
            handler.characters(_characterArray, 0, length);
        }
    }
    catch (SAXException e) {
        runTimeError(RUN_TIME_COPY_ERR);
    }
}
 
Example 15
Source File: SimpleResultTreeImpl.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Dispatch the character content of a node to an output handler.
 *
 * The escape setting should be taken care of when outputting to
 * a handler.
 */
public void characters(final int node, SerializationHandler handler)
    throws TransletException
{
    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);
        }
    }
}
 
Example 16
Source File: BasisLibrary.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public static void copy(Object obj,
                        SerializationHandler handler,
                        int node,
                        DOM dom) {
    try {
        if (obj instanceof DTMAxisIterator)
  {
            DTMAxisIterator iter = (DTMAxisIterator) obj;
            dom.copy(iter.reset(), handler);
        }
        else if (obj instanceof Node) {
            dom.copy(((Node) obj).node, handler);
        }
        else if (obj instanceof DOM) {
            //((DOM)obj).copy(((com.sun.org.apache.xml.internal.dtm.ref.DTMDefaultBase)((DOMAdapter)obj).getDOMImpl()).getDocument(), handler);
            DOM newDom = (DOM)obj;
            newDom.copy(newDom.getDocument(), handler);
        }
        else {
            String string = obj.toString();         // or call stringF()
            final int length = string.length();
            if (length > _characterArray.length)
                _characterArray = new char[length];
            string.getChars(0, length, _characterArray, 0);
            handler.characters(_characterArray, 0, length);
        }
    }
    catch (SAXException e) {
        runTimeError(RUN_TIME_COPY_ERR);
    }
}
 
Example 17
Source File: BasisLibrary.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public static void copy(Object obj,
                        SerializationHandler handler,
                        int node,
                        DOM dom) {
    try {
        if (obj instanceof DTMAxisIterator)
  {
            DTMAxisIterator iter = (DTMAxisIterator) obj;
            dom.copy(iter.reset(), handler);
        }
        else if (obj instanceof Node) {
            dom.copy(((Node) obj).node, handler);
        }
        else if (obj instanceof DOM) {
            //((DOM)obj).copy(((com.sun.org.apache.xml.internal.dtm.ref.DTMDefaultBase)((DOMAdapter)obj).getDOMImpl()).getDocument(), handler);
            DOM newDom = (DOM)obj;
            newDom.copy(newDom.getDocument(), handler);
        }
        else {
            String string = obj.toString();         // or call stringF()
            final int length = string.length();
            if (length > _characterArray.length)
                _characterArray = new char[length];
            string.getChars(0, length, _characterArray, 0);
            handler.characters(_characterArray, 0, length);
        }
    }
    catch (SAXException e) {
        runTimeError(RUN_TIME_COPY_ERR);
    }
}
 
Example 18
Source File: SimpleResultTreeImpl.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Dispatch the character content of a node to an output handler.
 *
 * The escape setting should be taken care of when outputting to
 * a handler.
 */
public void characters(final int node, SerializationHandler handler)
    throws TransletException
{
    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);
        }
    }
}
 
Example 19
Source File: BasisLibrary.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
public static void copy(Object obj,
                        SerializationHandler handler,
                        int node,
                        DOM dom) {
    try {
        if (obj instanceof DTMAxisIterator)
  {
            DTMAxisIterator iter = (DTMAxisIterator) obj;
            dom.copy(iter.reset(), handler);
        }
        else if (obj instanceof Node) {
            dom.copy(((Node) obj).node, handler);
        }
        else if (obj instanceof DOM) {
            //((DOM)obj).copy(((com.sun.org.apache.xml.internal.dtm.ref.DTMDefaultBase)((DOMAdapter)obj).getDOMImpl()).getDocument(), handler);
            DOM newDom = (DOM)obj;
            newDom.copy(newDom.getDocument(), handler);
        }
        else {
            String string = obj.toString();         // or call stringF()
            final int length = string.length();
            if (length > _characterArray.length)
                _characterArray = new char[length];
            string.getChars(0, length, _characterArray, 0);
            handler.characters(_characterArray, 0, length);
        }
    }
    catch (SAXException e) {
        runTimeError(RUN_TIME_COPY_ERR);
    }
}
 
Example 20
Source File: AbstractTranslet.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
/**
 * Used by some compiled code as a shortcut for passing strings to the
 * output handler
 */
public final void characters(final String string,
                             SerializationHandler handler)
    throws TransletException {
    if (string != null) {
       //final int length = string.length();
       try {
           handler.characters(string);
       } catch (Exception e) {
           throw new TransletException(e);
       }
    }
}