org.apache.abdera.factory
Interface ExtensionFactory

All Known Implementing Classes:
org.apache.abdera.util.AbstractExtensionFactory, ErrorExtensionFactory, ExtensionFactoryMap, FooExtensionFactory

public interface ExtensionFactory

Extension Factories are used to provide a means of dynamically resolving builders for namespaced extension elements

There are four ways of supporting extension elements.

  1. Implement your own Factory (hard)
  2. Subclass the default Axiom-based Factory (also somewhat difficult)
  3. Implement and register an ExtensionFactory (wonderfully simple)
  4. Use the Feed Object Model's dynamic support for extensions (also very simple)

Registering an Extension Factory requires generally nothing more than implementing ExtensionFactory and then creating a file called META-INF/services/org.apache.abdera.factory.ExtensionFactory and listing the class names of each ExtensionFactory you wish to register.

ExtensionFactory implementations are assumed to be threadsafe


Method Summary
<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
 

Method Detail

handlesNamespace

boolean handlesNamespace(String namespace)
Returns true if this extension factory handles the specified namespace

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

getNamespaces

String[] getNamespaces()
Returns the Namespace URIs handled by this Extension Factory

Returns:
A List of Namespace URIs Supported by this Extension

getElementWrapper

<T extends Element> T getElementWrapper(Element internal)
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.

Parameters:
internal - The Abdera element that needs to be wrapped
Returns:
The wrapper element

getMimeType

<T extends Base> String getMimeType(T base)
Retrieve the mime type for the element

Parameters:
base - An Abdera object
Returns:
A MIME media type for the object


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