Web Site

org.codehaus.janino.util.resource
Class MapResourceCreator

java.lang.Object
  extended by org.codehaus.janino.util.resource.MapResourceCreator
All Implemented Interfaces:
ResourceCreator

public class MapResourceCreator
extends java.lang.Object
implements ResourceCreator

Creates resources as byte arrays in a delegate Map.


Constructor Summary
MapResourceCreator()
          Auto-create the delegate Map.
MapResourceCreator(java.util.Map map)
           
 
Method Summary
 java.io.OutputStream createResource(java.lang.String resourceName)
          Create the designated resource.
 boolean deleteResource(java.lang.String resourceName)
          Deletes the resource with the given name.
 java.util.Map getMap()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MapResourceCreator

public MapResourceCreator()
Auto-create the delegate Map.


MapResourceCreator

public MapResourceCreator(java.util.Map map)
Method Detail

getMap

public java.util.Map getMap()

createResource

public java.io.OutputStream createResource(java.lang.String resourceName)
                                    throws java.io.IOException
Description copied from interface: ResourceCreator
Create the designated resource.

Specified by:
createResource in interface ResourceCreator
Parameters:
resourceName - Designates the resource; typically structured by slashes ("/") like "com/foo/pkg/Bar.class"
Returns:
bytes written to this OutputStream are stored in the resource
Throws:
java.io.IOException - Problems creating the resource

deleteResource

public boolean deleteResource(java.lang.String resourceName)
Description copied from interface: ResourceCreator
Deletes the resource with the given name.

Specified by:
deleteResource in interface ResourceCreator
Returns:
false if the resource could not be deleted

Web Site