Package org.apache.abdera.factory
Class ExtensionFactoryMap
- java.lang.Object
-
- org.apache.abdera.factory.ExtensionFactoryMap
-
- All Implemented Interfaces:
ExtensionFactory
public class ExtensionFactoryMap extends java.lang.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
Constructors Constructor Description ExtensionFactoryMap(java.util.List<ExtensionFactory> factories)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ExtensionFactoryMapaddFactory(ExtensionFactory factory)<T extends Element>
TgetElementWrapper(Element internal)Abdera's support for static extensions is based on a simple delegation model.<T extends Base>
java.lang.StringgetMimeType(T base)Retrieve the mime type for the elementjava.lang.String[]getNamespaces()Returns the Namespace URIs handled by this Extension FactorybooleanhandlesNamespace(java.lang.String namespace)Returns true if this extension factory handles the specified namespacejava.lang.String[]listExtensionFactories()
-
-
-
Constructor Detail
-
ExtensionFactoryMap
public ExtensionFactoryMap(java.util.List<ExtensionFactory> factories)
-
-
Method Detail
-
getElementWrapper
public <T extends Element> T getElementWrapper(Element internal)
Description copied from interface:ExtensionFactoryAbdera'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:
getElementWrapperin interfaceExtensionFactory- Parameters:
internal- The Abdera element that needs to be wrapped- Returns:
- The wrapper element
-
getNamespaces
public java.lang.String[] getNamespaces()
Description copied from interface:ExtensionFactoryReturns the Namespace URIs handled by this Extension Factory- Specified by:
getNamespacesin interfaceExtensionFactory- Returns:
- A List of Namespace URIs Supported by this Extension
-
handlesNamespace
public boolean handlesNamespace(java.lang.String namespace)
Description copied from interface:ExtensionFactoryReturns true if this extension factory handles the specified namespace- Specified by:
handlesNamespacein interfaceExtensionFactory- 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> java.lang.String getMimeType(T base)
Description copied from interface:ExtensionFactoryRetrieve the mime type for the element- Specified by:
getMimeTypein interfaceExtensionFactory- Parameters:
base- An Abdera object- Returns:
- A MIME media type for the object
-
listExtensionFactories
public java.lang.String[] listExtensionFactories()
-
-