org.apache.abdera.factory
Interface Factory


public interface Factory

The Factory interface is the primary means by which Feed Object Model instances are built. Factories are specific to parser implementations. Users will generally not have to know anything about the Factory implementation, which will be automatically selected based on the Abdera configuration options.


Method Summary
 Abdera getAbdera()
          Get the Abdera instance for this factory
<T extends Base>
String
getMimeType(T base)
          Get the mime type for the specified extension element / document
 String[] listExtensionFactories()
          Returns a listing of extension factories registered
 Person newAuthor()
          Create a new author element.
 Person newAuthor(Element parent)
          Create a new author element as a child of the given Element.
 Categories newCategories()
          Create a new Categories element.
 Categories newCategories(Base parent)
          Create a new Categories element.
 Category newCategory()
          Create a new Category element.
 Category newCategory(Element parent)
          Create a new Category element as a child of the given Element.
 Collection newCollection()
          Create a new Collection element.
 Collection newCollection(Element parent)
          Create a new Collection element as a child of the given Element.
 Content newContent()
          Create a new Content element.
 Content newContent(Content.Type type)
          Create a new Content element of the given Content.Type.
 Content newContent(Content.Type type, Element parent)
          Create a new Content element of the given Content.Type as a child of the given Element.
 Content newContent(javax.activation.MimeType mediaType)
          Create a new Content element of the given MediaType.
 Content newContent(javax.activation.MimeType mediaType, Element parent)
          Create a new Content element of the given MediaType as a child of the given Element.
 Person newContributor()
          Create a new contributor element.
 Person newContributor(Element parent)
          Create a new contributor element as a child of the given Element.
 Control newControl()
          Create a new Control element.
 Control newControl(Element parent)
          Create a new Control element as a child of the given Element.
 DateTime newDateTime(QName qname, Element parent)
          Create a new DateTime element with the given QName as a child of the given Element.
 Generator newDefaultGenerator()
          Create a new Generator with Abdera's default name and version.
 Generator newDefaultGenerator(Element parent)
          Create a new Generator using Abdera's default name and version as a child of the given Element.
 Div newDiv()
          Create a new Div element.
 Div newDiv(Base parent)
          Create a new Div element as a child of the given Base.
<T extends Element>
Document<T>
newDocument()
          Create a new Document instance with a root Element of type T.
 DateTime newEdited()
          Create a new app:edited element.
 DateTime newEdited(Element parent)
          Create a new app:edited element.
<T extends Element>
T
newElement(QName qname)
          Create a new Element with the given QName.
<T extends Element>
T
newElement(QName qname, Base parent)
          Create a new Element with the given QName as a child of the given Base.
 Element newEmail()
          Create a new email element.
 Element newEmail(Element parent)
          Create a new email element as a child of the given Element.
 Entry newEntry()
          Create a new Entry element.
 Entry newEntry(Base parent)
          Create a new Entry element as a child of the given Base.
<T extends Element>
T
newExtensionElement(QName qname)
          Create a new extension element with the given QName.
