Class JavaCodeSerializer

  • All Implemented Interfaces:

    public class JavaCodeSerializerextends Objectimplements Serializer
    serialization of Reflections to java code

    serializes types and types elements into interfaces respectively to fully qualified name,

    for example:

     public interface MyTestModelStore {        public interface org extends IPackage {            public interface reflections extends IPackage {                        public interface TestModel$AC1 extends IClass {}                        public interface TestModel$C4 extends IClass {                                public interface f1 extends IField {}                                public interface m1 extends IMethod {}                                public interface m1_int_java$lang$String$$$$ extends IMethod {}        ... } 

    use the different resolve methods to resolve the serialized element into Class, Field or Method. for example:

      Class&#60? extends IMethod> imethod =$C4.m1.class;  Method method = JavaCodeSerializer.resolve(imethod); 

    depends on Reflections configured with TypeElementsScanner

    the save(org.reflections.Reflections, String) method filename should be in the pattern: path/path/path/package.package.classname

    • Constructor Detail

      • JavaCodeSerializer

        public JavaCodeSerializer()
    • Method Detail

      • save

        public File save(Reflections reflections,        String name)
        name should be in the pattern: path/path/path/package.package.classname, for example
        would create class MyStore in package in the path /data/projects/my/src/main/java
        Specified by:
        save in interface Serializer
      • resolveClass

        public static Class<?> resolveClass(Class aClass)
      • resolveField

        public static Field resolveField(Class aField)
      • resolveAnnotation

        public static Annotation resolveAnnotation(Class annotation)
      • resolveMethod

        public static Method resolveMethod(Class aMethod)

Copyright © 2015. All rights reserved.

Add the Maven Dependecy to your project: maven dependecy for com.amazonaws : aws-java-sdk : 1.3.14