Package org.codehaus.commons.compiler.jdk.util

# Class JavaFileObjects

java.lang.Object
org.codehaus.commons.compiler.jdk.util.JavaFileObjects

public final class JavaFileObjects extends Object
Utility methods related to `JavaFileObject`s.

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static interface`
`JavaFileObjects.ByteArrayJavaFileObject`
Byte array-based implementation of `JavaFileObject`.
`static final class`
`JavaFileObjects.ResourceJavaFileObject`
Byte array-based implementation of `JavaFileObject`.

## Method Summary

Modifier and Type
Method
Description
`static JavaFileObject`
`fromResource(Resource resource, String className, JavaFileObject.Kind kind, Charset charset)`
Wraps a `Resource` as a `JavaFileObject`.
`static JavaFileObject`
`fromResourceCreator(ResourceCreator resourceCreator, String resourceName, JavaFileObject.Kind kind, Charset charset)`
`static JavaFileObject`
`fromUrl(URL url, String name, JavaFileObject.Kind kind)`
`static JavaFileObjects.ByteArrayJavaFileObject`
`inMemory(String className, JavaFileObject.Kind kind2, Charset charset)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Method Details

### fromResource

public static JavaFileObject fromResource(Resource resource, String className, JavaFileObject.Kind kind, Charset charset)
Wraps a `Resource` as a `JavaFileObject`.

### fromUrl

public static JavaFileObject fromUrl(URL url, String name, JavaFileObject.Kind kind)

Returns:
  The resource designated by the url, wrapped in a `JavaFileObject`

### inMemory

public static JavaFileObjects.ByteArrayJavaFileObject inMemory(String className, JavaFileObject.Kind kind2, Charset charset)

Returns:
  A `JavaFileObject` that stores its data in an internal byte array

### fromResourceCreator

public static JavaFileObject fromResourceCreator(ResourceCreator resourceCreator, String resourceName, JavaFileObject.Kind kind, Charset charset)

Parameters:
  `resourceName` - E.g. `"com/foo/pkg/Bar.class"`
Returns:
  A `JavaFileObject` that stores data through the given resourceCreator and resourceName