org.ckkloverdos.resource
Interface IResourceContext

All Known Implementing Classes:
ClassLoaderResourceContext, CompositeResourceContext, FileResourceContext, ResourseContextSkeleton

public interface IResourceContext

Represents a context where resources may live. Class loaders and file systems provide two such (overlapping actually) contexts.

Contexts may form hierarchies (trees), as designated by the getParent() method. Resources are first resolved locally in a context, and if not found then the parent context is consulted.

Author:
Christos KK Loverdos
See Also:
FileResourceContext, ClassLoaderResourceContext

Method Summary
 IResource getLocalResource(java.lang.String name)
          Returns the resource with the given name that lives in this context, without consulting the parent context on failure.
 IResourceContext getParent()
          Returns the parent context.
 IResource getResource(java.lang.String name)
          Returns the resource with the given name or null if not found either in this context or in the parent context.
 

Method Detail

getParent

IResourceContext getParent()
Returns the parent context.


getResource

IResource getResource(java.lang.String name)
Returns the resource with the given name or null if not found either in this context or in the parent context.

Parameters:
name -
Returns:
the resource if found or EmptyResource.INSTANCE otherwise.

getLocalResource

IResource getLocalResource(java.lang.String name)
Returns the resource with the given name that lives in this context, without consulting the parent context on failure.

Parameters:
name -
Returns:
the resource if found or EmptyResource.INSTANCE otherwise.


Copyright © 1999-2007 Christos KK Loverdos. All Rights Reserved.