Top Description Fields Constructors Methods
org.codehaus.commons.compiler.util.resource

public Class MapResourceCreator

extends Object
implements ResourceCreator
Class Inheritance
All Implemented Interfaces
org.codehaus.commons.compiler.util.resource.ResourceCreator
Imports
java.io.ByteArrayOutputStream, .IOException, .OutputStream, java.util.HashMap, .Map

Creates resources as byte arrays in a delegate java.util.Map.

Field Summary

Modifier and TypeField and Description
private final Map<String, byte[]>

Constructor Summary

AccessConstructor and Description
public
MapResourceCreator()

Auto-create the delegate Map.

public
MapResourceCreator(Map<String, byte[]>
String fileName => byte[] data
map
)

Method Summary

Modifier and TypeMethod and Description
public final OutputStream
createResource(final String
Designates the resource; typically structured by slashes ("/") like "com/foo/pkg/Bar.class"
resourceName
)

Implements org.codehaus.commons.compiler.util.resource.ResourceCreator.createResource.

Creates the designated resource.
public final boolean
deleteResource(String resourceName)

Implements org.codehaus.commons.compiler.util.resource.ResourceCreator.deleteResource.

Deletes the resource with the given name.
public final Map<String, byte[]>

Returns:

The String-to-byte[] map of the resources created
getMap
()

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

mapback to summary
private final Map<String, byte[]> map

Constructor Detail

MapResourceCreatorback to summary
public MapResourceCreator()

Auto-create the delegate Map.

MapResourceCreatorback to summary
public MapResourceCreator(Map<String, byte[]> map)
Parameters
map:Map<String, byte[]>

String fileName => byte[] data

Method Detail

createResourceback to summary
public final OutputStream createResource(final String resourceName)

Implements org.codehaus.commons.compiler.util.resource.ResourceCreator.createResource.

Doc from org.codehaus.commons.compiler.util.resource.ResourceCreator.createResource.

Creates the designated resource.

Parameters
resourceName:String

Designates the resource; typically structured by slashes ("/") like "com/foo/pkg/Bar.class"

Returns:OutputStream

Bytes written to this OutputStream are stored in the resource

Annotations
@Override
deleteResourceback to summary
public final boolean deleteResource(String resourceName)

Implements org.codehaus.commons.compiler.util.resource.ResourceCreator.deleteResource.

Doc from org.codehaus.commons.compiler.util.resource.ResourceCreator.deleteResource.

Deletes the resource with the given name.

Returns:boolean

false if the resource could not be deleted

Annotations
@Override
getMapback to summary
public final Map<String, byte[]> getMap()
Returns:Map<String, byte[]>

The String-to-byte[] map of the resources created