Package org.activiti.engine.impl.javax.el

Examples of org.activiti.engine.impl.javax.el.ELException


   */
  public Bindings bind(FunctionMapper fnMapper, VariableMapper varMapper, TypeConverter converter) {
    Method[] methods = null;
    if (!functions.isEmpty()) {
      if (fnMapper == null) {
        throw new ELException(LocalMessages.get("error.function.nomapper"));
      }
      methods = new Method[functions.size()];
      for (FunctionNode node: functions) {
        String image = node.getName();
        Method method = null;
        int colon = image.indexOf(':');
        if (colon < 0) {
          method = fnMapper.resolveFunction("", image);
        } else {
          method = fnMapper.resolveFunction(image.substring(0, colon), image.substring(colon + 1));
        }
        if (method == null) {
          throw new ELException(LocalMessages.get("error.function.notfound", image));
        }
        if (node.isVarArgs() && method.isVarArgs()) {
          if (method.getParameterTypes().length > node.getParamCount() + 1) {
            throw new ELException(LocalMessages.get("error.function.params", image));
          }
        } else {
          if (method.getParameterTypes().length != node.getParamCount()) {
            throw new ELException(LocalMessages.get("error.function.params", image));
          }
        }
        methods[node.getIndex()] = method;
      }
    }
View Full Code Here


      Properties properties = new Properties();
      InputStream input = null;
      try {
        properties.load(input = new FileInputStream(file));
      } catch (IOException e) {
        throw new ELException("Cannot read default EL properties", e);
      } finally {
        try {
          input.close();
        } catch (IOException e) {
          // ignore...
View Full Code Here

    }
    if (input != null) {
      try {
        properties.load(input);
      } catch (IOException e) {
        throw new ELException("Cannot read EL properties", e);
      } finally {
        try {
          input.close();
        } catch (IOException e) {
          // ignore...
View Full Code Here

    int cacheSize = defaultCacheSize;
    if (properties != null && properties.containsKey(PROP_CACHE_SIZE)) {
      try {
        cacheSize = Integer.parseInt(properties.getProperty(PROP_CACHE_SIZE));
      } catch (NumberFormatException e) {
        throw new ELException("Cannot parse EL property " + PROP_CACHE_SIZE, e);
      }
    }
    Cache cache = cacheSize > 0 ? new Cache(cacheSize) : null;

    return new TreeStore(builder, cache);
View Full Code Here

      return TypeConverter.DEFAULT;
    }
    try {
      return TypeConverter.class.cast(clazz.newInstance());
    } catch (Exception e) {
      throw new ELException("TypeConverter " + clazz + " could not be instantiated", e);
    }
  }
View Full Code Here

        Constructor<?> constructor = clazz.getConstructor(Feature[].class);
        if (constructor == null) {
          if (features == null || features.length == 0) {
            return TreeBuilder.class.cast(clazz.newInstance());
          } else {
            throw new ELException("Builder " + clazz + " is missing constructor (can't pass features)");
          }
        } else {
          return TreeBuilder.class.cast(constructor.newInstance((Object) features));
        }
      } else {
        return TreeBuilder.class.cast(clazz.newInstance());
      }
    } catch (Exception e) {
      throw new ELException("TreeBuilder " + clazz + " could not be instantiated", e);
    }
  }
View Full Code Here

      if (className != null) {
        ClassLoader loader;
        try {
          loader = Thread.currentThread().getContextClassLoader();
        } catch (Exception e) {
          throw new ELException("Could not get context class loader", e);
        }
        try {
          return loader == null ? Class.forName(className) : loader.loadClass(className);
        } catch (ClassNotFoundException e) {
          throw new ELException("Class " + className + " not found", e);
        } catch (Exception e) {
          throw new ELException("Class " + className + " could not be instantiated", e);
        }
      }
    }
    return null;
  }
View Full Code Here

    this.node = tree.getRoot();
    this.deferred = tree.isDeferred();

    if (node.isLiteralText()) {
      if (returnType == void.class) {
        throw new ELException(LocalMessages.get("error.method.literal.void", expr));
      }
    } else if (!node.isMethodInvocation()) {
      if (!node.isLeftValue()) {
        throw new ELException(LocalMessages.get("error.method.invalid", expr));
      }
      if (paramTypes == null) {
        throw new ELException(LocalMessages.get("error.method.notypes"));
      }
    }
  }
View Full Code Here

  public boolean isReadOnly(Bindings bindings, ELContext context) {
    return true;
  }

  public void setValue(Bindings bindings, ELContext context, Object value) {
    throw new ELException(LocalMessages.get("error.value.set.rvalue", getStructuralId(bindings)));
  }
View Full Code Here

   */
  public Bindings bind(FunctionMapper fnMapper, VariableMapper varMapper, TypeConverter converter) {
    Method[] methods = null;
    if (!functions.isEmpty()) {
      if (fnMapper == null) {
        throw new ELException(LocalMessages.get("error.function.nomapper"));
      }
      methods = new Method[functions.size()];
      for (FunctionNode node: functions) {
        String image = node.getName();
        Method method = null;
        int colon = image.indexOf(':');
        if (colon < 0) {
          method = fnMapper.resolveFunction("", image);
        } else {
          method = fnMapper.resolveFunction(image.substring(0, colon), image.substring(colon + 1));
        }
        if (method == null) {
          throw new ELException(LocalMessages.get("error.function.notfound", image));
        }
        if (node.isVarArgs() && method.isVarArgs()) {
          if (method.getParameterTypes().length > node.getParamCount() + 1) {
            throw new ELException(LocalMessages.get("error.function.params", image));
          }
        } else {
          if (method.getParameterTypes().length != node.getParamCount()) {
            throw new ELException(LocalMessages.get("error.function.params", image));
          }
        }
        methods[node.getIndex()] = method;
      }
    }
View Full Code Here

TOP

Related Classes of org.activiti.engine.impl.javax.el.ELException

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.