Examples of MethodDeclaration


Examples of lombok.ast.MethodDeclaration

                    return true;
                }
            } else if (type == MethodDeclaration.class) {
                // Method
                // Look for annotations on the method
                MethodDeclaration declaration = (MethodDeclaration) scope;
                if (isSuppressed(issue, declaration.astModifiers())) {
                    return true;
                }
            } else if (type == ConstructorDeclaration.class) {
                // Constructor
                // Look for annotations on the method
                ConstructorDeclaration declaration = (ConstructorDeclaration) scope;
                if (isSuppressed(issue, declaration.astModifiers())) {
                    return true;
                }
            } else if (type == ClassDeclaration.class) {
                // Class
                ClassDeclaration declaration = (ClassDeclaration) scope;
                if (isSuppressed(issue, declaration.astModifiers())) {
                    return true;
                }
            }

            scope = scope.getParent();
View Full Code Here

Examples of openperipheral.adapter.method.MethodDeclaration

  private void addMethodsFromObject(Map<String, E> methods, Object target) {
    for (Method method : target.getClass().getMethods()) {
      LuaCallable callableMeta = method.getAnnotation(LuaCallable.class);
      if (callableMeta != null) {
        MethodDeclaration decl = new MethodDeclaration(method, callableMeta);
        for (String name : decl.getNames())
          methods.put(name, createDummyWrapper(target, decl));
      }
    }
  }
View Full Code Here

Examples of openperipheral.adapter.method.MethodDeclaration

    public E createExecutor(Method method, MethodDeclaration decl, Map<String, Method> proxyArgs);
  }

  protected MethodDeclaration createDeclaration(Method method) {
    LuaMethod methodAnn = method.getAnnotation(LuaMethod.class);
    if (methodAnn != null) return new MethodDeclaration(method, methodAnn);

    LuaCallable callableAnn = method.getAnnotation(LuaCallable.class);
    if (callableAnn != null) return new MethodDeclaration(method, callableAnn);

    return null;
  }
View Full Code Here

Examples of openperipheral.adapter.method.MethodDeclaration

      Log.severe(t, "Can't get adapter %s methods (possible sideness fail), bailing out", adapterClass);
      return result;
    }

    for (Method method : clsMethods) {
      MethodDeclaration decl = createDeclaration(method);

      if (decl == null) continue;

      Map<String, Method> allProxyArgs = Maps.newHashMap();

      Class<?>[] luaArgs = decl.getLuaArgTypes();
      final ProxyArg proxyArg = method.getAnnotation(ProxyArg.class);
      if (proxyArg != null) addProxyArgs(allProxyArgs, method.getName(), luaArgs, proxyArg);

      final ProxyArgs proxyArgs = method.getAnnotation(ProxyArgs.class);
      if (proxyArgs != null) for (ProxyArg arg : proxyArgs.value())
        addProxyArgs(allProxyArgs, method.getName(), luaArgs, arg);

      E exec = factory.createExecutor(method, decl, ImmutableMap.copyOf(allProxyArgs));

      if (!isFreeform(method, clsIsFreeform)) {
        final String[] methodPrefixes = getPrefixes(method, classPrefixes);
        if (methodPrefixes != null) namesFromAnnotation(methodPrefixes, decl);
        else nameDefaultParameters(decl);
      }

      validateArgTypes(decl);
      for (String proxyArgName : allProxyArgs.keySet())
        decl.declareJavaArgType(proxyArgName, IMethodProxy.class);

      decl.validate();

      result.add(exec);
    }

    return result;
View Full Code Here

Examples of org.apache.beehive.netui.compiler.typesystem.declaration.MethodDeclaration

        Collection properties = CompilerUtils.getBeanProperties( beanClass, true );
       
        for ( Iterator ii = properties.iterator(); ii.hasNext();
        {
            CompilerUtils.BeanPropertyDeclaration property = ( CompilerUtils.BeanPropertyDeclaration ) ii.next();
            MethodDeclaration getter = property.getGetter();
            String propertyName = property.getPropertyName();
           
            if ( getter != null )
            {
                //
                // Parse validation annotations on each getter.
                //
                AnnotationInstance[] annotations = getter.getAnnotationInstances();
               
                if ( annotations != null )
                {
                    List formNames = getFormBeanNames( beanClass );
                   
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.core.dom.MethodDeclaration

              // rename constructors
              Iterator bodyDeclarations = typeNode.bodyDeclarations().iterator();
              while (bodyDeclarations.hasNext()) {
                Object bodyDeclaration = bodyDeclarations.next();
                if (bodyDeclaration instanceof MethodDeclaration) {
                  MethodDeclaration methodDeclaration = (MethodDeclaration) bodyDeclaration;
                  if (methodDeclaration.isConstructor()) {
                    SimpleName methodName = methodDeclaration.getName();
                    if (methodName.getIdentifier().equals(oldTypeName)) {
                      rewriter.replace(methodName, ast.newSimpleName(newTypeName), null);
                    }
                  }
                }
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.core.dom.MethodDeclaration

* current <code>MethodDeclaration</code>
*/
protected String[] convertASTMethodTypesToSignatures() {
  if (this.parameterTypes == null) {
    if (this.createdNode != null) {
      MethodDeclaration methodDeclaration = (MethodDeclaration) this.createdNode;
      List parameters = methodDeclaration.parameters();
      int size = parameters.size();
      this.parameterTypes = new String[size];
      Iterator iterator = parameters.iterator();
      // convert the AST types to signatures
      for (int i = 0; i < size; i++) {
        SingleVariableDeclaration parameter = (SingleVariableDeclaration) iterator.next();
        String typeSig = Util.getSignature(parameter.getType());
        int extraDimensions = parameter.getExtraDimensions();
        if (methodDeclaration.isVarargs() && i == size-1)
          extraDimensions++;
        this.parameterTypes[i] = Signature.createArraySignature(typeSig, extraDimensions);
      }
    }
  }
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.core.dom.MethodDeclaration

*/
public String getMainTaskName(){
  return Messages.operation_createMethodProgress;
}
protected SimpleName rename(ASTNode node, SimpleName newName) {
  MethodDeclaration method = (MethodDeclaration) node;
  SimpleName oldName = method.getName();
  method.setName(newName);
  return oldName;
}
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.ast.MethodDeclaration

      Initializer initializer,
      ClassScope scope,
      int from,
      char[][] discouragedNames,
      UnresolvedReferenceNameRequestor nameRequestor) {
    MethodDeclaration fakeMethod =
      this.findAfter(startWith, scope, from, initializer.bodyEnd, MAX_LINE_COUNT, false, discouragedNames, nameRequestor);
    if (fakeMethod != null) fakeMethod.traverse(this, scope);
  }
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.ast.MethodDeclaration

      char[] startWith,
      AbstractMethodDeclaration methodDeclaration,
      int from,
      char[][] discouragedNames,
      UnresolvedReferenceNameRequestor nameRequestor) {
    MethodDeclaration fakeMethod =
      this.findAfter(startWith, methodDeclaration.scope, from, methodDeclaration.bodyEnd, MAX_LINE_COUNT, false, discouragedNames, nameRequestor);
    if (fakeMethod != null) fakeMethod.traverse(this, methodDeclaration.scope.classScope());
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.