org.apache.abdera
Class Abdera

java.lang.Object
  extended by org.apache.abdera.Abdera

public class Abdera
extends Object

The top level entry point for Abdera that provides access to various subcomponents. Upon creation, this class will attempt to create singleton instances of each of the various subcomponents components. These instances may be retrieved using the appropriate get___ methods. Alternatively, new instances may be created using the appropriate new___ methods. Instances of the Abdera object, and it's direct children (Parser, Factory, XPath, etc) are Threadsafe. Because of the dynamic configuration model Abdera uses, creating a new instance of the Abdera object can be time consuming. It is, therefore, a good idea for applications to create only a single static instance of the Abdera object (see the Abdera.getInstance() method). Abdera's configuration model depends heavily on the context classloader. Extension Factories, custom writers, custom parsers, etc are all discovered automatically by searching the classpath. This means that care needs to be taken when using Abdera in environments that utilize multiple classloaders (such as Web application servers).


Constructor Summary
Abdera()
          Initialize using the default Abdera Configuration
Abdera(org.apache.abdera.util.Configuration config)
          Initialize using the specified Abdera Configuration
 
Method Summary
 org.apache.abdera.util.Configuration getConfiguration()
          Return the Abdera Configuration used to initialize this instance
 Factory getFactory()
          Return the singleton instance of org.apache.abdera.factory.Factory
static Abdera getInstance()
          Get a static instance of the Abdera object.
static Factory getNewFactory()
          Return a new Factory instance using a non-shared Abdera object
static Parser getNewParser()
          Return a new Parser instance using a non-shared Abdera object
static ParserFactory getNewParserFactory()
          Return a new ParserFactory instance using a non-shared Abdera object
static StreamWriter getNewStreamWriter()
          Return a new instance of the default StreamWriter using a non-shared Abdera object
static Writer getNewWriter()
          Return a new instance of the default Writer using a non-shared Abdera object
static WriterFactory getNewWriterFactory()
          Return a new WriterFactory instance using a non-shared Abdera object
static XPath getNewXPath()
          Return a new XPath instance using a non-shared Abdera object
 Parser getParser()
          Return the singleton instance of org.apache.abdera.parser.Parser
 ParserFactory getParserFactory()
          Return the singleton instance of org.apache.abdera.parser.ParserFactory.
 Writer getWriter()
          Return the singleton instance of the default org.apache.abdera.writer.Writer implementation.
 WriterFactory getWriterFactory()
          Return the singleton instance of org.apache.abdera.writer.WriterFactory.
 XPath getXPath()
          Return the singleton instance of org.apache.abdera.xpath.XPath
 Categories newCategories()
          Create a new Categories instance.
 Entry newEntry()
          Create a new Entry instance.
 Feed newFeed()
          Create a new Feed instance.
 Service newService()
          Create a new Service instance.
 StreamWriter newStreamWriter()
          Return a new instance of the default org.apache.abdera.writer.Writer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Abdera

public Abdera()
Initialize using the default Abdera Configuration


Abdera

public Abdera(org.apache.abdera.util.Configuration config)
Initialize using the specified Abdera Configuration

Parameters:
config - The Abdera Configuration to use
Method Detail

getInstance

public static Abdera getInstance()
Get a static instance of the Abdera object.


newFeed

public Feed newFeed()
Create a new Feed instance. This is a convenience shortcut for abdera.getFactory().newFeed()

Returns:
A newly created feed element

newEntry

public Entry newEntry()
Create a new Entry instance. This is a convenience shortcut for abdera.getFactory().newEntry()

Returns:
A newly created entry element

newService

public Service newService()
Create a new Service instance. This is a convenience shortcut for abdera.getFactory().newService()

Returns:
A newly created service element

newCategories

public Categories newCategories()
Create a new Categories instance. This is a convenience shortcut for abdera.getFactory().newCategories()

Returns:
A newly created categories element

getConfiguration

public org.apache.abdera.util.Configuration getConfiguration()
Return the Abdera Configuration used to initialize this instance

Returns:
The Abdera configuration

getFactory

public Factory getFactory()
Return the singleton instance of org.apache.abdera.factory.Factory

Returns:
The factory instance

getParser

public Parser getParser()
Return the singleton instance of org.apache.abdera.parser.Parser

Returns:
The parser instance

getXPath

public XPath getXPath()
Return the singleton instance of org.apache.abdera.xpath.XPath

Returns:
The XPath instance

getParserFactory

public ParserFactory getParserFactory()
Return the singleton instance of org.apache.abdera.parser.ParserFactory. The Parser Factory is used to acquire alternative parser implementation instances.

Returns:
The ParserFactory instance

getWriterFactory

public WriterFactory getWriterFactory()
Return the singleton instance of org.apache.abdera.writer.WriterFactory. The Writer Factory is used to acquire alternative writer implementation instances.

Returns:
The WriterFactory instance

getWriter

public Writer getWriter()
Return the singleton instance of the default org.apache.abdera.writer.Writer implementation.

Returns:
The default writer implementation

newStreamWriter

public StreamWriter newStreamWriter()
Return a new instance of the default org.apache.abdera.writer.Writer

Returns:
A new default writer implementation instance

getNewFactory

public static Factory getNewFactory()
Return a new Factory instance using a non-shared Abdera object

Returns:
A new factory instance

getNewParser

public static Parser getNewParser()
Return a new Parser instance using a non-shared Abdera object

Returns:
A new parser instance

getNewXPath

public static XPath getNewXPath()
Return a new XPath instance using a non-shared Abdera object

Returns:
A new XPath instance

getNewParserFactory

public static ParserFactory getNewParserFactory()
Return a new ParserFactory instance using a non-shared Abdera object

Returns:
A new ParserFactory instance

getNewWriterFactory

public static WriterFactory getNewWriterFactory()
Return a new WriterFactory instance using a non-shared Abdera object

Returns:
A new WriterFactory instance

getNewWriter

public static Writer getNewWriter()
Return a new instance of the default Writer using a non-shared Abdera object

Returns:
A new default writer implementation instance

getNewStreamWriter

public static StreamWriter getNewStreamWriter()
Return a new instance of the default StreamWriter using a non-shared Abdera object

Returns:
A new default stream writer implementation instance


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