Class MapResourceCreator
- java.lang.Object
-
- org.codehaus.janino.util.resource.MapResourceCreator
-
- All Implemented Interfaces:
ResourceCreator
public class MapResourceCreator extends Object implements ResourceCreator
Creates resources as byte arrays in a delegateMap.
-
-
Constructor Summary
Constructors Constructor Description MapResourceCreator()Auto-create the delegateMap.MapResourceCreator(Map<String,byte[]> map)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OutputStreamcreateResource(String resourceName)Create the designated resource.booleandeleteResource(String resourceName)Deletes the resource with the given name.Map<String,byte[]>getMap()
-
-
-
Method Detail
-
getMap
public final Map<String,byte[]> getMap()
- Returns:
- The
String-to-byte[]map of the resources created
-
createResource
public final OutputStream createResource(String resourceName)
Description copied from interface:ResourceCreatorCreate the designated resource.- Specified by:
createResourcein interfaceResourceCreator- Parameters:
resourceName- Designates the resource; typically structured by slashes ("/") like "com/foo/pkg/Bar.class"- Returns:
- Bytes written to this
OutputStreamare stored in the resource
-
deleteResource
public final boolean deleteResource(String resourceName)
Description copied from interface:ResourceCreatorDeletes the resource with the given name.- Specified by:
deleteResourcein interfaceResourceCreator- Returns:
falseif the resource could not be deleted
-
-