com.sun.xml.internal.fastinfoset.vocab.ParserVocabulary Java Examples
The following examples show how to use
com.sun.xml.internal.fastinfoset.vocab.ParserVocabulary.
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 openjdk-jdk8u-backup with GNU General Public License v2.0 | 6 votes |
/** * 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 #2
Source File: PrintTable.java From openjdk-8-source with GNU General Public License v2.0 | 6 votes |
/** * @param args the command line arguments */ public static void main(String[] args) { try { SAXParserFactory saxParserFactory = SAXParserFactory.newInstance(); saxParserFactory.setNamespaceAware(true); SAXParser saxParser = saxParserFactory.newSAXParser(); ParserVocabulary referencedVocabulary = new ParserVocabulary(); VocabularyGenerator vocabularyGenerator = new VocabularyGenerator(referencedVocabulary); File f = new File(args[0]); saxParser.parse(f, vocabularyGenerator); printVocabulary(referencedVocabulary); } catch (Exception e) { e.printStackTrace(); } }
Example #3
Source File: FastInfosetCodec.java From TencentKona-8 with GNU General Public License v2.0 | 6 votes |
/** * 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-8-source with GNU General Public License v2.0 | 6 votes |
/** * 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 #5
Source File: FastInfosetCodec.java From openjdk-8-source with GNU General Public License v2.0 | 6 votes |
/** * 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: PrintTable.java From TencentKona-8 with GNU General Public License v2.0 | 6 votes |
/** * @param args the command line arguments */ public static void main(String[] args) { try { SAXParserFactory saxParserFactory = SAXParserFactory.newInstance(); saxParserFactory.setNamespaceAware(true); SAXParser saxParser = saxParserFactory.newSAXParser(); ParserVocabulary referencedVocabulary = new ParserVocabulary(); VocabularyGenerator vocabularyGenerator = new VocabularyGenerator(referencedVocabulary); File f = new File(args[0]); saxParser.parse(f, vocabularyGenerator); printVocabulary(referencedVocabulary); } catch (Exception e) { e.printStackTrace(); } }
Example #7
Source File: FastInfosetCodec.java From TencentKona-8 with GNU General Public License v2.0 | 6 votes |
/** * 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 hottub with GNU General Public License v2.0 | 6 votes |
/** * 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 hottub with GNU General Public License v2.0 | 6 votes |
/** * 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: PrintTable.java From hottub with GNU General Public License v2.0 | 6 votes |
/** * @param args the command line arguments */ public static void main(String[] args) { try { SAXParserFactory saxParserFactory = SAXParserFactory.newInstance(); saxParserFactory.setNamespaceAware(true); SAXParser saxParser = saxParserFactory.newSAXParser(); ParserVocabulary referencedVocabulary = new ParserVocabulary(); VocabularyGenerator vocabularyGenerator = new VocabularyGenerator(referencedVocabulary); File f = new File(args[0]); saxParser.parse(f, vocabularyGenerator); printVocabulary(referencedVocabulary); } catch (Exception e) { e.printStackTrace(); } }
Example #11
Source File: PrintTable.java From jdk8u60 with GNU General Public License v2.0 | 6 votes |
/** * @param args the command line arguments */ public static void main(String[] args) { try { SAXParserFactory saxParserFactory = SAXParserFactory.newInstance(); saxParserFactory.setNamespaceAware(true); SAXParser saxParser = saxParserFactory.newSAXParser(); ParserVocabulary referencedVocabulary = new ParserVocabulary(); VocabularyGenerator vocabularyGenerator = new VocabularyGenerator(referencedVocabulary); File f = new File(args[0]); saxParser.parse(f, vocabularyGenerator); printVocabulary(referencedVocabulary); } catch (Exception e) { e.printStackTrace(); } }
Example #12
Source File: PrintTable.java From openjdk-jdk9 with GNU General Public License v2.0 | 6 votes |
/** * @param args the command line arguments */ public static void main(String[] args) { try { SAXParserFactory saxParserFactory = SAXParserFactory.newInstance(); saxParserFactory.setNamespaceAware(true); SAXParser saxParser = saxParserFactory.newSAXParser(); ParserVocabulary referencedVocabulary = new ParserVocabulary(); VocabularyGenerator vocabularyGenerator = new VocabularyGenerator(referencedVocabulary); File f = new File(args[0]); saxParser.parse(f, vocabularyGenerator); printVocabulary(referencedVocabulary); } catch (Exception e) { e.printStackTrace(); } }
Example #13
Source File: FastInfosetCodec.java From jdk8u60 with GNU General Public License v2.0 | 6 votes |
/** * 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 #14
Source File: PrintTable.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 6 votes |
/** * @param args the command line arguments */ public static void main(String[] args) { try { SAXParserFactory saxParserFactory = SAXParserFactory.newInstance(); saxParserFactory.setNamespaceAware(true); SAXParser saxParser = saxParserFactory.newSAXParser(); ParserVocabulary referencedVocabulary = new ParserVocabulary(); VocabularyGenerator vocabularyGenerator = new VocabularyGenerator(referencedVocabulary); File f = new File(args[0]); saxParser.parse(f, vocabularyGenerator); printVocabulary(referencedVocabulary); } catch (Exception e) { e.printStackTrace(); } }
Example #15
Source File: FastInfosetCodec.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 6 votes |
/** * 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 #16
Source File: PrintTable.java From openjdk-8 with GNU General Public License v2.0 | 6 votes |
/** * @param args the command line arguments */ public static void main(String[] args) { try { SAXParserFactory saxParserFactory = SAXParserFactory.newInstance(); saxParserFactory.setNamespaceAware(true); SAXParser saxParser = saxParserFactory.newSAXParser(); ParserVocabulary referencedVocabulary = new ParserVocabulary(); VocabularyGenerator vocabularyGenerator = new VocabularyGenerator(referencedVocabulary); File f = new File(args[0]); saxParser.parse(f, vocabularyGenerator); printVocabulary(referencedVocabulary); } catch (Exception e) { e.printStackTrace(); } }
Example #17
Source File: FastInfosetCodec.java From openjdk-jdk9 with GNU General Public License v2.0 | 6 votes |
/** * 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 #18
Source File: FastInfosetCodec.java From openjdk-8 with GNU General Public License v2.0 | 6 votes |
/** * 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 #19
Source File: FastInfosetCodec.java From openjdk-jdk8u with GNU General Public License v2.0 | 6 votes |
/** * 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 #20
Source File: FastInfosetCodec.java From openjdk-jdk8u with GNU General Public License v2.0 | 6 votes |
/** * 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 #21
Source File: PrintTable.java From openjdk-jdk8u with GNU General Public License v2.0 | 6 votes |
/** * @param args the command line arguments */ public static void main(String[] args) { try { SAXParserFactory saxParserFactory = SAXParserFactory.newInstance(); saxParserFactory.setNamespaceAware(true); SAXParser saxParser = saxParserFactory.newSAXParser(); ParserVocabulary referencedVocabulary = new ParserVocabulary(); VocabularyGenerator vocabularyGenerator = new VocabularyGenerator(referencedVocabulary); File f = new File(args[0]); saxParser.parse(f, vocabularyGenerator); printVocabulary(referencedVocabulary); } catch (Exception e) { e.printStackTrace(); } }
Example #22
Source File: FastInfosetCodec.java From jdk8u60 with GNU General Public License v2.0 | 6 votes |
/** * 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 #23
Source File: Decoder.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
/** * Set the ParserVocabulary to be used for decoding. * * @param v the vocabulary to be used for decoding. */ public void setVocabulary(ParserVocabulary v) { _v = v; _prefixTable = _v.prefix; _elementNameTable = _v.elementName; _attributeNameTable = _v.attributeName; _characterContentChunkTable = _v.characterContentChunk; _attributeValueTable = _v.attributeValue; _vIsInternal = false; }
Example #24
Source File: PrintTable.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
public static void printVocabulary(ParserVocabulary vocabulary) { printArray("Attribute Name Table", vocabulary.attributeName); printArray("Attribute Value Table", vocabulary.attributeValue); printArray("Character Content Chunk Table", vocabulary.characterContentChunk); printArray("Element Name Table", vocabulary.elementName); printArray("Local Name Table", vocabulary.localName); printArray("Namespace Name Table", vocabulary.namespaceName); printArray("Other NCName Table", vocabulary.otherNCName); printArray("Other String Table", vocabulary.otherString); printArray("Other URI Table", vocabulary.otherURI); printArray("Prefix Table", vocabulary.prefix); }
Example #25
Source File: VocabularyGenerator.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
/** Creates a new instance of VocabularyGenerator */ public VocabularyGenerator() { _serializerVocabulary = new SerializerVocabulary(); _parserVocabulary = new ParserVocabulary(); _v = new com.sun.xml.internal.org.jvnet.fastinfoset.Vocabulary(); }
Example #26
Source File: Decoder.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
/** * Default constructor for the Decoder. */ protected Decoder() { _v = new ParserVocabulary(); _prefixTable = _v.prefix; _elementNameTable = _v.elementName; _attributeNameTable = _v.attributeName; _characterContentChunkTable = _v.characterContentChunk; _attributeValueTable = _v.attributeValue; _vIsInternal = true; }
Example #27
Source File: Decoder.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
private void decodeExternalVocabularyURI() throws FastInfosetException, IOException { if (_externalVocabularies == null) { throw new IOException(CommonResourceBundle. getInstance().getString("message.noExternalVocabularies")); } String externalVocabularyURI = decodeNonEmptyOctetStringOnSecondBitAsUtf8String(); Object o = _externalVocabularies.get(externalVocabularyURI); if (o instanceof ParserVocabulary) { _v.setReferencedVocabulary(externalVocabularyURI, (ParserVocabulary)o, false); } else if (o instanceof com.sun.xml.internal.org.jvnet.fastinfoset.ExternalVocabulary) { com.sun.xml.internal.org.jvnet.fastinfoset.ExternalVocabulary v = (com.sun.xml.internal.org.jvnet.fastinfoset.ExternalVocabulary)o; ParserVocabulary pv = new ParserVocabulary(v.vocabulary); _externalVocabularies.put(externalVocabularyURI, pv); _v.setReferencedVocabulary(externalVocabularyURI, pv, false); } else { throw new FastInfosetException(CommonResourceBundle.getInstance(). getString("message.externalVocabularyNotRegistered", new Object[]{externalVocabularyURI})); } }
Example #28
Source File: Decoder.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
/** * Set the ParserVocabulary to be used for decoding. * * @param v the vocabulary to be used for decoding. */ public void setVocabulary(ParserVocabulary v) { _v = v; _prefixTable = _v.prefix; _elementNameTable = _v.elementName; _attributeNameTable = _v.attributeName; _characterContentChunkTable = _v.characterContentChunk; _attributeValueTable = _v.attributeValue; _vIsInternal = false; }
Example #29
Source File: Decoder.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
private void decodeExternalVocabularyURI() throws FastInfosetException, IOException { if (_externalVocabularies == null) { throw new IOException(CommonResourceBundle. getInstance().getString("message.noExternalVocabularies")); } String externalVocabularyURI = decodeNonEmptyOctetStringOnSecondBitAsUtf8String(); Object o = _externalVocabularies.get(externalVocabularyURI); if (o instanceof ParserVocabulary) { _v.setReferencedVocabulary(externalVocabularyURI, (ParserVocabulary)o, false); } else if (o instanceof com.sun.xml.internal.org.jvnet.fastinfoset.ExternalVocabulary) { com.sun.xml.internal.org.jvnet.fastinfoset.ExternalVocabulary v = (com.sun.xml.internal.org.jvnet.fastinfoset.ExternalVocabulary)o; ParserVocabulary pv = new ParserVocabulary(v.vocabulary); _externalVocabularies.put(externalVocabularyURI, pv); _v.setReferencedVocabulary(externalVocabularyURI, pv, false); } else { throw new FastInfosetException(CommonResourceBundle.getInstance(). getString("message.externalVocabularyNotRegistered", new Object[]{externalVocabularyURI})); } }
Example #30
Source File: Decoder.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
/** * Default constructor for the Decoder. */ protected Decoder() { _v = new ParserVocabulary(); _prefixTable = _v.prefix; _elementNameTable = _v.elementName; _attributeNameTable = _v.attributeName; _characterContentChunkTable = _v.characterContentChunk; _attributeValueTable = _v.attributeValue; _vIsInternal = true; }