<T extends Element>
T
newExtensionElement(QName qname, Base parent)
          Create a new extension element with the given QName as a child of the given Base.
 Feed newFeed()
          Create a new Feed element.
 Feed newFeed(Base parent)
          Create a new Feed element as a child of the given Base.
 Generator newGenerator()
          Create a new Generator element.
 Generator newGenerator(Element parent)
          Create a new Generator element as a child of the given Element.
 IRIElement newIcon()
          Create a new icon element.
 IRIElement newIcon(Element parent)
          Create a new icon element as a child of the given Element.
 IRIElement newID()
          Create a new id element.
 IRIElement newID(Element parent)
          Create a new id element as a child of the given Element.
 IRIElement newIRIElement(QName qname, Element parent)
          Create a new IRI element with the given QName as a child of the given Element.
 Link newLink()
          Create a new Link element.
 Link newLink(Element parent)
          Create a new Link element as a child of the given Element.
 IRIElement newLogo()
          Create a new logo element.
 IRIElement newLogo(Element parent)
          Create a new logo element as a child of the given Element.
 Element newName()
          Create a new name element.
 Element newName(Element parent)
          Create a new name element as a child of the given Element.
 Parser newParser()
          Create a new Parser instance.
 Person newPerson(QName qname, Element parent)
          Create a new Person element with the given QName as a child of the given Element.
 DateTime newPublished()
          Create a new published element.
 DateTime newPublished(Element parent)
          Create a new published element as a child of the given Element.
 Text newRights()
          Create a new rights element.
 Text newRights(Element parent)
          Create a new rights element as a child of the given Element.
 Text newRights(Text.Type type)
          Create a new rights element with the given Text.Type.
 Text newRights(Text.Type type, Element parent)
          Create a new rights element with the given Text.Type as a child of the given Element.
 Service newService()
          Create a new Service element.
 Service newService(Base parent)
          Create a new Service element as a child of the given Base.
 Source newSource()
          Create a new Source element.
 Source newSource(Element parent)
          Create a new Source element as a child of the given Element.
 Text newSubtitle()
          Create a new subtitle element.
 Text newSubtitle(Element parent)
          Create a new subtitle element as a child of the given Element.
 Text newSubtitle(Text.Type type)
          Create a new subtitle element with the given Text.Type.
 Text newSubtitle(Text.Type type, Element parent)
          Create a new subtitle element with the given Text.Type as a child of the given Element.
 Text newSummary()
          Create a new summary element.
 Text newSummary(Element parent)
          Create a new summary element as a child of the given Element.
 Text newSummary(Text.Type type)
          Create a new summary element with the given Text.Type.
 Text newSummary(Text.Type type, Element parent)
          Create a new summary element with the given Text.Type as a child of the given Element.
 Text newText(QName qname, Text.Type type)
          Create a new Text element with the given QName and Text.Type.
 Text newText(QName qname, Text.Type type, Element parent)
          Create a new Text element with the given QName and Text.Type as a child of the given Element.
 Text newTitle()
          Create a new title element.
 Text newTitle(Element parent)
          Create a new title element as a child of the given Element.
 Text newTitle(Text.Type type)
          Create a new title element with the given Text.Type.
 Text newTitle(Text.Type type, Element parent)
          Create a new title element with the given Text.Type as a child of the given Element.
 DateTime newUpdated()
          Create a new updated element.
 DateTime newUpdated(Element parent)
          create a new updated element as a child of the given Element.
 IRIElement newUri()
          Create a new uri element.
 IRIElement newUri(Element parent)
          Create a new uri element as a child of the given Element.
 String newUuidUri()
          Generate a new random UUID URI
 Workspace newWorkspace()
          Create a new Workspace element.
 Workspace newWorkspace(Element parent)
          Create a new Workspace element as a child of the given Element.
 Factory registerExtension(ExtensionFactory extensionFactory)
          Registers an extension factory for this Factory instance only
 

Method Detail

newParser

Parser newParser()
Create a new Parser instance.

Returns:
A new instance of the Parser associated with this Factory

newDocument

<T extends Element> Document<T> newDocument()
Create a new Document instance with a root Element of type T.

Returns:
A new instance of a Document

newService

Service newService()
Create a new Service element.

Returns:
A newly created Service element

newService

Service newService(Base parent)
Create a new Service element as a child of the given Base.

Parameters:
parent - The element or document to which the new Service should be added as a child
Returns:
A newly created Service element

newWorkspace

Workspace newWorkspace()
Create a new Workspace element.

Returns:
A newly created Workspace element

newWorkspace

Workspace newWorkspace(Element parent)
Create a new Workspace element as a child of the given Element.

Parameters:
parent - The element to which the new Workspace should be added as a child
Returns:
A newly created Workspace element

newCollection

Collection newCollection()
Create a new Collection element.

Returns:
A newly created Collection element

newCollection

Collection newCollection(Element parent)
Create a new Collection element as a child of the given Element.

Parameters:
parent - The element to which the new Collection should be added as a child
Returns:
A newly created Collection element

newFeed

Feed newFeed()
Create a new Feed element. A new Document containing the Feed will be created automatically

Returns:
A newly created Feed element.

newFeed

Feed newFeed(Base parent)
Create a new Feed element as a child of the given Base.

Parameters:
parent - The element or document to which the new Feed should be added as a child
Returns:
A newly created Feed element

newEntry

Entry newEntry()
Create a new Entry element. A new Document containing the Entry will be created automatically

Returns:
A newly created Entry element

newEntry

Entry newEntry(Base parent)
Create a new Entry element as a child of the given Base.

Parameters:
parent - The element or document to which the new Entry should be added as a child
Returns:
A newly created Entry element

newCategory

Category newCategory()
Create a new Category element.

Returns:
A newly created Category element

newCategory

Category newCategory(Element parent)
Create a new Category element as a child of the given Element.

Parameters:
parent - The element to which the new Category should be added as a child
Returns:
A newly created Category element

newContent

Content newContent()
Create a new Content element.

Returns:
A newly created Content element with type="text"

newContent

Content newContent(Content.Type type)
Create a new Content element of the given Content.Type.

