Java Code Examples for com.sun.xml.internal.fastinfoset.stax.StAXDocumentParser#setForceStreamClose()

The following examples show how to use com.sun.xml.internal.fastinfoset.stax.StAXDocumentParser#setForceStreamClose() . 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: FastInfosetCodec.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Create a new (@link StAXDocumentParser} recyclable instance.
 *
 * @param in the InputStream to parse from.
 * @param retainState if true the parser should retain the state of
 *        vocabulary tables for multiple parses.
 * @return a new recyclable {@link StAXDocumentParser} instance.
 */
/* package */ static StAXDocumentParser createNewStreamReaderRecyclable(InputStream in, boolean retainState) {
    StAXDocumentParser parser = new FastInfosetStreamReaderRecyclable(in);
    parser.setStringInterning(true);
    parser.setForceStreamClose(true);
    if (retainState) {
        /**
         * Create a parser vocabulary external to the parser.
         * This will ensure that the vocabulary will never be cleared
         * for each parse and will be retained (and will grow)
         * for each parse.
         */
        ParserVocabulary vocabulary = new ParserVocabulary();
        parser.setVocabulary(vocabulary);
    }
    return parser;
}
 
Example 2
Source File: FastInfosetCodec.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Create a new (@link StAXDocumentParser} recyclable instance.
 *
 * @param in the InputStream to parse from.
 * @param retainState if true the parser should retain the state of
 *        vocabulary tables for multiple parses.
 * @return a new recyclable {@link StAXDocumentParser} instance.
 */
/* package */ static StAXDocumentParser createNewStreamReaderRecyclable(InputStream in, boolean retainState) {
    StAXDocumentParser parser = new FastInfosetStreamReaderRecyclable(in);
    parser.setStringInterning(true);
    parser.setForceStreamClose(true);
    if (retainState) {
        /**
         * Create a parser vocabulary external to the parser.
         * This will ensure that the vocabulary will never be cleared
         * for each parse and will be retained (and will grow)
         * for each parse.
         */
        ParserVocabulary vocabulary = new ParserVocabulary();
        parser.setVocabulary(vocabulary);
    }
    return parser;
}
 
Example 3
Source File: FastInfosetCodec.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Create a new (@link StAXDocumentParser} recyclable instance.
 *
 * @param in the InputStream to parse from.
 * @param retainState if true the parser should retain the state of
 *        vocabulary tables for multiple parses.
 * @return a new recyclable {@link StAXDocumentParser} instance.
 */
/* package */ static StAXDocumentParser createNewStreamReaderRecyclable(InputStream in, boolean retainState) {
    StAXDocumentParser parser = new FastInfosetStreamReaderRecyclable(in);
    parser.setStringInterning(true);
    parser.setForceStreamClose(true);
    if (retainState) {
        /**
         * Create a parser vocabulary external to the parser.
         * This will ensure that the vocabulary will never be cleared
         * for each parse and will be retained (and will grow)
         * for each parse.
         */
        ParserVocabulary vocabulary = new ParserVocabulary();
        parser.setVocabulary(vocabulary);
    }
    return parser;
}
 
Example 4
Source File: FastInfosetCodec.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Create a new (@link StAXDocumentParser} recyclable instance.
 *
 * @param in the InputStream to parse from.
 * @param retainState if true the parser should retain the state of
 *        vocabulary tables for multiple parses.
 * @return a new recyclable {@link StAXDocumentParser} instance.
 */
/* package */ static StAXDocumentParser createNewStreamReaderRecyclable(InputStream in, boolean retainState) {
    StAXDocumentParser parser = new FastInfosetStreamReaderRecyclable(in);
    parser.setStringInterning(true);
    parser.setForceStreamClose(true);
    if (retainState) {
        /**
         * Create a parser vocabulary external to the parser.
         * This will ensure that the vocabulary will never be cleared
         * for each parse and will be retained (and will grow)
         * for each parse.
         */
        ParserVocabulary vocabulary = new ParserVocabulary();
        parser.setVocabulary(vocabulary);
    }
    return parser;
}
 
Example 5
Source File: FastInfosetCodec.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Create a new (@link StAXDocumentParser} recyclable instance.
 *
 * @param in the InputStream to parse from.
 * @param retainState if true the parser should retain the state of
 *        vocabulary tables for multiple parses.
 * @return a new recyclable {@link StAXDocumentParser} instance.
 */
/* package */ static StAXDocumentParser createNewStreamReaderRecyclable(InputStream in, boolean retainState) {
    StAXDocumentParser parser = new FastInfosetStreamReaderRecyclable(in);
    parser.setStringInterning(true);
    parser.setForceStreamClose(true);
    if (retainState) {
        /**
         * Create a parser vocabulary external to the parser.
         * This will ensure that the vocabulary will never be cleared
         * for each parse and will be retained (and will grow)
         * for each parse.
         */
        ParserVocabulary vocabulary = new ParserVocabulary();
        parser.setVocabulary(vocabulary);
    }
    return parser;
}
 
Example 6
Source File: FastInfosetCodec.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Create a new (@link StAXDocumentParser} recyclable instance.
 *
 * @param in the InputStream to parse from.
 * @param retainState if true the parser should retain the state of
 *        vocabulary tables for multiple parses.
 * @return a new recyclable {@link StAXDocumentParser} instance.
 */
/* package */ static StAXDocumentParser createNewStreamReaderRecyclable(InputStream in, boolean retainState) {
    StAXDocumentParser parser = new FastInfosetStreamReaderRecyclable(in);
    parser.setStringInterning(true);
    parser.setForceStreamClose(true);
    if (retainState) {
        /**
         * Create a parser vocabulary external to the parser.
         * This will ensure that the vocabulary will never be cleared
         * for each parse and will be retained (and will grow)
         * for each parse.
         */
        ParserVocabulary vocabulary = new ParserVocabulary();
        parser.setVocabulary(vocabulary);
    }
    return parser;
}
 
Example 7
Source File: FastInfosetCodec.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Create a new (@link StAXDocumentParser} recyclable instance.
 *
 * @param in the InputStream to parse from.
 * @param retainState if true the parser should retain the state of
 *        vocabulary tables for multiple parses.
 * @return a new recyclable {@link StAXDocumentParser} instance.
 */
/* package */ static StAXDocumentParser createNewStreamReaderRecyclable(InputStream in, boolean retainState) {
    StAXDocumentParser parser = new FastInfosetStreamReaderRecyclable(in);
    parser.setStringInterning(true);
    parser.setForceStreamClose(true);
    if (retainState) {
        /**
         * Create a parser vocabulary external to the parser.
         * This will ensure that the vocabulary will never be cleared
         * for each parse and will be retained (and will grow)
         * for each parse.
         */
        ParserVocabulary vocabulary = new ParserVocabulary();
        parser.setVocabulary(vocabulary);
    }
    return parser;
}
 
Example 8
Source File: FastInfosetCodec.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Create a new (@link StAXDocumentParser} recyclable instance.
 *
 * @param in the InputStream to parse from.
 * @param retainState if true the parser should retain the state of
 *        vocabulary tables for multiple parses.
 * @return a new recyclable {@link StAXDocumentParser} instance.
 */
/* package */ static StAXDocumentParser createNewStreamReaderRecyclable(InputStream in, boolean retainState) {
    StAXDocumentParser parser = new FastInfosetStreamReaderRecyclable(in);
    parser.setStringInterning(true);
    parser.setForceStreamClose(true);
    if (retainState) {
        /**
         * Create a parser vocabulary external to the parser.
         * This will ensure that the vocabulary will never be cleared
         * for each parse and will be retained (and will grow)
         * for each parse.
         */
        ParserVocabulary vocabulary = new ParserVocabulary();
        parser.setVocabulary(vocabulary);
    }
    return parser;
}