Examples of releaseParserOnClose()


Examples of org.apache.axiom.om.impl.OMXMLStreamReaderEx.releaseParserOnClose()

       
        // Make sure the reader is an OMStAXWrapper
        if (reader instanceof OMXMLStreamReaderEx) {
            OMXMLStreamReaderEx wrapper = (OMXMLStreamReaderEx) reader;
            assertTrue(!wrapper.isClosed());
            wrapper.releaseParserOnClose(true);
        }
       
        int count = 0;
        while (reader.hasNext()) {
            reader.next();
View Full Code Here

Examples of org.apache.axiom.om.impl.builder.StAXBuilder.releaseParserOnClose()

        OMElement om = getContentAsOMElement();
        if (om !=null) {
            OMXMLParserWrapper builder = om.getBuilder();
            if (builder instanceof StAXBuilder) {
                 StAXBuilder staxBuilder = (StAXBuilder) builder;
                 staxBuilder.releaseParserOnClose(true);
                 if (!staxBuilder.isClosed()) {
                     staxBuilder.close();
                 }
            }
        }
View Full Code Here

Examples of org.apache.axiom.om.impl.builder.StAXBuilder.releaseParserOnClose()

        OMElement om = getContentAsOMElement();
        if (om !=null) {
            OMXMLParserWrapper builder = om.getBuilder();
            if (builder instanceof StAXBuilder) {
                 StAXBuilder staxBuilder = (StAXBuilder) builder;
                 staxBuilder.releaseParserOnClose(true);
                 if (!staxBuilder.isClosed()) {
                     staxBuilder.close();
                 }
            }
        }
View Full Code Here

Examples of org.apache.axiom.om.impl.builder.StAXBuilder.releaseParserOnClose()

        OMElement om = getContentAsOMElement();
        if (om !=null) {
            OMXMLParserWrapper builder = om.getBuilder();
            if (builder instanceof StAXBuilder) {
                 StAXBuilder staxBuilder = (StAXBuilder) builder;
                 staxBuilder.releaseParserOnClose(true);
                 if (!staxBuilder.isClosed()) {
                     staxBuilder.close();
                 }
            }
        }
View Full Code Here

Examples of org.apache.axiom.om.impl.builder.StAXOMBuilder.releaseParserOnClose()

     */
    public static void reader2writer(XMLStreamReader reader,
                                     XMLStreamWriter writer)
    throws XMLStreamException {
        StAXOMBuilder builder = new StAXOMBuilder(reader);
        builder.releaseParserOnClose(true);
        try {
            OMDocument omDocument = builder.getDocument();
            Iterator it = omDocument.getChildren();
            while (it.hasNext()) {
                OMNode omNode = (OMNode) it.next();
View Full Code Here

Examples of org.apache.axiom.om.impl.builder.StAXOMBuilder.releaseParserOnClose()

        StAXOMBuilder builder = new StAXOMBuilder(omFactory, parser);
        // StAXOMBuilder defaults to the "legacy" behavior, which is to keep a reference to the
        // parser after the builder has been closed. Since releasing this reference is a good idea
        // we default to releaseParserOnClose=true for builders created through the OMMetaFactory
        // API.
        builder.releaseParserOnClose(true);
        return builder;
    }

    public OMXMLParserWrapper createOMBuilder(OMFactory omFactory, StAXParserConfiguration configuration, InputSource is) {
        return createStAXOMBuilder(omFactory, createXMLStreamReader(configuration, is));
View Full Code Here

Examples of org.apache.axiom.om.impl.builder.StAXOMBuilder.releaseParserOnClose()

        StAXOMBuilder builder = new StAXOMBuilder(omFactory, parser);
        // StAXOMBuilder defaults to the "legacy" behavior, which is to keep a reference to the
        // parser after the builder has been closed. Since releasing this reference is a good idea
        // we default to releaseParserOnClose=true for builders created through the OMMetaFactory
        // API.
        builder.releaseParserOnClose(true);
        return builder;
    }

    public OMXMLParserWrapper createStAXOMBuilder(OMFactory omFactory, XMLStreamReader parser) {
        return internalCreateStAXOMBuilder(omFactory, getXMLStreamReader(parser));
View Full Code Here

Examples of org.apache.axiom.om.impl.builder.StAXOMBuilder.releaseParserOnClose()

     * @throws XMLStreamException
     */
    private static void reader2writer(XMLStreamReader reader,
                                     XMLStreamWriter writer) throws XMLStreamException {
        StAXOMBuilder builder = new StAXOMBuilder(reader);
        builder.releaseParserOnClose(true);
        try {
            OMDocument omDocument = builder.getDocument();
            Iterator it = omDocument.getChildren();
            while (it.hasNext()) {
                // TODO: this is extremely inefficient since next() will actually build the node!
View Full Code Here

Examples of org.apache.axiom.om.impl.builder.StAXOMBuilder.releaseParserOnClose()

     */
    private static void reader2writer(XMLStreamReader reader,
                                     XMLStreamWriter writer)
    throws XMLStreamException {
        StAXOMBuilder builder = new StAXOMBuilder(reader);
        builder.releaseParserOnClose(true);
        try {
            OMDocument omDocument = builder.getDocument();
            Iterator it = omDocument.getChildren();
            while (it.hasNext()) {
                OMNode omNode = (OMNode) it.next();
View Full Code Here

Examples of org.apache.axiom.om.impl.builder.StAXOMBuilder.releaseParserOnClose()

     * @throws XMLStreamException
     */
    private static void reader2writer(XMLStreamReader reader,
                                     XMLStreamWriter writer) throws XMLStreamException {
        StAXOMBuilder builder = new StAXOMBuilder(reader);
        builder.releaseParserOnClose(true);
        try {
            OMDocument omDocument = builder.getDocument();
            Iterator it = omDocument.getChildren();
            while (it.hasNext()) {
                OMNode omNode = (OMNode) it.next();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.