Interface ExtensionFactory

  • All Known Implementing Classes:
    AbstractExtensionFactory, ExtensionFactoryMap, MediaExtensionFactory

    public interface ExtensionFactory
    This API is deprecated as Apache Abdera is a retired project since 2017.

    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 Detail

      • handlesNamespace

        boolean handlesNamespace​(String namespace)
        Returns true if this extension factory handles the specified namespace
        namespace - The XML namespace of the extension
        True if the namespace is supported by the ExtensionFactory
      • getNamespaces

        String[] getNamespaces()
        Returns the Namespace URIs handled by this Extension Factory
        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.
        internal - The Abdera element that needs to be wrapped
        The wrapper element
      • getMimeType

        <T extends BaseString getMimeType​(T base)
        Retrieve the mime type for the element
        base - An Abdera object
        A MIME media type for the object