Parameters:
type - The Content.Type for the newly created Content element.
Returns:
A newly created Content element using the specified type

newContent

Content newContent(Content.Type type,
                   Element parent)
Create a new Content element of the given Content.Type as a child of the given Element.

Parameters:
type - The Content.Type for the newly created Content element.
parent - The element to which the new Content should be added as a child
Returns:
A newly created Content element using the specified type

newContent

Content newContent(javax.activation.MimeType mediaType)
Create a new Content element of the given MediaType.

Parameters:
mediaType - The MIME media type to be specified by the type attribute
Returns:
A newly created Content element using the specified MIME type

newContent

Content newContent(javax.activation.MimeType mediaType,
                   Element parent)
Create a new Content element of the given MediaType as a child of the given Element.

Parameters:
mediaType - The MIME media type to be specified by the type attribute
parent - The element to which the new Content should be added as a child
Returns:
A newly created Content element using the specified mediatype.

newPublished

DateTime newPublished()
Create a new published element.

Returns:
A newly created atom:published element

newPublished

DateTime newPublished(Element parent)
Create a new published element as a child of the given Element.

Parameters:
parent - The element to which the new Published element should be added as a child
Returns:
A newly created atom:published element

newUpdated

DateTime newUpdated()
Create a new updated element.

Returns:
A newly created atom:updated element

newUpdated

DateTime newUpdated(Element parent)
create a new updated element as a child of the given Element.

Parameters:
parent - The element to which the new Updated element should be added as a child
Returns:
A newly created atom:updated element

newEdited

DateTime newEdited()
Create a new app:edited element. The app:edited element is defined by the Atom Publishing Protocol specification for use in atom:entry elements created and edited using that protocol. The element should only ever appear as a child of atom:entry.

Returns:
A newly created app:edited element

newEdited

DateTime newEdited(Element parent)
Create a new app:edited element. The app:edited element is defined by the Atom Publishing Protocol specification for use in atom:entry elements created and edited using that protocol. The element should only ever appear as a child of atom:entry.

Parameters:
parent - The element to which the new Edited element should be added as a child
Returns:
A newly created app:edited element

newDateTime

DateTime newDateTime(QName qname,
                     Element parent)
Create a new DateTime element with the given QName as a child of the given Element. RFC4287 provides the abstract Atom Date Construct as a reusable component. Any extension element whose value is a Date/Time SHOULD reuse this construct to maintain consistency with the base specification.

Parameters:
qname - The XML QName of the Atom Date element to create
parent - The element to which the new Atom Date element should be added as a child
Returns:
The newly created Atom Date Construct element

newDefaultGenerator

Generator newDefaultGenerator()
Create a new Generator with Abdera's default name and version.

Returns:
A newly created and pre-populated atom:generator element

newDefaultGenerator

Generator newDefaultGenerator(Element parent)
Create a new Generator using Abdera's default name and version as a child of the given Element.

Parameters:
parent - The element to which the new Generator element should be added as a child
Returns:
A newly created and pre-populated atom:generator element

newGenerator

Generator newGenerator()
Create a new Generator element.

Returns:
A newly created atom:generator element

newGenerator

Generator newGenerator(Element parent)
Create a new Generator element as a child of the given Element.

Parameters:
parent - The element to which the new Generator element should be added as a child
Returns:
A newly creatd atom:generator element

newID

IRIElement newID()
Create a new id element.

Returns:
A newly created atom:id element

newID

IRIElement newID(Element parent)
Create a new id element as a child of the given Element.

Parameters:
parent - The element to which the new ID element should be added as a child
Returns:
A newly created atom:id element

newIcon

IRIElement newIcon()
Create a new icon element.

Returns:
A newly created atom:icon element

newIcon

IRIElement newIcon(Element parent)
Create a new icon element as a child of the given Element.

Parameters:
parent - The element to which the new Icon element should be added as a child
Returns:
A newly created atom:icon element

newLogo

IRIElement newLogo()
Create a new logo element.

Returns:
A newly created atom:logo element

newLogo

IRIElement newLogo(Element parent)
Create a new logo element as a child of the given Element.

Parameters:
parent - The element to which the new Logo element should be added as a child
Returns:
A newly created atom:logo element

newUri

IRIElement newUri()
Create a new uri element.

Returns:
A newly created atom:uri element

newUri

IRIElement newUri(Element parent)
Create a new uri element as a child of the given Element.

Parameters:
parent - The element to which the new URI element should be added as a child
Returns:
A newly created atom:uri element

newIRIElement

IRIElement newIRIElement(QName qname,
                         Element parent)
