Search in sources :

Example 1 with Parameter

use of com.github.javaparser.ast.body.Parameter in project libgdx by libgdx.

the class RobustJavaMethodParser method createMethod.

private JavaMethod createMethod(MethodDeclaration method) {
    String className = classStack.peek().getName();
    String name = method.getName();
    boolean isStatic = ModifierSet.hasModifier(method.getModifiers(), ModifierSet.STATIC);
    String returnType = method.getType().toString();
    ArrayList<Argument> arguments = new ArrayList<Argument>();
    if (method.getParameters() != null) {
        for (Parameter parameter : method.getParameters()) {
            arguments.add(new Argument(getArgumentType(parameter), parameter.getId().getName()));
        }
    }
    return new JavaMethod(className, name, isStatic, returnType, null, arguments, method.getBeginLine(), method.getEndLine());
}
Also used : ArrayList(java.util.ArrayList) Parameter(com.github.javaparser.ast.body.Parameter)

Aggregations

Parameter (com.github.javaparser.ast.body.Parameter)1 ArrayList (java.util.ArrayList)1