org.apache.abdera.factory
Class ExtensionFactoryMap

java.lang.Object
  extended by org.apache.abdera.factory.ExtensionFactoryMap
All Implemented Interfaces:
ExtensionFactory

public class ExtensionFactoryMap
extends Object
implements ExtensionFactory

A utility implementation of ExtensionFactory used internally by Abdera. It maintains the collection ExtensionFactory instances discovered on the classpath and a cache of Internal-Wrapper mappings.


Constructor Summary
ExtensionFactoryMap(List<ExtensionFactory> factories)
           
 
Method Summary
 ExtensionFactoryMap addFactory(ExtensionFactory factory)
           
<T extends Element>
T
getElementWrapper(Element internal)
          Abdera's support for static extensions is based on a simple delegation model.
<T extends Base>
String
getMimeType(T base)
          Retrieve the mime type for the element
 String[] getNamespaces()
          Returns the Namespace URIs handled by this Extension Factory
 boolean handlesNamespace(String namespace)
          Returns true if this extension factory handles the specified namespace
 String[] listExtensionFactories()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExtensionFactoryMap

public ExtensionFactoryMap(List<ExtensionFactory> factories)
Method Detail

getElementWrapper

public <T extends Element> T getElementWrapper(Element internal)
Description copied from interface: ExtensionFactory
Abdera's support for static extensions is based on a simple delegation model. Static extension interfaces wrap the dynamic extension API. ExtensionFactory's are handed the internal dynamic element instance and are expected to hand back an object wrapper.

Specified by:
getElementWrapper in interface ExtensionFactory
Parameters:
internal - The Abdera element that needs to be wrapped
Returns:
The wrapper element

getNamespaces

public String[] getNamespaces()
Description copied from interface: ExtensionFactory
Returns the Namespace URIs handled by this Extension Factory

Specified by:
getNamespaces in interface ExtensionFactory
Returns:
A List of Namespace URIs Supported by this Extension

handlesNamespace

public boolean handlesNamespace(String namespace)
Description copied from interface: ExtensionFactory
Returns true if this extension factory handles the specified namespace

Specified by:
handlesNamespace in interface ExtensionFactory
Parameters:
namespace - The XML namespace of the extension
Returns:
True if the namespace is supported by the ExtensionFactory

addFactory

public ExtensionFactoryMap addFactory(ExtensionFactory factory)

getMimeType

public <T extends Base> String getMimeType(T base)
Description copied from interface: ExtensionFactory
Retrieve the mime type for the element

Specified by:
getMimeType in interface ExtensionFactory
Parameters:
base - An Abdera object
Returns:
A MIME media type for the object

listExtensionFactories

public String[] listExtensionFactories()


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