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


Java ExpressionFactoryImpl类代码示例

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

示例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);
    }
}
 
开发者ID:datacleaner,项目名称:DataCleaner,代码行数:19,代码来源:MathFormulaTransformer.java

示例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);
    }
}
 
开发者ID:datacleaner,项目名称:AnalyzerBeans,代码行数:19,代码来源:MathFormulaTransformer.java

示例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);
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:10,代码来源:JuelTest.java

示例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);
  }
}
 
开发者ID:camunda,项目名称:camunda-engine-dmn,代码行数:12,代码来源:FeelEngineFactoryImpl.java

示例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();
}
 
开发者ID:HubSpot,项目名称:jinjava,代码行数:19,代码来源:Jinjava.java

示例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)));
}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:7,代码来源:JuelConnector.java

示例8: ELExpressionParser

import de.odysseus.el.ExpressionFactoryImpl; //导入依赖的package包/类
public ELExpressionParser() {
  _factory = new ExpressionFactoryImpl();
  _context = new SimpleContext();
}
 
开发者ID:DevStreet,项目名称:FinanceAnalytics,代码行数:5,代码来源:ELExpressionParser.java

示例9: JuelElProvider

import de.odysseus.el.ExpressionFactoryImpl; //导入依赖的package包/类
public JuelElProvider() {
  this(new ExpressionFactoryImpl(), new JuelElContextFactory(createDefaultResolver()));
}
 
开发者ID:camunda,项目名称:camunda-engine-dmn,代码行数:4,代码来源:JuelElProvider.java

示例10: getFactory

import de.odysseus.el.ExpressionFactoryImpl; //导入依赖的package包/类
public ExpressionFactoryImpl getFactory() {
  return factory;
}
 
开发者ID:camunda,项目名称:camunda-engine-dmn,代码行数:4,代码来源:JuelElProvider.java

示例11: ELInputColumn

import de.odysseus.el.ExpressionFactoryImpl; //导入依赖的package包/类
public ELInputColumn(final String expression) {
    _expression = expression;
    _factory = new ExpressionFactoryImpl();
}
 
开发者ID:datacleaner,项目名称:DataCleaner,代码行数:5,代码来源:ELInputColumn.java

示例12: ELInputColumn

import de.odysseus.el.ExpressionFactoryImpl; //导入依赖的package包/类
public ELInputColumn(String expression) {
    _expression = expression;
    _factory = new ExpressionFactoryImpl();
}
 
开发者ID:datacleaner,项目名称:AnalyzerBeans,代码行数:5,代码来源:ELInputColumn.java

示例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);
}
 
开发者ID:inevo,项目名称:shindig-1.1-BETA5-incubating,代码行数:5,代码来源:Expressions.java


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