Class Generator

java.lang.Object
net.binis.codegen.generation.core.Generator

public class Generator extends Object
  • Field Details

  • Method Details

    • generateCodeForClass

      public static void generateCodeForClass(com.github.javaparser.ast.CompilationUnit parser)
    • generateCodeForClass

      public static void generateCodeForClass(com.github.javaparser.ast.CompilationUnit parser, PrototypeDescription<com.github.javaparser.ast.body.ClassOrInterfaceDeclaration> prsd)
    • getElementName

      protected static String getElementName(com.github.javaparser.ast.Node node)
    • getElementName

      protected static String getElementName(Element element)
    • generateCodeForPrototype

      public static void generateCodeForPrototype(com.github.javaparser.ast.CompilationUnit parser, PrototypeDescription<com.github.javaparser.ast.body.ClassOrInterfaceDeclaration> prsd, com.github.javaparser.ast.body.TypeDeclaration<?> type, List<net.binis.codegen.objects.Pair<com.github.javaparser.ast.expr.AnnotationExpr,Structures.PrototypeDataHandler>> prototypes)
    • calcInterfacePackage

      protected static String calcInterfacePackage(PrototypeDescription<com.github.javaparser.ast.body.ClassOrInterfaceDeclaration> prsd)
    • getCodeAnnotations

      public static Optional<List<net.binis.codegen.objects.Pair<com.github.javaparser.ast.expr.AnnotationExpr,Structures.PrototypeDataHandler>>> getCodeAnnotations(com.github.javaparser.ast.body.BodyDeclaration<?> type)
    • getCodeAnnotationProperties

      public static Optional<PrototypeData> getCodeAnnotationProperties(com.github.javaparser.ast.body.BodyDeclaration<?> type)
    • getCodeAnnotations

      public static Optional<Annotation> getCodeAnnotations(Class cls)
    • getStringValue

      protected static String getStringValue(com.github.javaparser.ast.expr.Expression p)
    • handleCodeImplementationInjection

      protected static void handleCodeImplementationInjection(Element element, com.github.javaparser.ast.body.MethodDeclaration method, com.github.javaparser.ast.body.MethodDeclaration original)
    • handleForAnnotations

      protected static com.github.javaparser.ast.body.MethodDeclaration handleForAnnotations(com.github.javaparser.ast.CompilationUnit unit, com.github.javaparser.ast.body.MethodDeclaration method, boolean isClass)
    • handleDefaultMethodBody

      protected static boolean handleDefaultMethodBody(PrototypeDescription<com.github.javaparser.ast.body.ClassOrInterfaceDeclaration> parse, com.github.javaparser.ast.Node node, boolean isGetter, com.github.javaparser.ast.body.MethodDeclaration declaration)
    • handleDefaultInterfaceMethodBody

      protected static boolean handleDefaultInterfaceMethodBody(PrototypeDescription<com.github.javaparser.ast.body.ClassOrInterfaceDeclaration> parse, com.github.javaparser.ast.Node node, boolean isGetter, com.github.javaparser.ast.body.MethodDeclaration declaration)
    • getProperties

      public static Structures.PrototypeDataHandler getProperties(com.github.javaparser.ast.expr.AnnotationExpr prototype)
    • checkEnrichers

      public static void checkEnrichers(List<PrototypeEnricher> list, Class enricher)
    • handleType

      public static String handleType(com.github.javaparser.ast.body.ClassOrInterfaceDeclaration source, com.github.javaparser.ast.body.ClassOrInterfaceDeclaration destination, com.github.javaparser.ast.type.Type type)
    • handleType

      public static String handleType(com.github.javaparser.ast.body.ClassOrInterfaceDeclaration source, com.github.javaparser.ast.body.ClassOrInterfaceDeclaration destination, com.github.javaparser.ast.type.Type type, Map<String,PrototypeDescription<com.github.javaparser.ast.body.ClassOrInterfaceDeclaration>> prototypeMap)
    • handleType

      public static String handleType(com.github.javaparser.ast.CompilationUnit source, com.github.javaparser.ast.CompilationUnit destination, com.github.javaparser.ast.type.Type type)
    • handleType

      public static String handleType(com.github.javaparser.ast.CompilationUnit source, com.github.javaparser.ast.CompilationUnit destination, com.github.javaparser.ast.type.Type type, Map<String,PrototypeDescription<com.github.javaparser.ast.body.ClassOrInterfaceDeclaration>> prototypeMap)
    • handleGenericTypes

      public static List<String> handleGenericTypes(com.github.javaparser.ast.CompilationUnit source, com.github.javaparser.ast.CompilationUnit destination, com.github.javaparser.ast.type.ClassOrInterfaceType type, Map<String,PrototypeDescription<com.github.javaparser.ast.body.ClassOrInterfaceDeclaration>> prototypeMap)
    • getGenericsList

      public static List<net.binis.codegen.objects.Pair<String,Boolean>> getGenericsList(com.github.javaparser.ast.CompilationUnit source, com.github.javaparser.ast.CompilationUnit destination, com.github.javaparser.ast.type.ClassOrInterfaceType type, boolean isCollection)
    • handleType

      public static String handleType(com.github.javaparser.ast.CompilationUnit source, com.github.javaparser.ast.CompilationUnit destination, String type, boolean embedded)
    • handleType

      public static String handleType(com.github.javaparser.ast.CompilationUnit source, com.github.javaparser.ast.CompilationUnit destination, String type, boolean embedded, Map<String,PrototypeDescription<com.github.javaparser.ast.body.ClassOrInterfaceDeclaration>> prototypeMap)
    • discoverType

      protected static com.github.javaparser.ast.type.Type discoverType(Method method, boolean genericMethod, com.github.javaparser.ast.body.FieldDeclaration field)
    • addFieldFromSetter

      protected static PrototypeField addFieldFromSetter(Structures.Parsed<com.github.javaparser.ast.body.ClassOrInterfaceDeclaration> parsed, com.github.javaparser.ast.body.ClassOrInterfaceDeclaration spec, Method method, Map<String,com.github.javaparser.ast.type.Type> generic)
    • addGetter

      public static void addGetter(com.github.javaparser.ast.body.ClassOrInterfaceDeclaration type, com.github.javaparser.ast.body.ClassOrInterfaceDeclaration spec, com.github.javaparser.ast.body.MethodDeclaration declaration, boolean isClass, PrototypeField field)
    • addSetter

      public static void addSetter(com.github.javaparser.ast.body.ClassOrInterfaceDeclaration type, com.github.javaparser.ast.body.ClassOrInterfaceDeclaration spec, com.github.javaparser.ast.body.MethodDeclaration declaration, boolean isClass, PrototypeField field)
    • addMethod

      public static void addMethod(com.github.javaparser.ast.body.ClassOrInterfaceDeclaration spec, Method declaration, Map<String,String> signature)
    • generateCodeForEnum

      public static PrototypeDescription<?> generateCodeForEnum(com.github.javaparser.ast.CompilationUnit declarationUnit, PrototypeDescription<?> prsd, com.github.javaparser.ast.body.TypeDeclaration<?> type, List<net.binis.codegen.objects.Pair<com.github.javaparser.ast.expr.AnnotationExpr,Structures.PrototypeDataHandler>> prototype)
    • generateCodeForConstants

      public static com.github.javaparser.ast.CompilationUnit generateCodeForConstants()
    • generateCodeForElements

      public static void generateCodeForElements(PrototypeDescription<com.github.javaparser.ast.body.ClassOrInterfaceDeclaration> prsd)