Class JavaFileObjects
- java.lang.Object
-
- org.codehaus.commons.compiler.jdk.util.JavaFileObjects
-
public final class JavaFileObjects extends java.lang.Object
Utility methods related toJavaFileObject
s.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
JavaFileObjects.ByteArrayJavaFileObject
Byte array-based implementation ofJavaFileObject
.static class
JavaFileObjects.ResourceJavaFileObject
Byte array-based implementation ofJavaFileObject
.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static javax.tools.JavaFileObject
fromResource(Resource resource, java.lang.String className, javax.tools.JavaFileObject.Kind kind, java.nio.charset.Charset charset)
Wraps aResource
as aJavaFileObject
.static javax.tools.JavaFileObject
fromResourceCreator(ResourceCreator resourceCreator, java.lang.String resourceName, javax.tools.JavaFileObject.Kind kind, java.nio.charset.Charset charset)
static javax.tools.JavaFileObject
fromUrl(java.net.URL url, java.lang.String name, javax.tools.JavaFileObject.Kind kind)
static JavaFileObjects.ByteArrayJavaFileObject
inMemory(java.lang.String className, javax.tools.JavaFileObject.Kind kind2, java.nio.charset.Charset charset)
-
-
-
Method Detail
-
fromResource
public static javax.tools.JavaFileObject fromResource(Resource resource, java.lang.String className, javax.tools.JavaFileObject.Kind kind, java.nio.charset.Charset charset)
Wraps aResource
as aJavaFileObject
.
-
fromUrl
public static javax.tools.JavaFileObject fromUrl(java.net.URL url, java.lang.String name, javax.tools.JavaFileObject.Kind kind)
- Returns:
- The resource designated by the url, wrapped in a
JavaFileObject
-
inMemory
public static JavaFileObjects.ByteArrayJavaFileObject inMemory(java.lang.String className, javax.tools.JavaFileObject.Kind kind2, java.nio.charset.Charset charset)
- Returns:
- A
JavaFileObject
that stores its data in an internal byte array
-
fromResourceCreator
public static javax.tools.JavaFileObject fromResourceCreator(ResourceCreator resourceCreator, java.lang.String resourceName, javax.tools.JavaFileObject.Kind kind, java.nio.charset.Charset charset)
- Parameters:
resourceName
- E.g."com/foo/pkg/Bar.class"
- Returns:
- A
JavaFileObject
that stores data through the given resourceCreator and resourceName
-
-