本文整理汇总了Java中com.siemens.ct.exi.GrammarFactory类的典型用法代码示例。如果您正苦于以下问题:Java GrammarFactory类的具体用法?Java GrammarFactory怎么用?Java GrammarFactory使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
GrammarFactory类属于com.siemens.ct.exi包,在下文中一共展示了GrammarFactory类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: EXIficientCodec
import com.siemens.ct.exi.GrammarFactory; //导入依赖的package包/类
private EXIficientCodec() {
super();
setExiFactory(DefaultEXIFactory.newInstance());
setGrammarFactory(GrammarFactory.newInstance());
/*
* The Java classes
* - EXIficient_V2G_CI_AppProtocol,
* - EXIficient_V2G_CI_MsgDef, and
* - EXIficient_xmldsig_core_schema
* are serialized versions of the respective XSD schema files.
* These serializations have been created using a tool available at
* https://github.com/EXIficient/exificient-grammars/blob/master/src/main/java/com/siemens/ct/exi/grammars/persistency/Grammars2JavaSourceCode.java
*/
setGrammarAppProtocol(new EXIficient_V2G_CI_AppProtocol());
setGrammarMsgDef(new EXIficient_V2G_CI_MsgDef());
setGrammarXMLDSig(new EXIficient_xmldsig_core_schema());
// Non-default settings to fulfill requirements [V2G2-099] and [V2G2-600]
getExiFactory().setValuePartitionCapacity(0);
getExiFactory().setMaximumNumberOfBuiltInElementGrammars(0);
getExiFactory().setMaximumNumberOfBuiltInProductions(0);
}
示例2: codeSchemaInformed
import com.siemens.ct.exi.GrammarFactory; //导入依赖的package包/类
protected void codeSchemaInformed() throws Exception {
String exiLocation = getEXILocation(false);
// create default factory and EXI grammar for schema
EXIFactory exiFactory = DefaultEXIFactory.newInstance();
GrammarFactory grammarFactory = GrammarFactory.newInstance();
Grammars g = grammarFactory.createGrammars(xsdLocation);
exiFactory.setGrammars(g);
// encode
OutputStream exiOS = new FileOutputStream(exiLocation);
EXIResult exiResult = new EXIResult(exiFactory);
exiResult.setOutputStream(exiOS);
encode(exiResult.getHandler());
exiOS.close();
// decode
EXISource saxSource = new EXISource(exiFactory);
XMLReader xmlReader = saxSource.getXMLReader();
decode(xmlReader, exiLocation);
}
示例3: prepare_EXIFactory
import com.siemens.ct.exi.GrammarFactory; //导入依赖的package包/类
public static EXIFactory prepare_EXIFactory(String schemaLocation, boolean strict, boolean include_header_opt, String schemaId) throws EXIException {
EXIFactory efactory = DefaultEXIFactory.newInstance();
if (strict){
FidelityOptions fo = FidelityOptions.createStrict();
efactory.setFidelityOptions(fo);
}
// always bitpacked
efactory.setCodingMode(CodingMode.BIT_PACKED);
GrammarFactory gf = GrammarFactory.newInstance();
Grammars g = gf.createGrammars(schemaLocation);
EncodingOptions eo = EncodingOptions.createDefault();
if (schemaId != null){
g.setSchemaId(schemaId);
eo.setOption(EncodingOptions.INCLUDE_SCHEMA_ID);
}
if (include_header_opt){
eo.setOption(EncodingOptions.INCLUDE_OPTIONS);
}
efactory.setEncodingOptions(eo);
efactory.setGrammars(g);
return efactory;
}
示例4: getGrammarFactory
import com.siemens.ct.exi.GrammarFactory; //导入依赖的package包/类
private GrammarFactory getGrammarFactory() {
return grammarFactory;
}
示例5: setGrammarFactory
import com.siemens.ct.exi.GrammarFactory; //导入依赖的package包/类
private void setGrammarFactory(GrammarFactory grammarFactory) {
this.grammarFactory = grammarFactory;
}