Package jodd.madvoc

Examples of jodd.madvoc.MadvocException


    }
    boolean isDuplicate = set.add(actionConfig);

    if (madvocConfig.isDetectDuplicatePathsEnabled()) {
      if (isDuplicate) {
        throw new MadvocException("Duplicate action path for " + actionConfig);
      }
    }

    // finally
View Full Code Here


            result = lookup(resultClass);
            existingResult = true;
          }
          if ((existingClass.getPackage().equals(ActionResult.class.getPackage()) == false)) {
            // only throw exception if there are more then one replacement
            throw new MadvocException("Duplicate result: " + result);
          } else {
            if (log.isDebugEnabled()) {
              log.debug(existingClass.getSimpleName() + " result replaced with " + resultClass.getSimpleName());
            }
          }
View Full Code Here

   */
  protected ActionResult createResult(Class<? extends ActionResult> actionResultClass) {
    try {
      return actionResultClass.newInstance();
    } catch (Exception ex) {
      throw new MadvocException("Invalid Madvoc result: " + actionResultClass, ex);
    }
  }
View Full Code Here

    if (BeanUtil.hasDeclaredRootProperty(target, name)) {
      try {
        BeanUtil.setDeclaredPropertyForced(target, name, attrValue);
      } catch (Exception ex) {
        if (madvocConfig.isInjectionErrorThrowsException()) {
          throw new MadvocException(ex);
        } else {
          if (log.isWarnEnabled()) {
            log.warn("Injection failed: " + name + ". " + ex.toString());
          }
        }
View Full Code Here

    @Override
    public Config clone() {
      try {
        return (Config) super.clone();
      } catch (CloneNotSupportedException cnsex) {
        throw new MadvocException(cnsex);
      }
    }
View Full Code Here

        }
        scopeData[scopeType.value()] = sd;
      }
    } */
    else {
      throw new MadvocException("Invalid type: " + key);
    }
    if (count == 0) {
      return null;
    }

View Full Code Here

        listIn.add(ii);
      }
      InOut inout = field.getAnnotation(InOut.class);
      if (inout != null) {
        if (in != null) {
          throw new MadvocException("@InOut can not be used with @In: " + field.getDeclaringClass() + '#' + field.getName());
        }
        ii = inspectIn(inout, scopeType, field.getName(), field.getType());
        if (ii != null) {
          listIn.add(ii);
        }
      }

      Out out = field.getAnnotation(Out.class);
      ScopeData.Out oi = inspectOut(out, scopeType, field.getName(), fieldType);
      if (oi != null) {
        listOut.add(oi);
      }
      inout = field.getAnnotation(InOut.class);
      if (inout != null) {
        if (out != null) {
          throw new MadvocException("@InOut can not be used with @Out: " + field.getDeclaringClass() + '#' + field.getName());
        }
        oi = inspectOut(inout, scopeType, field.getName(), field.getType());
        if (oi != null) {
          listOut.add(oi);
        }
      }
    }

    // methods
    for (MethodDescriptor methodDescriptor : methods) {
      Method method = methodDescriptor.getMethod();

      String propertyName = ReflectUtil.getBeanPropertySetterName(method);
      if (propertyName != null) {
        In in = method.getAnnotation(In.class);
        ScopeData.In ii = inspectIn(in, scopeType, propertyName, method.getParameterTypes()[0]);
        if (ii != null) {
          listIn.add(ii);
        }
        InOut inout = method.getAnnotation(InOut.class);
        if (inout != null) {
          if (in != null) {
            throw new MadvocException("@InOut can not be used with @In: " + method.getDeclaringClass() + '#' + method.getName());
          }
          ii = inspectIn(inout, scopeType, propertyName, method.getParameterTypes()[0]);
          if (ii != null) {
            listIn.add(ii);
          }
        }
      }

      propertyName = ReflectUtil.getBeanPropertyGetterName(method);
      if (propertyName != null) {
        Out out = method.getAnnotation(Out.class);
        ScopeData.Out oi = inspectOut(out, scopeType, propertyName, method.getReturnType());
        if (oi != null) {
          listOut.add(oi);
        }
        InOut inout = method.getAnnotation(InOut.class);
        if (inout != null) {
          if (out != null) {
            throw new MadvocException("@InOut can not be used with @Out: " + method.getDeclaringClass() + '#' + method.getName());
          }
          oi = inspectOut(inout, scopeType, propertyName, method.getReturnType());
          if (oi != null) {
            listOut.add(oi);
          }
View Full Code Here

  @SuppressWarnings("unchecked")
  public void render(ActionRequest actionRequest, Object resultObject) throws Exception {
    ActionResult actionResult = resultsManager.lookup(actionRequest, resultObject);

    if (actionResult == null) {
      throw new MadvocException("Action result not found");
    }

    if (madvocConfig.isPreventCaching()) {
      ServletUtil.preventCaching(actionRequest.getHttpServletResponse());
    }
View Full Code Here

   */
  protected Object createAction(Class actionClass) {
    try {
      return actionClass.newInstance();
    } catch (Exception ex) {
      throw new MadvocException("Invalid Madvoc action", ex);
    }
  }
View Full Code Here

        if (defaultWrappers != null) {
          int ndx = i;
          for (Class<? extends T> defaultWrapper : defaultWrappers) {
            // can't add default list stack to default list
            if (defaultWrapper.equals(getDefaultWebAppWrapper())) {
              throw new MadvocException("Default wrapper list is self-contained (cyclic dependency)!");
            }
            list.add(ndx, defaultWrapper);
            ndx++;
          }
        }
View Full Code Here

TOP

Related Classes of jodd.madvoc.MadvocException

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.