janino.net

org.codehaus.janino.util.resource
Class ResourceFinder

  extended by org.codehaus.janino.util.resource.ResourceFinder
Direct Known Subclasses:
FileResourceFinder, MapResourceFinder, MultiResourceFinder, ZipFileResourceFinder

public abstract class ResourceFinder
extends

Finds a resource by name.

Notice that there is a symmetrical concept ResourceCreator that creates resources for writing.

See Also:
ResourceCreator

Field Summary
static ResourceFinder EMPTY_RESOURCE_FINDER
          This one's useful when a resource finder is required, but cannot be created for some reason.
 
Constructor Summary
ResourceFinder()
           
 
Method Summary
abstract  Resource findResource( resourceName)
          Find a resource by name and return it as a Resource object.
  findResourceAsStream( resourceName)
          Find a resource by name and open it for reading.
 
Methods inherited from class java.lang.
, , , , , , , , , ,
 

Field Detail

EMPTY_RESOURCE_FINDER

public static final ResourceFinder EMPTY_RESOURCE_FINDER
This one's useful when a resource finder is required, but cannot be created for some reason.

Constructor Detail

ResourceFinder

public ResourceFinder()
Method Detail

findResourceAsStream

public final  findResourceAsStream( resourceName)
                                       throws 
Find a resource by name and open it for reading.

Parameters:
resourceName - Designates the resource; typically structured by slashes ("/") like "com/foo/pkg/Bar.class"
Returns:
null if the resource could not be found
Throws:
- The resource was found, but there are problems opening it

findResource

public abstract Resource findResource( resourceName)
Find a resource by name and return it as a Resource object.

Parameters:
resourceName - Designates the resource; typically structured by slashes ("/") like "com/foo/pkg/Bar.class"
Returns:
null if the resource could not be found

janino.net