Class JavaFile


  • public class JavaFile
    extends JavaElement
    A Java source file being generated for output. Once the class is completely initialized, use the Object.toString() method to generate source code for it.
    • Method Detail

      • getPackageName

        public String getPackageName()
      • getImportManager

        public org.nuiton.eugene.java.extension.ImportsManager getImportManager()
      • getImportedType

        public String getImportedType​(Class<?> type)
      • getImportedType

        public String getImportedType​(String type)
      • getImports

        public String[] getImports()
      • getImportsList

        public List<String> getImportsList()
      • getSuperClass

        public String getSuperClass()
      • getInterfaces

        public List<String> getInterfaces()
      • isAbstractClass

        public boolean isAbstractClass()
      • getGenericType

        public String getGenericType()
      • getSuperGenericType

        public String getSuperGenericType()
      • isSuperclassIsJAXXObject

        public boolean isSuperclassIsJAXXObject()
      • getSimpleName

        public String getSimpleName()
      • addImport

        public void addImport​(String importString)
      • addImport

        public void addImport​(Class<?> importString)
      • setGenericType

        public void setGenericType​(String genericType)
      • setSuperClass

        public void setSuperClass​(String superClass)
      • addInterface

        public void addInterface​(String... canonicalNames)
      • setInterfaces

        public void setInterfaces​(List<String> interfaces)
      • addConstructor

        public void addConstructor​(JavaConstructor constructor)
      • addMethod

        public void addMethod​(JavaMethod method)
      • addField

        public void addField​(JavaField field)
      • addGetterMethod

        public JavaMethod addGetterMethod​(String id,
                                          int modifiers,
                                          String type,
                                          boolean override,
                                          boolean useOverride)
      • addAbstractGetterMethod

        public JavaMethod addAbstractGetterMethod​(String id,
                                                  int modifiers,
                                                  String type,
                                                  boolean override)
      • addOverrideGetterMethod

        public JavaMethod addOverrideGetterMethod​(String id,
                                                  int modifiers,
                                                  String type,
                                                  boolean override)
      • addField

        public void addField​(JavaField field,
                             boolean javaBean)
      • addSimpleField

        public void addSimpleField​(JavaField field)
      • setSuperclassIsJAXXObject

        public void setSuperclassIsJAXXObject​(boolean superclassIsJAXXObject)
      • setAbstractClass

        public void setAbstractClass​(boolean abstractClass)
      • setSuperGenericType

        public void setSuperGenericType​(String superGenericType)
      • addBodyCode

        public void addBodyCode​(String bodyCode)
      • simplifyCode

        public String simplifyCode​(String pattern,
                                   String... types)
        Try to use a simple type fro the given type and apply it on the given pattern.

        Example :

         type = java.io.File, pattern = new %s("");
         returns : new File("") or new java.io.File("") if importManager can
         not import java.io.File
         
        Parameters:
        types - the types to simplify
        pattern - the pattern where to apply simple types
        Returns:
        the input pattern with most simplest types
        Since:
        2.4
      • clear

        public void clear()
      • setSimpleName

        public void setSimpleName​(String simpleName)