本文整理汇总了Java中org.drools.decisiontable.InputType类的典型用法代码示例。如果您正苦于以下问题:Java InputType类的具体用法?Java InputType怎么用?Java InputType使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
InputType类属于org.drools.decisiontable包,在下文中一共展示了InputType类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: loadFromInputStream
import org.drools.decisiontable.InputType; //导入依赖的package包/类
public String loadFromInputStream(InputStream inStream, String format, String worksheetName) {
SpreadsheetCompiler compiler = new SpreadsheetCompiler();
if (format.equals(Asset.EXCEL) || format.equals(Asset.EXCEL_2007)) {
if (StringHelper.isEmpty(worksheetName))
return compiler.compile(inStream, format);
else
return compiler.compile(inStream, format, worksheetName);
}
else if (format.equals(Asset.CSV)) {
return compiler.compile(inStream, InputType.CSV);
}
else {
return null;
}
}
示例2: getSource
import org.drools.decisiontable.InputType; //导入依赖的package包/类
@Override
public String getSource( final Path path ) {
InputStream inputStream = null;
try {
final SpreadsheetCompiler compiler = new SpreadsheetCompiler();
inputStream = ioService.newInputStream( Paths.convert( path ),
StandardOpenOption.READ );
final String drl = compiler.compile( inputStream,
InputType.XLS );
return drl;
} catch ( Exception e ) {
throw new SourceGenerationFailedException( e.getMessage() );
} finally {
if ( inputStream != null ) {
try {
inputStream.close();
} catch ( IOException ioe ) {
throw ExceptionUtilities.handleException( ioe );
}
}
}
}