Class ParserWithReflectUtilities

java.lang.Object
caseine.reflect.ParserWithReflectUtilities

public class ParserWithReflectUtilities extends Object
  • Constructor Details

    • ParserWithReflectUtilities

      public ParserWithReflectUtilities()
  • Method Details

    • equals

      public static boolean equals(com.github.javaparser.ast.type.Type parsedType, Class<?> javaType)
    • parse

      public static com.github.javaparser.ast.CompilationUnit parse(Class<?> aClass)
    • parse

      public static com.github.javaparser.ast.CompilationUnit parse(Path p)
    • find

      public static com.github.javaparser.ast.body.MethodDeclaration find(Class<?> c, String methodName, Class<?>... params)
      Get the parsed body of a method
      Parameters:
      c - the class where the method is
      methodName - the method name
      params - the method parameters
      Returns:
      the body of method in class c named methodName with params for parametres or null if it does not exist.
    • find

      public static com.github.javaparser.ast.body.ConstructorDeclaration find(Class<?> c, Class<?>... params)
      Parameters:
      c - the object class of the class whose the constructor body is needed
      params - the params of the constructor
      Returns:
      the body of constructor in class c with params as parameters or null if it does not exist.
    • findWithGeneric

      public static com.github.javaparser.ast.body.ConstructorDeclaration findWithGeneric(Class<?> c, String genericType, Class<?>... params)
      Parameters:
      c - the object class of the class whose the constructor body is needed
      params - the params of the constructor
      Returns:
      the body of constructor in class c with params as parameters or null if it does not exist.
    • find

      public static com.github.javaparser.ast.body.TypeDeclaration find(Class<?> c)
    • find

      public static com.github.javaparser.ast.body.MethodDeclaration find(Method method)
      Parameters:
      method - we want the body
      Returns:
      the body of method or null if it does not exist.
    • find

      public static com.github.javaparser.ast.body.ConstructorDeclaration find(Constructor constructor)
      Parameters:
      constructor - we want the body
      Returns:
      the body of constructor or null if it does not exist.
    • findWithGeneric

      public static com.github.javaparser.ast.body.ConstructorDeclaration findWithGeneric(Constructor constructor, String genericType)
      Parameters:
      constructor - we want the body
      Returns:
      the body of constructor or null if it does not exist.