|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.objectweb.jac.ide.CodeGeneration
Constructor Summary | |
CodeGeneration()
|
Method Summary | |
static Errors |
compile(Project project)
|
static Errors |
compile(Projects projects)
|
static Errors |
compileProjectCode(Project project)
Run compilation command for a project. |
static void |
createApplicationCode(Project prj,
Application app,
File baseDir)
Generate code for an application ( Run and aspect
configurations) |
static void |
createAspectCode(Project prj,
Aspect a,
File baseDir,
String ppath)
Generate java source code for an aspect. |
static void |
createClassCode(Project prj,
Class c,
File baseDir,
String ppath)
Generate the java source code of a class. |
static void |
createEnumCode(EnumeratedType enum,
File dir)
Generate java sources for an enumerated type. |
static void |
createFieldCode(LineNumberWriter output,
Map lineNumbers,
Field field,
boolean isInterface)
Generate the code for a field, its getter and its setter |
static void |
createJAR(Project project)
Creates a JAR file containing all the .class files |
static void |
createJavaCode(Project project,
String baseDir)
Generate java sources for a project |
static void |
createManifest(Project project)
|
static void |
createMethodCode(LineNumberWriter output,
Map lineNumbers,
Method method,
boolean isInterface)
Generate the code for a method |
static void |
createPackageCode(Project prj,
Package pkg,
File baseDir,
String ppath)
Generate code for the classes of a package and its subpackages. |
static void |
createProjectCode(Project project,
String baseDir)
Generate code for all the classes and aspects of a project. |
static void |
createRelationCode(LineNumberWriter output,
Map lineNumbers,
RelationLink rel,
RelationRole role,
boolean isInterface)
|
static void |
documentProjectCode(Project project,
String baseDir)
Generated javadoc documentation for a project |
static Errors |
generateAndCompile(Project project)
|
static Errors |
generateAndCompile(Projects projects)
|
static Errors |
generateAndCompileProjectCode(Project project,
String baseDir)
|
static void |
generateAndReload(AspectConfiguration ac)
|
static void |
generateCode(AspectConfiguration ac)
|
static void |
generateCode(Class cl)
|
static void |
generateCode(Package pkg)
|
static void |
generateCode(Project project)
|
static void |
generateCode(Projects projects)
|
static void |
generateJavaCode(Project project)
|
static String |
getAdderName(String fieldName)
Returns the adder's name that corresponds to the given collection's name. |
static Map |
getClassLineNumbers(Class c)
Returns a Map giving the line number of methods in the generated java source file. |
static String |
getClearerName(String fieldName)
Returns the clearer's name that corresponds to the given collection's name. |
static String |
getGetterName(String fieldName)
Returns the getter's name that corresponds to the given field's name. |
static String |
getRemoverName(String fieldName)
Returns the remover's name that corresponds to the given collection's name. |
static String |
getSetterName(String fieldName)
Returns the setter's name that corresponds to the given field's name. |
static void |
joinFullNames(Writer out,
Collection items,
String separator)
Write the full names of the items of a collection, separated by a string. |
static String |
keyWrapper(Typed keyField,
String value)
|
static String |
translateParam(ConfigItem config)
Return a string representing the call of method on ModelElement element with param param |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public CodeGeneration()
Method Detail |
public static void createProjectCode(Project project, String baseDir) throws org.objectweb.jac.ide.CannotGenerateException, IOException
project
- the projectbaseDir
- base directory where to put generated files
org.objectweb.jac.ide.CannotGenerateException
IOException
public static void createJavaCode(Project project, String baseDir) throws org.objectweb.jac.ide.CannotGenerateException, IOException, FileNotFoundException
project
- a projectbaseDir
- directory where to generate files
org.objectweb.jac.ide.CannotGenerateException
IOException
FileNotFoundException
public static void createEnumCode(EnumeratedType enum, File dir) throws IOException
enum
- an enumerated typedir
- directory where to generate the file
IOException
public static void createApplicationCode(Project prj, Application app, File baseDir) throws org.objectweb.jac.ide.CannotGenerateException, IOException
Run
and aspect
configurations)
prj
- the projectapp
- the applicationbaseDir
- the base directory where to put the generated files
org.objectweb.jac.ide.CannotGenerateException
IOException
public static void createPackageCode(Project prj, Package pkg, File baseDir, String ppath) throws FileNotFoundException, IOException
prj
- the projectpkg
- the packagebaseDir
- directory where to put the files of the packageppath
- java package path (myapp.mypackage
for instance)
FileNotFoundException
IOException
public static Map getClassLineNumbers(Class c)
public static void createClassCode(Project prj, Class c, File baseDir, String ppath)
prj
- the projectc
- the classbaseDir
- directory where to put the generated fileppath
- java package path of the classpublic static void createFieldCode(LineNumberWriter output, Map lineNumbers, Field field, boolean isInterface) throws IOException
output
- where to write generated codelineNumbers
- line numbers information will be stored in this mapfield
- the field to generate code forisInterface
- wether the field belongs to an interface
IOException
public static void createRelationCode(LineNumberWriter output, Map lineNumbers, RelationLink rel, RelationRole role, boolean isInterface) throws IOException
IOException
public static void createMethodCode(LineNumberWriter output, Map lineNumbers, Method method, boolean isInterface) throws IOException
output
- where to write generated codelineNumbers
- method
- the method to generate code forisInterface
- wether the method belongs to an interface
IOException
public static void createAspectCode(Project prj, Aspect a, File baseDir, String ppath)
prj
- the projecta
- the aspectbaseDir
- directory where to put the fileppath
- java package path of the aspect componentpublic static String getSetterName(String fieldName)
public static String getGetterName(String fieldName)
public static String getAdderName(String fieldName)
public static String getClearerName(String fieldName)
public static String getRemoverName(String fieldName)
public static String keyWrapper(Typed keyField, String value)
public static Errors generateAndCompileProjectCode(Project project, String baseDir) throws org.objectweb.jac.ide.CannotGenerateException, org.objectweb.jac.ide.CannotCompileException, IOException, InterruptedException
org.objectweb.jac.ide.CannotGenerateException
org.objectweb.jac.ide.CannotCompileException
IOException
InterruptedException
public static Errors compileProjectCode(Project project) throws org.objectweb.jac.ide.CannotCompileException, IOException, InterruptedException
project
- the project to compile
org.objectweb.jac.ide.CannotCompileException
IOException
InterruptedException
public static void documentProjectCode(Project project, String baseDir)
public static final String translateParam(ConfigItem config)
config
- the configItem of method
public static void joinFullNames(Writer out, Collection items, String separator) throws IOException
out
- where to writeitems
- a collection of ModelElementsseparator
- use this string as a separator
IOException
public static void generateCode(Projects projects) throws Exception
Exception
public static Errors compile(Projects projects) throws Exception
Exception
public static Errors generateAndCompile(Projects projects) throws Exception
Exception
public static void generateCode(Package pkg) throws Exception
Exception
public static void generateCode(Class cl) throws Exception
Exception
public static void generateCode(Project project) throws Exception
Exception
public static void generateJavaCode(Project project) throws Exception
Exception
public static Errors compile(Project project) throws org.objectweb.jac.ide.CannotCompileException, IOException, InterruptedException
org.objectweb.jac.ide.CannotCompileException
IOException
InterruptedException
public static Errors generateAndCompile(Project project) throws org.objectweb.jac.ide.CannotGenerateException, org.objectweb.jac.ide.CannotCompileException, IOException, InterruptedException, Exception
org.objectweb.jac.ide.CannotGenerateException
org.objectweb.jac.ide.CannotCompileException
IOException
InterruptedException
Exception
public static void createJAR(Project project) throws IOException
IOException
public static void createManifest(Project project) throws IOException
IOException
public static void generateCode(AspectConfiguration ac) throws Exception
Exception
public static void generateAndReload(AspectConfiguration ac) throws Throwable
Throwable
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |