org.apache.tapestry.asset
Interface AssetSource

All Known Implementing Classes:
AssetSourceImpl

public interface AssetSource

Used to create an IAsset instance for a particular asset path. The path may have a prefix that indicates its type, or it may be relative to some existing resource.

Since:
4.0
Author:
Howard M. Lewis Ship

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).
 

Method Detail

findAsset

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).

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
Throws:
org.apache.hivemind.ApplicationRuntimeException - if the asset does not exist

findAsset

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.

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


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