Package org.mvel2

Examples of org.mvel2.ErrorDetail


                                //parserContext.setStrictTypeEnforcement(true);
                                compiler.compile(parserContext);
                                List<ErrorDetail> mvelErrors = parserContext.getErrorList();
                                if (mvelErrors != null) {
                                    for (Iterator<ErrorDetail> iterator = mvelErrors.iterator(); iterator.hasNext(); ) {
                                        ErrorDetail error = iterator.next();
                                        errors.add(new ProcessValidationErrorImpl(process,
                                            "Action node '" + node.getName() + "' [" + node.getId() + "] has invalid action: " + error.getMessage() + "."));
                                    }
                                }
                            } catch (Throwable t) {
                                errors.add(new ProcessValidationErrorImpl(process,
                                    "Action node '" + node.getName() + "' [" + node.getId() + "] has invalid action: " + t.getMessage() + "."));
View Full Code Here


                                //parserContext.setStrictTypeEnforcement(true);
                                compiler.compile(parserContext);
                                List<ErrorDetail> mvelErrors = parserContext.getErrorList();
                                if (mvelErrors != null) {
                                    for (Iterator<ErrorDetail> iterator = mvelErrors.iterator(); iterator.hasNext(); ) {
                                        ErrorDetail error = iterator.next();
                                        errors.add(new ProcessValidationErrorImpl(process,
                                            "Action node '" + node.getName() + "' [" + node.getId() + "] has invalid action: " + error.getMessage() + "."));
                                    }
                                }
                            } catch (Throwable t) {
                                errors.add(new ProcessValidationErrorImpl(process,
                                    "Action node '" + node.getName() + "' [" + node.getId() + "] has invalid action: " + t.getMessage() + "."));
View Full Code Here

                                //parserContext.setStrictTypeEnforcement(true);
                                compiler.compile(parserContext);
                                List<ErrorDetail> mvelErrors = parserContext.getErrorList();
                                if (mvelErrors != null) {
                                    for (Iterator<ErrorDetail> iterator = mvelErrors.iterator(); iterator.hasNext(); ) {
                                        ErrorDetail error = iterator.next();
                                        errors.add(new ProcessValidationErrorImpl(process,
                                            "Action node '" + node.getName() + "' [" + node.getId() + "] has invalid action: " + error.getMessage() + "."));
                                    }
                                }
                            } catch (Throwable t) {
                                errors.add(new ProcessValidationErrorImpl(process,
                                    "Action node '" + node.getName() + "' [" + node.getId() + "] has invalid action: " + t.getMessage() + "."));
View Full Code Here

        try {
          egressType = Class.forName(typeDescr.getClassName(), true, getClassLoader());
        }
        catch (ClassNotFoundException e) {
          if (pCtx.isStrongTyping())
            pCtx.addError(new ErrorDetail(expr, start, true, "could not resolve class: " + typeDescr.getClassName()));
          return;
          // do nothing.
        }
      }

      if (egressType != null) {
        rewriteClassReferenceToFQCN(fields);
        if (typeDescr.isArray()) {
          try {
            egressType = egressType.isPrimitive() ?
                toPrimitiveArrayType(egressType) :
                findClass(null, repeatChar('[', typeDescr.getArrayLength()) + "L" + egressType.getName() + ";", pCtx);
          }
          catch (Exception e) {
            e.printStackTrace();
            // for now, don't handle this.
          }
        }
      }

      if (pCtx != null && pCtx.isStrongTyping()) {
        if (egressType == null) {
          pCtx.addError(new ErrorDetail(expr, start, true, "could not resolve class: " + typeDescr.getClassName()));
          return;
        }

        if (!typeDescr.isArray()) {
          String[] cnsResid = captureContructorAndResidual(expr, start, offset);

          final List<char[]> constructorParms
              = parseMethodOrConstructor(cnsResid[0].toCharArray());

          final Class[] parms = new Class[constructorParms.size()];
          for (int i = 0; i < parms.length; i++) {
            parms[i] = analyze(constructorParms.get(i), pCtx);
          }

          if (getBestConstructorCandidate(parms, egressType, true) == null) {
            if (pCtx.isStrongTyping())
              pCtx.addError(new ErrorDetail(expr, start, pCtx.isStrongTyping(), "could not resolve constructor " + typeDescr.getClassName()
                  + Arrays.toString(parms)));
          }

          if (cnsResid.length == 2) {
            String residualProperty =
View Full Code Here

  protected static final int REMOVE = 1;
  protected static final int GET = 2;
  protected static final int GET_OR_CREATE = 3;

  protected void addFatalError(String message) {
    pCtx.addError(new ErrorDetail(expr, st, true, message));
  }
View Full Code Here

  protected void addFatalError(String message) {
    pCtx.addError(new ErrorDetail(expr, st, true, message));
  }

  protected void addFatalError(String message, int start) {
    pCtx.addError(new ErrorDetail(expr, start, true, message));
  }
View Full Code Here

        try {
          egressType = Class.forName(typeDescr.getClassName(), true, currentThread().getContextClassLoader());
        }
        catch (ClassNotFoundException e) {
          if (pCtx != null && pCtx.isStrongTyping())
            pCtx.addError(new ErrorDetail(expr, start, true, "could not resolve class: " + typeDescr.getClassName()));
          return;
          // do nothing.
        }
      }

      if (egressType != null) {
        rewriteClassReferenceToFQCN(fields);
        if (typeDescr.isArray()) {
          try {
            egressType = findClass(null,
                    repeatChar('[', typeDescr.getArrayLength()) + "L" + egressType.getName() + ";", pCtx);
          }
          catch (Exception e) {
            e.printStackTrace();
            // for now, don't handle this.
          }
        }
      }

      if (pCtx != null && pCtx.isStrongTyping()) {
        if (egressType == null) {
          pCtx.addError(new ErrorDetail(expr, start, true, "could not resolve class: " + typeDescr.getClassName()));
          return;
        }

        if (!typeDescr.isArray()) {
          String[] cnsResid = captureContructorAndResidual(expr, start, offset);

          final List<char[]> constructorParms
                  = parseMethodOrConstructor(cnsResid[0].toCharArray());

          final Class[] parms = new Class[constructorParms.size()];
          for (int i = 0; i < parms.length; i++) {
            parms[i] = analyze(constructorParms.get(i), pCtx);
          }

          if (getBestConstructorCandidate(parms, egressType, true) == null) {
            if (pCtx.isStrongTyping())
              pCtx.addError(new ErrorDetail(expr, start, pCtx.isStrongTyping(), "could not resolve constructor " + typeDescr.getClassName()
                      + Arrays.toString(parms)));
          }

          if (cnsResid.length == 2) {
            String residualProperty =
View Full Code Here

  protected static final int REMOVE = 1;
  protected static final int GET = 2;
  protected static final int GET_OR_CREATE = 3;

  protected void addFatalError(String message) {
    pCtx.addError(new ErrorDetail(expr, st, true, message));
  }
View Full Code Here

  protected void addFatalError(String message) {
    pCtx.addError(new ErrorDetail(expr, st, true, message));
  }

  protected void addFatalError(String message, int start) {
    pCtx.addError(new ErrorDetail(expr, start, true, message));
  }
View Full Code Here

                                //parserContext.setStrictTypeEnforcement(true);
                                compiler.compile(parserContext);
                                List<ErrorDetail> mvelErrors = parserContext.getErrorList();
                                if (mvelErrors != null) {
                                    for (Iterator<ErrorDetail> iterator = mvelErrors.iterator(); iterator.hasNext(); ) {
                                        ErrorDetail error = iterator.next();
                                        errors.add(new ProcessValidationErrorImpl(process,
                                            "Action node '" + node.getName() + "' [" + node.getId() + "] has invalid action: " + error.getMessage() + "."));
                                    }
                                }
                            } catch (Throwable t) {
                                errors.add(new ProcessValidationErrorImpl(process,
                                    "Action node '" + node.getName() + "' [" + node.getId() + "] has invalid action: " + t.getMessage() + "."));
View Full Code Here

TOP

Related Classes of org.mvel2.ErrorDetail

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.