info.magnolia.dam.api
Class AbstractAssetProvider

java.lang.Object
  extended by info.magnolia.dam.api.AbstractAssetProvider
All Implemented Interfaces:
AssetProvider

public abstract class AbstractAssetProvider
extends Object
implements AssetProvider

Convenient abstract base class for implementations. Enables configuration of MediaTypes that this provider... provides.


Nested Class Summary
 
Nested classes/interfaces inherited from interface info.magnolia.dam.api.AssetProvider
AssetProvider.AssetNotFoundException, AssetProvider.IllegalItemKeyException
 
Constructor Summary
AbstractAssetProvider()
           
 
Method Summary
 String getIdentifier()
          Return the AssetProvider identifier.
 List<com.google.common.net.MediaType> getMediaTypes()
           
protected  EnumSet<AssetProviderCapability> getProviderCapabilities()
           
 boolean provides(com.google.common.net.MediaType mediaType)
          Whether this provider provides or allows the given MediaType.
 void setIdentifier(String identifier)
           
 void setMediaTypes(List<com.google.common.net.MediaType> mediaTypes)
           
protected abstract  EnumSet<AssetProviderCapability> setupProviderCapabilities()
          Called by constructor, so as to setup the capabilities Set once and only one.
 boolean supports(AssetProviderCapability capability)
          Returns true if the provider supports the given AssetProviderCapability.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface info.magnolia.dam.api.AssetProvider
getAsset, getFolder, getItem, getRendererFor, getRootFolder, list, supports
 

Constructor Detail

AbstractAssetProvider

public AbstractAssetProvider()
Method Detail

setupProviderCapabilities

protected abstract EnumSet<AssetProviderCapability> setupProviderCapabilities()
Called by constructor, so as to setup the capabilities Set once and only one. Implementations can build and return an EnumSet with EnumSet.of(AssetProviderCapability....).


getProviderCapabilities

protected EnumSet<AssetProviderCapability> getProviderCapabilities()

supports

public boolean supports(AssetProviderCapability capability)
Description copied from interface: AssetProvider
Returns true if the provider supports the given AssetProviderCapability.

Specified by:
supports in interface AssetProvider

provides

public boolean provides(com.google.common.net.MediaType mediaType)
Description copied from interface: AssetProvider
Whether this provider provides or allows the given MediaType. Some providers can be configured to only be used for a given set or subset of types.

Specified by:
provides in interface AssetProvider

getIdentifier

public String getIdentifier()
Description copied from interface: AssetProvider
Return the AssetProvider identifier.

Specified by:
getIdentifier in interface AssetProvider

getMediaTypes

public List<com.google.common.net.MediaType> getMediaTypes()

setMediaTypes

public void setMediaTypes(List<com.google.common.net.MediaType> mediaTypes)

setIdentifier

public void setIdentifier(String identifier)


Copyright © 2014 Magnolia International Ltd.. All Rights Reserved.