|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface AssetFactory
A service which creates an asset. In some cases, the asset is selected based on the Resource (typically of the component or page specification).
Method Summary | |
---|---|
boolean |
assetExists(IComponentSpecification spec,
org.apache.hivemind.Resource baseResource,
String path,
Locale locale)
Invoked to check if the factory instance can find a matching asset using the appropriate strategy specific to its implementation. |
IAsset |
createAbsoluteAsset(String path,
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 baseResource,
IComponentSpecification spec,
String path,
Locale locale,
org.apache.hivemind.Location location)
Creates a new asset relative to an existing asset. |
IAsset |
createAsset(org.apache.hivemind.Resource resource,
org.apache.hivemind.Location location)
Creates a new asset based on a known resource. |
Method Detail |
---|
boolean assetExists(IComponentSpecification spec, org.apache.hivemind.Resource baseResource, String path, Locale locale)
spec
- The optional component specification to check the path against.baseResource
- The resource that the path may be relative to.path
- The asset path, relative to baseResource.locale
- Optional parameter when a localized version is desired. (may be null)
IAsset createAsset(org.apache.hivemind.Resource baseResource, IComponentSpecification spec, String path, Locale locale, org.apache.hivemind.Location location)
spec
- The optional component specification to check the path against.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
org.apache.hivemind.ApplicationRuntimeException
- if no matching asset may be found.IAsset createAbsoluteAsset(String path, Locale locale, org.apache.hivemind.Location location)
path
- the absolute path for the resourcelocale
- the locale to localize the asset to, or null for no localizationlocation
- the location used to report any errors
IAsset
IAsset createAsset(org.apache.hivemind.Resource resource, org.apache.hivemind.Location location)
resource
- The resource the asset will represent.location
- Location of the resource. (used for error reporting mostly)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |