org.apache.tapestry.asset
Class ClasspathAssetFactory

java.lang.Object
  extended by org.apache.tapestry.asset.ClasspathAssetFactory
All Implemented Interfaces:
AssetFactory

public class ClasspathAssetFactory
extends java.lang.Object
implements AssetFactory

Creates instances of PrivateAsset, which are the holders of classpath: resources.

Since:
4.0
Author:
Howard M. Lewis Ship

Constructor Summary
ClasspathAssetFactory()
           
 
Method Summary
 IAsset createAbsoluteAsset(java.lang.String path, java.util.Locale locale, org.apache.hivemind.Location location)
          Creates a new asset relative to the root of the domain defined by the type of asset.
 IAsset createAsset(org.apache.hivemind.Resource resource, org.apache.hivemind.Location location)
          Creates a new asset based on a known resource.
 IAsset createAsset(org.apache.hivemind.Resource baseResource, java.lang.String path, java.util.Locale locale, org.apache.hivemind.Location location)
          Creates a new asset relative to an existing asset.
 void setAssetService(IEngineService assetService)
           
 void setClassResolver(org.apache.hivemind.ClassResolver classResolver)
           
 void setLocalizer(ResourceLocalizer localizer)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClasspathAssetFactory

public ClasspathAssetFactory()
Method Detail

createAsset

public IAsset createAsset(org.apache.hivemind.Resource baseResource,
                          java.lang.String path,
                          java.util.Locale locale,
                          org.apache.hivemind.Location location)
Description copied from interface: AssetFactory
Creates a new asset relative to an existing asset.

Specified by:
createAsset in interface AssetFactory
Parameters:
baseResource - the base resource from which an asset path may be calculated. Each type of asset is linked to a particular implemenation of Resource, and generates a corresponding implementation of IAsset.
path - the path relative to the resource (if no leading slash), or an absolute path within the domain of the asset type (i.e, within the classpath, or within the web application).
locale - the desired locale of the asset; the closest match will be used.
location - the location to be associated with the returned asset, or null to not attempt to localize the asset

createAbsoluteAsset

public IAsset createAbsoluteAsset(java.lang.String path,
                                  java.util.Locale locale,
                                  org.apache.hivemind.Location location)
Description copied from interface: AssetFactory
Creates a new asset relative to the root of the domain defined by the type of asset.

Specified by:
createAbsoluteAsset in interface AssetFactory
Parameters:
path - the absolute path for the resource
locale - the locale to localize the asset to, or null for no localization
location - the location used to report any errors
Returns:
an IAsset

createAsset

public IAsset createAsset(org.apache.hivemind.Resource resource,
                          org.apache.hivemind.Location location)
Description copied from interface: AssetFactory
Creates a new asset based on a known resource.

Specified by:
createAsset in interface AssetFactory

setAssetService

public void setAssetService(IEngineService assetService)

setClassResolver

public void setClassResolver(org.apache.hivemind.ClassResolver classResolver)

setLocalizer

public void setLocalizer(ResourceLocalizer localizer)