|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectma.glasnost.orika.impl.generator.EclipseJdtCompiler
public class EclipseJdtCompiler
EclipseJdtCompiler leverages the eclipse jdt core to compile
source code provided in String format.
It can also make use of the source formatter tool to format source.
| Constructor Summary | |
|---|---|
EclipseJdtCompiler()
|
|
| Method Summary | |
|---|---|
void |
assertTypeAccessible(Class<?> type)
|
byte[] |
compile(String source,
String packageName,
String classSimpleName)
Compile and return the raw bytes of the class file. |
Class<?> |
compileAndLoad(String source,
String packageName,
String classSimpleName)
Compile and return the (generated) class. |
String |
formatSource(String code)
Format the source code using the Eclipse text formatter |
byte[] |
getBytes(String className)
Gets the raw bytes of the classFile that was defined for the given className by this compiler. |
Class<?> |
load(String className,
byte[] data)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public EclipseJdtCompiler()
| Method Detail |
|---|
public String formatSource(String code)
public void assertTypeAccessible(Class<?> type)
throws IllegalStateException
IllegalStateException
public Class<?> compileAndLoad(String source,
String packageName,
String classSimpleName)
throws ClassNotFoundException
source - packageName - classSimpleName -
ClassNotFoundException
public byte[] compile(String source,
String packageName,
String classSimpleName)
source - packageName - classSimpleName -
public Class<?> load(String className,
byte[] data)
throws ClassNotFoundException
ClassNotFoundExceptionpublic byte[] getBytes(String className)
className -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||