Package de.odysseus.el.tree.impl

Examples of de.odysseus.el.tree.impl.Builder


      }
      if (Boolean.valueOf(properties.getProperty("javax.el.nullProperties"))) {
        features.add(Builder.Feature.NULL_PROPERTIES);
      }
    }
    Builder builder = new Builder(features.toArray(new Builder.Feature[features.size()]));

    // create cache
    int cacheSize = defaultCacheSize;
    if (properties != null && properties.containsKey("javax.el.cacheSize")) {
      try {
View Full Code Here


  public static void main(String... args) throws NoSuchMethodException {
    // this is the method we want to invoke
    Method method = String.class.getMethod("matches", String.class);

    // create our customized builder
    TreeBuilder builder = new Builder(Builder.Feature.METHOD_INVOCATIONS);

    // create our factory which uses our customized builder
    ExpressionFactory f = new ExpressionFactoryImpl(new TreeStore(builder, new Cache(10)));

    // create our resolver
View Full Code Here

  /**
   * Sample usage: enable resolving <code>null</code> properties.
   */
  public static void main(String... args) throws NoSuchMethodException {
    // create our customized builder
    TreeBuilder builder = new Builder(Builder.Feature.NULL_PROPERTIES);

    // create our factory which uses our customized builder
    ExpressionFactory f = new ExpressionFactoryImpl(new TreeStore(builder, new Cache(10)));

    // create our context
View Full Code Here

   * will be invoked. Otherwise, the default constructor will be used.
   */
  protected TreeBuilder createTreeBuilder(Properties properties, Feature... features) {
    Class<?> clazz = load(TreeBuilder.class, properties);
    if (clazz == null) {
      return new Builder(features);
    }
    try {
      if (Builder.class.isAssignableFrom(clazz)) {
        Constructor<?> constructor = clazz.getConstructor(Feature[].class);
        if (constructor == null) {
View Full Code Here

    context.setFunction("vararg", "f", getClass().getMethod("foovar", new Class[]{int[].class}));
    context.getELResolver().setValue(context, null, "var111", new int[]{1,1,1});
  }

  public void testVarargs() {
    Builder builder = new Builder(Feature.VARARGS);
    Tree tree = null;

    tree = builder.build("${vararg:f()}");
    assertEquals(foovar(), getNode(tree).eval(tree.bind(context.getFunctionMapper(), null), null));

    tree = builder.build("${vararg:f(1)}");
    assertEquals(foovar(1), getNode(tree).eval(tree.bind(context.getFunctionMapper(), null), null));

    tree = builder.build("${vararg:f(1,1)}");
    assertEquals(foovar(1,1), getNode(tree).eval(tree.bind(context.getFunctionMapper(), null), null));

    tree = builder.build("${vararg:f(null)}");
    assertEquals(foovar(0), getNode(tree).eval(tree.bind(context.getFunctionMapper(), null), null));

    tree = builder.build("${vararg:f(var111)}");
    assertEquals(foovar(1,1,1), getNode(tree).eval(tree.bind(context.getFunctionMapper(), null), context));
  }
View Full Code Here

    };
  }
 
 
  private ExpressionFactory newExpressionFactory(CacheProvider cacheProvider) {
    TreeStore store = new TreeStore(new Builder(), createTreeCache(cacheProvider));
    return new ExpressionFactoryImpl(store, typeConverter);
  }
View Full Code Here

   * default constructor will be used.
   */
  protected TreeBuilder createTreeBuilder(Properties properties, Feature... features) {
    Class<?> clazz = load(TreeBuilder.class, properties);
    if (clazz == null) {
      return new Builder(features);
    }
    try {
      if (Builder.class.isAssignableFrom(clazz)) {
        Constructor<?> constructor = clazz.getConstructor(Feature[].class);
        if (constructor == null) {
View Full Code Here

   * default constructor will be used.
   */
  protected TreeBuilder createTreeBuilder(Properties properties, Feature... features) {
    Class<?> clazz = load(TreeBuilder.class, properties);
    if (clazz == null) {
      return new Builder(features);
    }
    try {
      if (Builder.class.isAssignableFrom(clazz)) {
        Constructor<?> constructor = clazz.getConstructor(Feature[].class);
        if (constructor == null) {
View Full Code Here

  /**
   * Any provided JUEL converter must implement both JUEL TypeConverter impl and ELTypeConverter
   */
  public ExpressionFactory newExpressionFactory(CacheProvider cacheProvider,
      ELTypeConverter converter) {
    TreeStore store = new TreeStore(new Builder(),
        createTreeCache(cacheProvider));
    return new ExpressionFactoryImpl(store, (TypeConverter) converter);
  }
View Full Code Here

   * default constructor will be used.
   */
  protected TreeBuilder createTreeBuilder(Properties properties, Feature... features) {
    Class<?> clazz = load(TreeBuilder.class, properties);
    if (clazz == null) {
      return new Builder(features);
    }
    try {
      if (Builder.class.isAssignableFrom(clazz)) {
        Constructor<?> constructor = clazz.getConstructor(Feature[].class);
        if (constructor == null) {
View Full Code Here

TOP

Related Classes of de.odysseus.el.tree.impl.Builder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.