java.lang.Object
edu.university.ecs.lab.common.models.ir.Node
edu.university.ecs.lab.common.models.ir.Method
All Implemented Interfaces:
JsonSerializable
Direct Known Subclasses:
Endpoint

public class Method extends Node
Represents a method declaration in Java.
  • Field Details

    • parameters

      protected Set<Parameter> parameters
      Set of fields representing parameters
    • returnType

      protected String returnType
      Java return type of the method
    • microserviceName

      protected String microserviceName
      The microservice id that this method belongs to
    • annotations

      protected Set<Annotation> annotations
      Method definition level annotations
    • className

      protected String className
      The class id that this method belongs to
  • Constructor Details

    • Method

      public Method(String name, String packageAndClassName, Set<Parameter> parameters, String typeAsString, Set<Annotation> annotations, String microserviceName, String className)
    • Method

      public Method(com.github.javaparser.ast.body.MethodDeclaration methodDeclaration)
  • Method Details

    • toJsonObject

      public com.google.gson.JsonObject toJsonObject()
      Returns:
      a JsonObject representing this
    • parseParameters

      private Set<Parameter> parseParameters(com.github.javaparser.ast.NodeList<com.github.javaparser.ast.body.Parameter> parameters)
      Get set of parameters from node list
      Parameters:
      parameters - Node list of javaparser parameter objects
      Returns:
      set of parameter objects