Class ClassFile
- java.lang.Object
-
- javax.tools.SimpleJavaFileObject
-
- org.glassfish.jersey.examples.reload.compiler.ClassFile
-
- All Implemented Interfaces:
FileObject,JavaFileObject
public class ClassFile extends SimpleJavaFileObject
Class file representation.- Author:
- Jakub Podlesak
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface javax.tools.JavaFileObject
JavaFileObject.Kind
-
-
Field Summary
-
Fields inherited from class javax.tools.SimpleJavaFileObject
kind, uri
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]getByteCode()Returns byte code representation of the class after the class has been compiled.StringgetClassName()Getter for class name associated with this class file.OutputStreamopenOutputStream()-
Methods inherited from class javax.tools.SimpleJavaFileObject
delete, getAccessLevel, getCharContent, getKind, getLastModified, getName, getNestingKind, isNameCompatible, openInputStream, openReader, openWriter, toString, toUri
-
-
-
-
Constructor Detail
-
ClassFile
public ClassFile(String className) throws URISyntaxException
Creates a new class file holder.- Parameters:
className- class name.- Throws:
URISyntaxException- in case given class name could not be represented as an URI.
-
-
Method Detail
-
getClassName
public String getClassName()
Getter for class name associated with this class file.- Returns:
- class name.
-
openOutputStream
public OutputStream openOutputStream() throws IOException
- Specified by:
openOutputStreamin interfaceFileObject- Overrides:
openOutputStreamin classSimpleJavaFileObject- Throws:
IOException
-
getByteCode
public byte[] getByteCode()
Returns byte code representation of the class after the class has been compiled.- Returns:
- compiled byte code of the class.
-
-