org.apache.tapestry.asset
Class AssetSourceImpl

java.lang.Object
  extended by org.apache.tapestry.asset.AssetSourceImpl
All Implemented Interfaces:
AssetSource

public class AssetSourceImpl
extends Object
implements AssetSource

Implementation of the AssetSource service interface.


Constructor Summary
AssetSourceImpl()
           
 
Method Summary
 IAsset findAsset(org.apache.hivemind.Resource base, IComponentSpecification spec, String path, Locale locale, org.apache.hivemind.Location location)
          Finds an asset relative to the specified base resources OR IComponentSpecification passed in.
 IAsset findAsset(org.apache.hivemind.Resource base, String path, Locale locale, org.apache.hivemind.Location location)
          Finds an asset relative to some existing resource (typically, a page, component or library specification).
 void initializeService()
           
 void setClasspathAssetFactory(AssetFactory classpathAssetFactory)
           
 void setContextAssetFactory(AssetFactory contextAssetFactory)
           
 void setContributions(List contributions)
          List of AssetFactoryContribution.
 void setDefaultAssetFactory(AssetFactory defaultAssetFactory)
          Factory used when an unrecognized prefix (typically, an arbitrary URL's scheme) is provided.
 void setLookupAssetFactory(AssetFactory lookupAssetFactory)
          Factory used when the path has no prefix, and the type of asset must be inferred from the type of resource.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AssetSourceImpl

public AssetSourceImpl()
Method Detail

initializeService

public void initializeService()

findAsset

public IAsset findAsset(org.apache.hivemind.Resource base,
                        String path,
                        Locale locale,
                        org.apache.hivemind.Location location)
Description copied from interface: AssetSource
Finds an asset relative to some existing resource (typically, a page, component or library specification).

Specified by:
findAsset in interface AssetSource
Parameters:
base - The base resource used for resolving the asset
path - the path relative to the base resource; alternately, the path may include a prefix that defines a domain (such as "classpath:" or "context:") in which case the base resource is ignored and the resource resolved within that domain
locale - used to find a localized version of the asset, may be null to indicate no localization
location - used to report errors (such as missing resources)
Returns:
the asset, possibly localized

findAsset

public IAsset findAsset(org.apache.hivemind.Resource base,
                        IComponentSpecification spec,
                        String path,
                        Locale locale,
                        org.apache.hivemind.Location location)
Description copied from interface: AssetSource
Finds an asset relative to the specified base resources OR IComponentSpecification passed in.

Specified by:
findAsset in interface AssetSource
Parameters:
base - The base resource used for resolving the asset
spec - The specification the resource may be relative to if not found relative to base.
path - the path relative to the base resource; alternately, the path may include a prefix that defines a domain (such as "classpath:" or "context:") in which case the base resource is ignored and the resource resolved within that domain
locale - used to find a localized version of the asset, may be null to indicate no localization
location - used to report errors (such as missing resources)
Returns:
the asset, possibly localized

setLookupAssetFactory

public void setLookupAssetFactory(AssetFactory lookupAssetFactory)
Factory used when the path has no prefix, and the type of asset must be inferred from the type of resource.


setContributions

public void setContributions(List contributions)
List of AssetFactoryContribution.


setDefaultAssetFactory

public void setDefaultAssetFactory(AssetFactory defaultAssetFactory)
Factory used when an unrecognized prefix (typically, an arbitrary URL's scheme) is provided.


setClasspathAssetFactory

public void setClasspathAssetFactory(AssetFactory classpathAssetFactory)

setContextAssetFactory

public void setContextAssetFactory(AssetFactory contextAssetFactory)


Copyright © 2006-2008 Apache Software Foundation. All Rights Reserved.