blob: 1c60918aca5eb43d9ced58d6d802f55dab9fd95c [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_26) on Wed Sep 14 22:31:07 PDT 2011 -->
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
ExtensionFactory (Abdera2 Core 2.0-SNAPSHOT API)
</TITLE>
<META NAME="date" CONTENT="2011-09-14">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="ExtensionFactory (Abdera2 Core 2.0-SNAPSHOT API)";
}
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/ExtensionFactory.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../org/apache/abdera2/factory/AbstractExtensionFactory.Impls.html" title="annotation in org.apache.abdera2.factory"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../org/apache/abdera2/factory/ExtensionFactoryMap.html" title="class in org.apache.abdera2.factory"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../index.html?org/apache/abdera2/factory/ExtensionFactory.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="ExtensionFactory.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
org.apache.abdera2.factory</FONT>
<BR>
Interface ExtensionFactory</H2>
<DL>
<DT><B>All Known Implementing Classes:</B> <DD><A HREF="../../../../org/apache/abdera2/factory/AbstractExtensionFactory.html" title="class in org.apache.abdera2.factory">AbstractExtensionFactory</A>, <A HREF="../../../../org/apache/abdera2/protocol/error/ErrorExtensionFactory.html" title="class in org.apache.abdera2.protocol.error">ErrorExtensionFactory</A>, <A HREF="../../../../org/apache/abdera2/factory/ExtensionFactoryMap.html" title="class in org.apache.abdera2.factory">ExtensionFactoryMap</A>, <A HREF="../../../../org/apache/abdera2/parser/axiom/FOMFactory.html" title="class in org.apache.abdera2.parser.axiom">FOMFactory</A></DD>
</DL>
<HR>
<DL>
<DT><PRE>public interface <B>ExtensionFactory</B></DL>
</PRE>
<P>
<p>
Extension Factories are used to provide a means of dynamically resolving builders for namespaced extension elements
</p>
<p>
There are four ways of supporting extension elements.
</p>
<ol>
<li>Implement your own Factory (hard)</li>
<li>Subclass the default Axiom-based Factory (also somewhat difficult)</li>
<li>Implement and register an ExtensionFactory (wonderfully simple)</li>
<li>Use the Feed Object Model's dynamic support for extensions (also very simple)</li>
</ol>
<p>
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.
</p>
<p>
ExtensionFactory implementations are assumed to be threadsafe
</p>
<P>
<P>
<HR>
<P>
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
<TR ALIGN="right" VALIGN="">
<TD NOWRAP><FONT SIZE="-1">
<CODE>&lt;T extends <A HREF="../../../../org/apache/abdera2/model/Element.html" title="interface in org.apache.abdera2.model">Element</A>&gt;
<BR>
T</CODE></FONT></TD>
</TR>
</TABLE>
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/abdera2/factory/ExtensionFactory.html#getElementWrapper(org.apache.abdera2.model.Element)">getElementWrapper</A></B>(<A HREF="../../../../org/apache/abdera2/model/Element.html" title="interface in org.apache.abdera2.model">Element</A>&nbsp;internal)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Abdera's support for static extensions is based on a simple delegation model.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
<TR ALIGN="right" VALIGN="">
<TD NOWRAP><FONT SIZE="-1">
<CODE>&lt;T extends <A HREF="../../../../org/apache/abdera2/model/Base.html" title="interface in org.apache.abdera2.model">Base</A>&gt;
<BR>
<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
</TR>
</TABLE>
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/abdera2/factory/ExtensionFactory.html#getMimeType(T)">getMimeType</A></B>(T&nbsp;base)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Retrieve the mime type for the element</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Iterable.html?is-external=true" title="class or interface in java.lang">Iterable</A>&lt;<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&gt;</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/abdera2/factory/ExtensionFactory.html#getNamespaces()">getNamespaces</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the Namespace URIs handled by this Extension Factory</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/abdera2/factory/ExtensionFactory.html#handlesNamespace(java.lang.String)">handlesNamespace</A></B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;namespace)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns true if this extension factory handles the specified namespace</TD>
</TR>
</TABLE>
&nbsp;
<P>
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="handlesNamespace(java.lang.String)"><!-- --></A><H3>
handlesNamespace</H3>
<PRE>
boolean <B>handlesNamespace</B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;namespace)</PRE>
<DL>
<DD>Returns true if this extension factory handles the specified namespace
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>namespace</CODE> - The XML namespace of the extension
<DT><B>Returns:</B><DD>True if the namespace is supported by the ExtensionFactory</DL>
</DD>
</DL>
<HR>
<A NAME="getNamespaces()"><!-- --></A><H3>
getNamespaces</H3>
<PRE>
<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Iterable.html?is-external=true" title="class or interface in java.lang">Iterable</A>&lt;<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&gt; <B>getNamespaces</B>()</PRE>
<DL>
<DD>Returns the Namespace URIs handled by this Extension Factory
<P>
<DD><DL>
<DT><B>Returns:</B><DD>A List of Namespace URIs Supported by this Extension</DL>
</DD>
</DL>
<HR>
<A NAME="getElementWrapper(org.apache.abdera2.model.Element)"><!-- --></A><H3>
getElementWrapper</H3>
<PRE>
&lt;T extends <A HREF="../../../../org/apache/abdera2/model/Element.html" title="interface in org.apache.abdera2.model">Element</A>&gt; T <B>getElementWrapper</B>(<A HREF="../../../../org/apache/abdera2/model/Element.html" title="interface in org.apache.abdera2.model">Element</A>&nbsp;internal)</PRE>
<DL>
<DD>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 an internal dynamic element instance and are expected
to hand back a static object wrapper allowing Abdera to decouple extensions from the underlying parser and
internal data model implementation.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>internal</CODE> - The Abdera element that needs to be wrapped
<DT><B>Returns:</B><DD>The wrapper element</DL>
</DD>
</DL>
<HR>
<A NAME="getMimeType(org.apache.abdera2.model.Base)"><!-- --></A><A NAME="getMimeType(T)"><!-- --></A><H3>
getMimeType</H3>
<PRE>
&lt;T extends <A HREF="../../../../org/apache/abdera2/model/Base.html" title="interface in org.apache.abdera2.model">Base</A>&gt; <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>getMimeType</B>(T&nbsp;base)</PRE>
<DL>
<DD>Retrieve the mime type for the element
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>base</CODE> - An Abdera object
<DT><B>Returns:</B><DD>A MIME media type for the object</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/ExtensionFactory.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../org/apache/abdera2/factory/AbstractExtensionFactory.Impls.html" title="annotation in org.apache.abdera2.factory"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../org/apache/abdera2/factory/ExtensionFactoryMap.html" title="class in org.apache.abdera2.factory"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../index.html?org/apache/abdera2/factory/ExtensionFactory.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="ExtensionFactory.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
Copyright &#169; 2006-2011 <a href="http://www.apache.org/">Apache Software Foundation</a>. All Rights Reserved.
</BODY>
</HTML>