Create a new IRI element with the given QName as a child of the given Element.

Parameters:
qname - The XML QName of the new IRI element
parent - The element to which the new generic IRI element should be added as a child
Returns:
A newly created element whose text value can be an IRI

newLink

Link newLink()
Create a new Link element.

Returns:
A newly created atom:link element

newLink

Link newLink(Element parent)
Create a new Link element as a child of the given Element.

Parameters:
parent - The element to which the new Link element should be added as a child
Returns:
A newly created atom:uri element

newAuthor

Person newAuthor()
Create a new author element.

Returns:
A newly created atom:author element

newAuthor

Person newAuthor(Element parent)
Create a new author element as a child of the given Element.

Parameters:
parent - The element to which the new Author element should be added as a child
Returns:
A newly created atom:author element

newContributor

Person newContributor()
Create a new contributor element.

Returns:
A newly created atom:contributor element

newContributor

Person newContributor(Element parent)
Create a new contributor element as a child of the given Element.

Parameters:
parent - The element to which the new Contributor element should be added as a child
Returns:
A newly created atom:contributor element

newPerson

Person newPerson(QName qname,
                 Element parent)
Create a new Person element with the given QName as a child of the given Element. RFC4287 provides the abstract Atom Person Construct to represent people and other entities within an Atom Document. Extensions that wish to represent people SHOULD reuse this construct.

Parameters:
qname - The XML QName of the newly created Person element
parent - The element to which the new Person element should be added as a child
Returns:
A newly created Atom Person Construct element

newSource

Source newSource()
Create a new Source element.

Returns:
A newly created atom:source element

newSource

Source newSource(Element parent)
Create a new Source element as a child of the given Element.

Parameters:
parent - The element to which the new Source element should be added as a child
Returns:
A newly created atom:source element

newText

Text newText(QName qname,
             Text.Type type)
Create a new Text element with the given QName and Text.Type. RFC4287 provides the abstract Text Construct to represent simple Text, HTML or XHTML within a document. This construct is used by Atom core elements like atom:title, atom:summary, atom:rights, atom:subtitle, etc and SHOULD be reused by extensions that need a way of embedding text in a document.

Parameters:
qname - The XML QName of the Text element to create
type - The type of text (plain text, HTML or XHTML)
Returns:
A newly created Atom Text Construct element

newText

Text newText(QName qname,
             Text.Type type,
             Element parent)
Create a new Text element with the given QName and Text.Type as a child of the given Element.

Parameters:
qname - The XML QName of the Text element to create
type - The type of text (plain text, HTML or XHTML)
parent - The element to which the new Updated element should be added as a child
Returns:
A newly created Atom Text Construct element

newTitle

Text newTitle()
Create a new title element.

Returns:
A newly created atom:title element

newTitle

Text newTitle(Element parent)
Create a new title element as a child of the given Element.

Parameters:
parent - The element to which the new Title element should be added as a child
Returns:
A newly created atom:title element

newTitle

Text newTitle(Text.Type type)
Create a new title element with the given Text.Type.

Parameters:
type - The type of text used in the title (plain text, HTML, XHTML)
Returns:
A newly created atom:title element

newTitle

Text newTitle(Text.Type type,
              Element parent)
Create a new title element with the given Text.Type as a child of the given Element.

Parameters:
type - The type of text used in the title (plain text, HTML, XHTML)
parent - The element to which the new Updated element should be added as a child
Returns:
A newly created atom:title element

newSubtitle

Text newSubtitle()
Create a new subtitle element.

Returns:
A newly created atom:subtitle element

newSubtitle

Text newSubtitle(Element parent)
Create a new subtitle element as a child of the given Element.

Parameters:
parent - The element to which the new Subtitle element should be added as a child
Returns:
A newly created atom:subtitle element

newSubtitle

Text newSubtitle(Text.Type type)
Create a new subtitle element with the given Text.Type.

Parameters:
type - The type of text used in the subtitle (plain text, HTML, XHTML)
Returns:
A newly created atom:subtitle element

newSubtitle

Text newSubtitle(Text.Type type,
                 Element parent)
Create a new subtitle element with the given Text.Type as a child of the given Element.

Parameters:
type - The type of text used i the subtitle (plain text, HTML, XHTML)
parent - The element to which the new Subtitle element should be added as a child
Returns:
A newly created atom:subtitle element

newSummary

Text newSummary()
Create a new summary element.

Returns:
A newly created atom:summary element

newSummary

Text newSummary(Element parent)
Create a new summary element as a child of the given Element.

