本文整理汇总了Java中com.sun.xml.internal.fastinfoset.vocab.ParserVocabulary类的典型用法代码示例。如果您正苦于以下问题:Java ParserVocabulary类的具体用法?Java ParserVocabulary怎么用?Java ParserVocabulary使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ParserVocabulary类属于com.sun.xml.internal.fastinfoset.vocab包,在下文中一共展示了ParserVocabulary类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: main
import com.sun.xml.internal.fastinfoset.vocab.ParserVocabulary; //导入依赖的package包/类
/**
* @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();
}
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:22,代码来源:PrintTable.java
示例2: StAXDocumentParser
import com.sun.xml.internal.fastinfoset.vocab.ParserVocabulary; //导入依赖的package包/类
/**
* 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;
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:24,代码来源:FastInfosetCodec.java
示例3: FastInfosetStreamReaderRecyclable
import com.sun.xml.internal.fastinfoset.vocab.ParserVocabulary; //导入依赖的package包/类
/**
* 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;
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:25,代码来源:FastInfosetCodec.java
示例4: Decoder
import com.sun.xml.internal.fastinfoset.vocab.ParserVocabulary; //导入依赖的package包/类
/**
* 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;
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:13,代码来源:Decoder.java
示例5: setVocabulary
import com.sun.xml.internal.fastinfoset.vocab.ParserVocabulary; //导入依赖的package包/类
/**
* 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;
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:15,代码来源:Decoder.java
示例6: decodeExternalVocabularyURI
import com.sun.xml.internal.fastinfoset.vocab.ParserVocabulary; //导入依赖的package包/类
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}));
}
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:28,代码来源:Decoder.java
示例7: VocabularyGenerator
import com.sun.xml.internal.fastinfoset.vocab.ParserVocabulary; //导入依赖的package包/类
/** Creates a new instance of VocabularyGenerator */
public VocabularyGenerator() {
_serializerVocabulary = new SerializerVocabulary();
_parserVocabulary = new ParserVocabulary();
_v = new com.sun.xml.internal.org.jvnet.fastinfoset.Vocabulary();
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:8,代码来源:VocabularyGenerator.java
示例8: printVocabulary
import com.sun.xml.internal.fastinfoset.vocab.ParserVocabulary; //导入依赖的package包/类
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);
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:13,代码来源:PrintTable.java
注:本文中的com.sun.xml.internal.fastinfoset.vocab.ParserVocabulary类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论