本文整理汇总了Java中de.odysseus.el.ExpressionFactoryImpl类的典型用法代码示例。如果您正苦于以下问题:Java ExpressionFactoryImpl类的具体用法?Java ExpressionFactoryImpl怎么用?Java ExpressionFactoryImpl使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ExpressionFactoryImpl类属于de.odysseus.el包,在下文中一共展示了ExpressionFactoryImpl类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: JuelFunction
import de.odysseus.el.ExpressionFactoryImpl; //导入依赖的package包/类
public JuelFunction(String juelExpression, Class<T> resultClass, Map<String, Class<?>> arguments) {
// Initialize the JUEL conext.
this.expressionFactory = new de.odysseus.el.ExpressionFactoryImpl();
this.initializeContext(this.context = new SimpleContext());
// Index the arguments.
Class<?>[] argumentTypeClasses = new Class[arguments.size()];
int argIndex = 0;
for (Map.Entry<String, Class<?>> argumentEntry : arguments.entrySet()) {
final String argName = argumentEntry.getKey();
final Class<?> argTypeClass = argumentEntry.getValue();
final TreeValueExpression argExpression =
this.expressionFactory.createValueExpression(this.context, String.format("${%s}", argName), argTypeClass);
Argument argument = new Argument(argIndex++, argTypeClass, argExpression);
argumentTypeClasses[argument.index] = argument.typeClass;
this.arguments.put(argName, argument);
}
// Create the JUEL method.
this.expression = expressionFactory.createValueExpression(this.context, juelExpression, resultClass);
// this.expression = expressionFactory.createMethodExpression(this.context, juelExpression, resultClass, argumentTypeClasses);
}
示例2: init
import de.odysseus.el.ExpressionFactoryImpl; //导入依赖的package包/类
@Initialize
public void init() {
_factory = new ExpressionFactoryImpl();
_columnAliases = new HashMap<>();
int i = 1;
for (final InputColumn<Number> inputColumn : _input) {
final String name = inputColumn.getName();
final List<String> list = new ArrayList<>(3);
final String variableName1 = StringUtils.replaceWhitespaces(name.toLowerCase(), "_");
final String variableName2 = StringUtils.replaceWhitespaces(name.toLowerCase(), "");
list.add(variableName1);
list.add(variableName2);
list.add("col" + i);
i++;
_columnAliases.put(name, list);
}
}
示例3: init
import de.odysseus.el.ExpressionFactoryImpl; //导入依赖的package包/类
@Initialize
public void init() {
_factory = new ExpressionFactoryImpl();
_columnAliases = new HashMap<String, List<String>>();
int i = 1;
for (InputColumn<Number> inputColumn : _input) {
final String name = inputColumn.getName();
final List<String> list = new ArrayList<String>(3);
final String variableName1 = StringUtils.replaceWhitespaces(name.toLowerCase(), "_");
final String variableName2 = StringUtils.replaceWhitespaces(name.toLowerCase(), "");
list.add(variableName1);
list.add(variableName2);
list.add("col" + i);
i++;
_columnAliases.put(name, list);
}
}
示例4: testJuel
import de.odysseus.el.ExpressionFactoryImpl; //导入依赖的package包/类
@Test
public void testJuel() throws Exception {
ExpressionFactory factory = new ExpressionFactoryImpl();
ELContext context = new SimpleContext();
ValueExpression valueExpression = factory.createValueExpression(context, "${123 * 2}", Object.class);
Object value = valueExpression.getValue(context);
assertEquals("Result is a Long object", 246L, value);
}
示例5: createExpressionFactory
import de.odysseus.el.ExpressionFactoryImpl; //导入依赖的package包/类
protected ExpressionFactory createExpressionFactory() {
Properties properties = new Properties();
properties.put(ExpressionFactoryImpl.PROP_CACHE_SIZE, String.valueOf(expressionCacheSize));
try {
return new ExpressionFactoryImpl(properties, createTypeConverter());
}
catch (ELException e) {
throw LOG.unableToInitializeFeelEngine(e);
}
}
示例6: Jinjava
import de.odysseus.el.ExpressionFactoryImpl; //导入依赖的package包/类
/**
* Create a new jinjava processor instance with the specified global config
*
* @param globalConfig
* used for all render operations performed by this processor instance
*/
public Jinjava(JinjavaConfig globalConfig) {
this.globalConfig = globalConfig;
this.globalContext = new Context();
Properties expConfig = new Properties();
expConfig.setProperty(TreeBuilder.class.getName(), ExtendedSyntaxBuilder.class.getName());
TypeConverter converter = new TruthyTypeConverter();
this.expressionFactory = new ExpressionFactoryImpl(expConfig, converter);
this.resourceLocator = new ClasspathResourceLocator();
}
示例7: newExpressionFactory
import de.odysseus.el.ExpressionFactoryImpl; //导入依赖的package包/类
/** Returns an <code>ExpressionFactory</code> instance.
* @return A customized <code>ExpressionFactory</code> instance
*/
public static ExpressionFactory newExpressionFactory() {
return new ExpressionFactoryImpl(new TreeStore(new ExtendedBuilder(), new Cache(1000)));
}
示例8: ELExpressionParser
import de.odysseus.el.ExpressionFactoryImpl; //导入依赖的package包/类
public ELExpressionParser() {
_factory = new ExpressionFactoryImpl();
_context = new SimpleContext();
}
示例9: JuelElProvider
import de.odysseus.el.ExpressionFactoryImpl; //导入依赖的package包/类
public JuelElProvider() {
this(new ExpressionFactoryImpl(), new JuelElContextFactory(createDefaultResolver()));
}
示例10: getFactory
import de.odysseus.el.ExpressionFactoryImpl; //导入依赖的package包/类
public ExpressionFactoryImpl getFactory() {
return factory;
}
示例11: ELInputColumn
import de.odysseus.el.ExpressionFactoryImpl; //导入依赖的package包/类
public ELInputColumn(final String expression) {
_expression = expression;
_factory = new ExpressionFactoryImpl();
}
示例12: ELInputColumn
import de.odysseus.el.ExpressionFactoryImpl; //导入依赖的package包/类
public ELInputColumn(String expression) {
_expression = expression;
_factory = new ExpressionFactoryImpl();
}
示例13: newExpressionFactory
import de.odysseus.el.ExpressionFactoryImpl; //导入依赖的package包/类
private ExpressionFactory newExpressionFactory(CacheProvider cacheProvider) {
TreeStore store = new TreeStore(new Builder(), createTreeCache(cacheProvider));
return new ExpressionFactoryImpl(store, typeConverter);
}