Package juzu.impl.common

Examples of juzu.impl.common.MethodInvocation


  public ElementHandle.Package getHandle() {
    return handle;
  }

  public MethodInvocation resolveMethodInvocation(String typeName, String methodName, Map<String, String> parameterMap) throws ProcessingException {
    MethodInvocation method = null;
    for (MetaModelObject child : getChildren()) {
      if (child instanceof MethodInvocationResolver) {
        MethodInvocationResolver childResolver = (MethodInvocationResolver)child;
        MethodInvocation next = childResolver.resolveMethodInvocation(typeName, methodName, parameterMap);
        if (next != null) {
          if (method != null) {
            throw new UnsupportedOperationException("handle me gracefully");
          } else {
            method = next;
View Full Code Here


  public MethodInvocation resolveMethodInvocation(String typeName, String methodName, Map<String, String> parameterMap) {
    if ("Assets".equals(typeName) && methodName.equals("url")) {
      String path = parameterMap.get("path");
      if (path != null) {
        return new MethodInvocation(AssetServer.class.getName(), "renderAssetURLByPath", Collections.singletonList(path));
      } else {
        String id = parameterMap.get("id");
        if (id != null) {
          return new MethodInvocation(AssetServer.class.getName(), "renderAssetURLById", Collections.singletonList(id));
        }
      }
    }
    return null;
  }
View Full Code Here

        }
        ctx.closeSection();
      }
      else if (block instanceof ASTNode.URL) {
        ASTNode.URL url = (ASTNode.URL)block;
        MethodInvocation mi = url.getInvocation();
        ctx.writer.url(mi.getClassName(), mi.getMethodName(), mi.getMethodArguments());
      }
      else if (block instanceof ASTNode.Tag) {
        ASTNode.Tag tag = (ASTNode.Tag)block;
        TagHandler handler = get(tag);
        String className = handler.getClassName();
View Full Code Here

        if (param instanceof PhaseParameterMetaModel || param instanceof BeanParameterMetaModel) {
          String value = parameterMap.get(param.getName());
          args.add(value);
        }
      }
      return new MethodInvocation(method.getController().getHandle().getName() + "_", method.getName(), args);
    }
  }
View Full Code Here

    else if (node instanceof ASTNode.URL) {
      ASTNode.URL urlNode = (ASTNode.URL)node;
      String typeName = urlNode.getTypeName();
      String methodName = urlNode.getMethodName();
      Map<String,String> parameters = urlNode.getArgs();
      MethodInvocation mi = context.resolveMethodInvocation(typeName, methodName, parameters);
      if (mi == null) {
        StringBuilder controller = new StringBuilder();
        if (typeName != null && typeName.length() > 0) {
          controller.append(typeName).append('.');
        }
View Full Code Here

            throw failure("Unexpected non empty parameter map");
          }
          Class clazz = AbstractTemplateTestCase.this.getClass();
          try {
            Method m = clazz.getMethod(methodName);
            return new MethodInvocation(clazz.getName(), m.getName(), Collections.<String>emptyList());
          }
          catch (NoSuchMethodException e) {
            // Should we thrown a CompilationException instead ?
            throw failure(e);
          }
View Full Code Here

TOP

Related Classes of juzu.impl.common.MethodInvocation

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.