当前位置: 首页>>代码示例>>Java>>正文


Java GrammarFactory类代码示例

本文整理汇总了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);
}
 
开发者ID:V2GClarity,项目名称:RISE-V2G,代码行数:25,代码来源:EXIficientCodec.java

示例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);
}
 
开发者ID:EXIficient,项目名称:exificient,代码行数:22,代码来源:EXIficientDemo.java

示例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;
   }
 
开发者ID:akari-h,项目名称:nex,代码行数:25,代码来源:EXIUtil.java

示例4: getGrammarFactory

import com.siemens.ct.exi.GrammarFactory; //导入依赖的package包/类
private GrammarFactory getGrammarFactory() {
	return grammarFactory;
}
 
开发者ID:V2GClarity,项目名称:RISE-V2G,代码行数:4,代码来源:EXIficientCodec.java

示例5: setGrammarFactory

import com.siemens.ct.exi.GrammarFactory; //导入依赖的package包/类
private void setGrammarFactory(GrammarFactory grammarFactory) {
	this.grammarFactory = grammarFactory;
}
 
开发者ID:V2GClarity,项目名称:RISE-V2G,代码行数:4,代码来源:EXIficientCodec.java


注:本文中的com.siemens.ct.exi.GrammarFactory类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。