org.apache.tapestry5.internal.services
Class AssetObjectProvider

java.lang.Object
  extended by org.apache.tapestry5.internal.services.AssetObjectProvider
All Implemented Interfaces:
ObjectProvider

public class AssetObjectProvider
extends Object
implements ObjectProvider

Exposes assets (in the current locale). The Inject annotation must be supplemented by a Path annotation, to identify what asset to be injected.


Constructor Summary
AssetObjectProvider(AssetSource source, TypeCoercer typeCoercer, SymbolSource symbolSource)
           
 
Method Summary
<T> T
provide(Class<T> objectType, AnnotationProvider annotationProvider, ObjectLocator locator)
          Provides the asset.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AssetObjectProvider

public AssetObjectProvider(@Core
                           AssetSource source,
                           @Builtin
                           TypeCoercer typeCoercer,
                           @Builtin
                           SymbolSource symbolSource)
Method Detail

provide

public <T> T provide(Class<T> objectType,
                     AnnotationProvider annotationProvider,
                     ObjectLocator locator)
Provides the asset. If the expression does not identify an asset domain, with a prefix, it is assumed to be a path on the classpath, relative to the root of the classpath.

Specified by:
provide in interface ObjectProvider
Parameters:
objectType - the type of object (which must be Object or Asset)
locator - not used
annotationProvider - provides access to annotations (typically, the field or parameter to which an injection-related annotation is attached); annotations on the field or parameter may also be used when resolving the desired object
Returns:
the requested object, or null if this object provider can not supply an object


Copyright © 2003-2012 The Apache Software Foundation.