com.sun.xml.internal.fastinfoset.stax.StAXDocumentParser Java Examples

The following examples show how to use com.sun.xml.internal.fastinfoset.stax.StAXDocumentParser. 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 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;
}
 
Example #3
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} 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 {@link StAXDocumentParser} instance.
 */
/* package */ static StAXDocumentParser createNewStreamReader(InputStream in, boolean retainState) {
    StAXDocumentParser parser = new StAXDocumentParser(in);
    parser.setStringInterning(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-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 #5
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} 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 {@link StAXDocumentParser} instance.
 */
/* package */ static StAXDocumentParser createNewStreamReader(InputStream in, boolean retainState) {
    StAXDocumentParser parser = new StAXDocumentParser(in);
    parser.setStringInterning(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 hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Create a new (@link StAXDocumentParser} 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 {@link StAXDocumentParser} instance.
 */
/* package */ static StAXDocumentParser createNewStreamReader(InputStream in, boolean retainState) {
    StAXDocumentParser parser = new StAXDocumentParser(in);
    parser.setStringInterning(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-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 #9
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} 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 {@link StAXDocumentParser} instance.
 */
/* package */ static StAXDocumentParser createNewStreamReader(InputStream in, boolean retainState) {
    StAXDocumentParser parser = new StAXDocumentParser(in);
    parser.setStringInterning(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 #10
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 #11
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} 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 {@link StAXDocumentParser} instance.
 */
/* package */ static StAXDocumentParser createNewStreamReader(InputStream in, boolean retainState) {
    StAXDocumentParser parser = new StAXDocumentParser(in);
    parser.setStringInterning(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 #12
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 #13
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} 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 {@link StAXDocumentParser} instance.
 */
/* package */ static StAXDocumentParser createNewStreamReader(InputStream in, boolean retainState) {
    StAXDocumentParser parser = new StAXDocumentParser(in);
    parser.setStringInterning(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 #14
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} 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 {@link StAXDocumentParser} instance.
 */
/* package */ static StAXDocumentParser createNewStreamReader(InputStream in, boolean retainState) {
    StAXDocumentParser parser = new StAXDocumentParser(in);
    parser.setStringInterning(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 #15
Source File: FastInfosetCodec.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Create a new (@link StAXDocumentParser} 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 {@link StAXDocumentParser} instance.
 */
/* package */ static StAXDocumentParser createNewStreamReader(InputStream in, boolean retainState) {
    StAXDocumentParser parser = new StAXDocumentParser(in);
    parser.setStringInterning(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 #16
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 #17
Source File: FastInfosetStreamReaderFactory.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public XMLStreamReader doCreate(String systemId, InputStream in, boolean rejectDTDs) {
    StAXDocumentParser parser = fetch();
    if (parser == null) {
        return FastInfosetCodec.createNewStreamReaderRecyclable(in, false);
    }

    parser.setInputStream(in);
    return parser;
}
 
Example #18
Source File: FastInfosetStreamReaderFactory.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public XMLStreamReader doCreate(String systemId, InputStream in, boolean rejectDTDs) {
    StAXDocumentParser parser = fetch();
    if (parser == null) {
        return FastInfosetCodec.createNewStreamReaderRecyclable(in, false);
    }

    parser.setInputStream(in);
    return parser;
}
 
Example #19
Source File: FastInfosetStreamReaderFactory.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public XMLStreamReader doCreate(String systemId, InputStream in, boolean rejectDTDs) {
    StAXDocumentParser parser = fetch();
    if (parser == null) {
        return FastInfosetCodec.createNewStreamReaderRecyclable(in, false);
    }

    parser.setInputStream(in);
    return parser;
}
 
Example #20
Source File: FastInfosetStreamReaderFactory.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public XMLStreamReader doCreate(String systemId, InputStream in, boolean rejectDTDs) {
    StAXDocumentParser parser = fetch();
    if (parser == null) {
        return FastInfosetCodec.createNewStreamReaderRecyclable(in, false);
    }

    parser.setInputStream(in);
    return parser;
}
 
Example #21
Source File: FastInfosetStreamReaderFactory.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public XMLStreamReader doCreate(String systemId, InputStream in, boolean rejectDTDs) {
    StAXDocumentParser parser = fetch();
    if (parser == null) {
        return FastInfosetCodec.createNewStreamReaderRecyclable(in, false);
    }

    parser.setInputStream(in);
    return parser;
}
 
Example #22
Source File: FastInfosetStreamReaderFactory.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public XMLStreamReader doCreate(String systemId, InputStream in, boolean rejectDTDs) {
    StAXDocumentParser parser = fetch();
    if (parser == null) {
        return FastInfosetCodec.createNewStreamReaderRecyclable(in, false);
    }

    parser.setInputStream(in);
    return parser;
}
 
Example #23
Source File: FastInfosetStreamReaderFactory.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public XMLStreamReader doCreate(String systemId, InputStream in, boolean rejectDTDs) {
    StAXDocumentParser parser = fetch();
    if (parser == null) {
        return FastInfosetCodec.createNewStreamReaderRecyclable(in, false);
    }

    parser.setInputStream(in);
    return parser;
}
 
Example #24
Source File: FastInfosetStreamReaderFactory.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public XMLStreamReader doCreate(String systemId, InputStream in, boolean rejectDTDs) {
    StAXDocumentParser parser = fetch();
    if (parser == null) {
        return FastInfosetCodec.createNewStreamReaderRecyclable(in, false);
    }

    parser.setInputStream(in);
    return parser;
}
 
Example #25
Source File: FastInfosetStreamReaderFactory.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
public void doRecycle(XMLStreamReader r) {
    if (r instanceof StAXDocumentParser) {
        pool.set((StAXDocumentParser) r);
    }
}
 
Example #26
Source File: FastInfosetConnector.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
public FastInfosetConnector(StAXDocumentParser fastInfosetStreamReader,
        XmlVisitor visitor) {
    super(visitor);
    fastInfosetStreamReader.setStringInterning(true);
    this.fastInfosetStreamReader = fastInfosetStreamReader;
}
 
Example #27
Source File: FastInfosetConnector.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
public FastInfosetConnector(StAXDocumentParser fastInfosetStreamReader,
        XmlVisitor visitor) {
    super(visitor);
    fastInfosetStreamReader.setStringInterning(true);
    this.fastInfosetStreamReader = fastInfosetStreamReader;
}
 
Example #28
Source File: FastInfosetStreamReaderFactory.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
public void doRecycle(XMLStreamReader r) {
    if (r instanceof StAXDocumentParser) {
        pool.set((StAXDocumentParser) r);
    }
}
 
Example #29
Source File: FastInfosetStreamReaderFactory.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
private StAXDocumentParser fetch() {
    StAXDocumentParser parser = pool.get();
    pool.set(null);
    return parser;
}
 
Example #30
Source File: FastInfosetStreamReaderFactory.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
private StAXDocumentParser fetch() {
    StAXDocumentParser parser = pool.get();
    pool.set(null);
    return parser;
}