|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.abdera.util.AbstractExtensionFactory
public abstract class AbstractExtensionFactory
Provides a base implementation for ExtensionFactory instances. By extending this, specific extension factories need only to associate a QName with an implementation class, e.g.,
public class MyExtensionFactory extends AbstractExtensionFactory { private String NS = "http://example.org/foo/ns"; private QName FOO = new QName(NS, "foo"); public MyExtensionFactory() { super(NS); addImpl(FOO, Foo.class); } } public class Foo extends ElementWrapper { ... }
Constructor Summary | |
---|---|
protected |
AbstractExtensionFactory(String... namespaces)
|
Method Summary | ||
---|---|---|
protected AbstractExtensionFactory |
addImpl(QName qname,
Class<? extends ElementWrapper> impl)
Associate a QName with an implementation class |
|
protected AbstractExtensionFactory |
addMimeType(QName qname,
String mimetype)
Associate a MIME media type for the specific QName |
|
|
getElementWrapper(Element internal)
Abdera's support for static extensions is based on a simple delegation model. |
|
|
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 |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected AbstractExtensionFactory(String... namespaces)
Method Detail |
---|
public <T extends Element> T getElementWrapper(Element internal)
ExtensionFactory
getElementWrapper
in interface ExtensionFactory
internal
- The Abdera element that needs to be wrapped
protected AbstractExtensionFactory addMimeType(QName qname, String mimetype)
protected AbstractExtensionFactory addImpl(QName qname, Class<? extends ElementWrapper> impl)
public <T extends Base> String getMimeType(T base)
ExtensionFactory
getMimeType
in interface ExtensionFactory
base
- An Abdera object
public String[] getNamespaces()
ExtensionFactory
getNamespaces
in interface ExtensionFactory
public boolean handlesNamespace(String namespace)
ExtensionFactory
handlesNamespace
in interface ExtensionFactory
namespace
- The XML namespace of the extension
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |