Class w3c.jigsaw.resources.FilteredResource
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class w3c.jigsaw.resources.FilteredResource

java.lang.Object
   |
   +----w3c.jigsaw.resources.AttributeHolder
           |
           +----w3c.jigsaw.resources.Resource
                   |
                   +----w3c.jigsaw.resources.HTTPResource
                           |
                           +----w3c.jigsaw.resources.FilteredResource

public class FilteredResource
extends HTTPResource
Filtered resources. A filtered resource is a resource that can be filtered through any filters. Filters are trigered at three points during request processing:
See Also:
ResourceFilter

Variable Index

 o filters
Our list of filters.

Constructor Index

 o FilteredResource()

Method Index

 o definesAttribute(int)
Does this resource or one of its filters define the given attribute.
 o getClone(Object[])
Clone this filtered resource.
 o getFilters()
Get our whole list of filters.
 o getFilters(Class, ResourceFilter[])
Get the list of filters of this class.
 o getValue(int, Object)
Filters can supply part of the attributes value for a resource.
 o lookup(LookupState, LookupResult)
Register our filters, if any in the lookup result object.
 o pickle(DataOutputStream)
Pickle a filtered resource.
 o registerFilter(ResourceFilter, Hashtable)
Register a new filter to this resource.
 o unpickleInstance(DataInputStream, Hashtable)
Unpickle a filtered resource.
 o unregisterFilter(ResourceFilter)
Unregister a filter to this target.

Variables

 o filters
  protected ResourceFilter filters[]
Our list of filters.

Constructors

 o FilteredResource
  public FilteredResource()

Methods

 o getClone
  public synchronized Object getClone(Object values[])
Clone this filtered resource. The filters that are plugged on the resource get cloned too.
Overrides:
getClone in class AttributeHolder
 o getFilters
  public synchronized ResourceFilter[] getFilters()
Get our whole list of filters.
 o getFilters
  public synchronized int getFilters(Class cls,
                                     ResourceFilter into[])
Get the list of filters of this class.
Parameters:
cls - The class of filters requested.
into - The array of resource filters to save found filters.
Returns:
The number of filters found.
 o registerFilter
  public synchronized void registerFilter(ResourceFilter filter,
                                          Hashtable defs)
Register a new filter to this resource. This method register a new filter to the this filtered resource. The provided filter should be an uninitialized ResourceFilter instance.
Parameters:
The - uninitialized filter.
 o unregisterFilter
  public synchronized void unregisterFilter(ResourceFilter filter)
Unregister a filter to this target.
Parameters:
filter - The filter to unregister.
 o definesAttribute
  public synchronized boolean definesAttribute(int idx) throws IllegalAttributeAccess
Does this resource or one of its filters define the given attribute.
Parameters:
idx - The attribute index.
Returns:
A boolean true if attribute is defined.
Overrides:
definesAttribute in class AttributeHolder
 o getValue
  public synchronized Object getValue(int idx,
                                      Object def) throws IllegalAttributeAccess
Filters can supply part of the attributes value for a resource. This method lookup the current resource for an attribute value, and than examine all its filters, to look for a filter-supplied value.
Parameters:
idx - The index of the queried attribute.
def - The default return value.
Returns:
The attribute value, or the provided default value if undef.
Overrides:
getValue in class AttributeHolder
 o lookup
  public boolean lookup(LookupState ls,
                        LookupResult lr) throws HTTPException
Register our filters, if any in the lookup result object. Sub-classes of the FilteredResource class should either register their filters themselves, or call their super method. The latest way is prefered, of course.
Parameters:
ls - The current lookup state.
lr - The lookup result, being constructed.
Returns:
A boolean, true if lookup has found a terminal node, false otherwise. In the latter case, the caller should make sure to continue the lookup process.
Throws: HTTPException
If something went wrong.
Overrides:
lookup in class HTTPResource
 o pickle
  public synchronized void pickle(DataOutputStream out) throws IOException
Pickle a filtered resource. Pickle the resource itself, along with its associated filters.
Parameters:
out - The data output stream to pickle to.
Overrides:
pickle in class AttributeHolder
 o unpickleInstance
  public AttributeHolder unpickleInstance(DataInputStream in,
                                          Hashtable defs) throws IOException
Unpickle a filtered resource.
Parameters:
in - The input stream to unpickle from.
defs - The default attributes for the unpickled resource.
Overrides:
unpickleInstance in class AttributeHolder

All Packages  Class Hierarchy  This Package  Previous  Next  Index