Parameters:
parent - The element to which the new Summary element should be added as a child
Returns:
A newly created atom:summary element

newSummary

Text newSummary(Text.Type type)
Create a new summary element with the given Text.Type.

Parameters:
type - The type of text used in the summary (plain text, HTML, XHTML)
Returns:
A newly created atom:summary element

newSummary

Text newSummary(Text.Type type,
                Element parent)
Create a new summary element with the given Text.Type as a child of the given Element.

Parameters:
type - The type of text used in the summary (plain text, HTML, XHTML)
parent - The element to which the new Summary element should be added as a child
Returns:
A newly created atom:summary element

newRights

Text newRights()
Create a new rights element.

Returns:
A newly created atom:rights element

newRights

Text newRights(Element parent)
Create a new rights element as a child of the given Element.

Parameters:
parent - The element to which the new Rights element should be added as a child
Returns:
A newly created atom:rights element

newRights

Text newRights(Text.Type type)
Create a new rights element with the given Text.Type.

Parameters:
type - The type of text used in the Rights (plain text, HTML, XHTML)
Returns:
A newly created atom:rights element

newRights

Text newRights(Text.Type type,
               Element parent)
Create a new rights element with the given Text.Type as a child of the given Element.

Parameters:
type - The type of text used in the Rights (plain text, HTML, XHTML)
parent - The element to which the new Rights element should be added as a child
Returns:
A newly created atom:rights element

newName

Element newName()
Create a new name element.

Returns:
A newly created atom:name element

newName

Element newName(Element parent)
Create a new name element as a child of the given Element.

Parameters:
parent - The element to which the new Name element should be added as a child
Returns:
A newly created atom:summary element

newEmail

Element newEmail()
Create a new email element.

Returns:
A newly created atom:email element

newEmail

Element newEmail(Element parent)
Create a new email element as a child of the given Element.

Parameters:
parent - The element to which the new Email element should be added as a child
Returns:
A newly created atom:email element

newElement

<T extends Element> T newElement(QName qname)
Create a new Element with the given QName.

Returns:
A newly created element

newElement

<T extends Element> T newElement(QName qname,
                                 Base parent)
Create a new Element with the given QName as a child of the given Base.

Parameters:
qname - The XML QName of the element to create
parent - The element or document to which the new element should be added as a child
Returns:
A newly created element

newExtensionElement

<T extends Element> T newExtensionElement(QName qname)
Create a new extension element with the given QName.

Parameters:
qname - The XML QName of the element to create
Returns:
A newly created element

newExtensionElement

<T extends Element> T newExtensionElement(QName qname,
                                          Base parent)
Create a new extension element with the given QName as a child of the given Base.

Parameters:
qname - The XML QName of the element to create
parent - The element or document to which the new element should be added as a child
Returns:
A newly created element

newControl

Control newControl()
Create a new Control element. The app:control element is introduced by the Atom Publishing Protocol as a means of allowing publishing clients to provide metadata to a server affecting the way an entry is published. The control element SHOULD only ever appear as a child of the atom:entry and MUST only ever appear once.

Returns:
A newly app:control element

newControl

Control newControl(Element parent)
Create a new Control element as a child of the given Element.

Parameters:
parent - The element to which the new Control element should be added as a child
Returns:
A newly app:control element

newDiv

Div newDiv()
Create a new Div element.

Returns:
A newly xhtml:div element

newDiv

Div newDiv(Base parent)
Create a new Div element as a child of the given Base.

Parameters:
parent - The element or document to which the new XHTML div element should be added as a child
Returns:
A newly xhtml:div element

registerExtension

Factory registerExtension(ExtensionFactory extensionFactory)
Registers an extension factory for this Factory instance only

Parameters:
extensionFactory - An ExtensionFactory instance

newCategories

Categories newCategories()
Create a new Categories element. The app:categories element is introduced by the Atom Publishing Protocol as a means of providing a listing of atom:category's that can be used by entries in a collection.

Returns:
A newly app:categories element

newCategories

Categories newCategories(Base parent)
Create a new Categories element. The app:categories element is introduced by the Atom Publishing Protocol as a means of providing a listing of atom:category's that can be used by entries in a collection.

Parameters:
parent - The element or document to which the new Categories element should be added as a child
Returns:
A newly app:categories element

newUuidUri

String newUuidUri()
Generate a new random UUID URI


getAbdera

Abdera getAbdera()
Get the Abdera instance for this factory


getMimeType

<T extends Base> String getMimeType(T base)
Get the mime type for the specified extension element / document


listExtensionFactories

String[] listExtensionFactories()
Returns a listing of extension factories registered



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