org.kefirsf.bb
Class BBProcessorFactory

java.lang.Object
  extended by org.kefirsf.bb.BBProcessorFactory
All Implemented Interfaces:
TextProcessorFactory

public class BBProcessorFactory
extends Object
implements TextProcessorFactory

Factory for creating BBProcessor from Stream, File, Resource with configuration or default bb-processor.

Author:
Kefir

Method Summary
 TextProcessor create()
          Create the default bb-code processor.
 TextProcessor create(Configuration conf)
          Create TextProcessor by programmatic configuration.
 TextProcessor create(File file)
          Create the bb-code processor from file with XML-configuration.
 TextProcessor create(InputStream stream)
          Create the bb-processor from XML InputStream
 TextProcessor create(String fileName)
          Create the bb-code processor from file with XML-configuration.
 TextProcessor createFromResource(String resourceName)
          Create the bb-processor using xml-configuration resource
static BBProcessorFactory getInstance()
          Return instance of BBProcessorFactory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static BBProcessorFactory getInstance()
Return instance of BBProcessorFactory

Returns:
factory instance

create

public TextProcessor create()
Create the default bb-code processor.

Specified by:
create in interface TextProcessorFactory
Returns:
Default bb-code processor
Throws:
TextProcessorFactoryException - when can't read the default code set resource

create

public TextProcessor create(Configuration conf)
Create TextProcessor by programmatic configuration.

Parameters:
conf - programmatic configuration
Returns:
bb-code text processor

createFromResource

public TextProcessor createFromResource(String resourceName)
Create the bb-processor using xml-configuration resource

Parameters:
resourceName - name of resource file
Returns:
bb-code processor
Throws:
TextProcessorFactoryException - when can't find or read the resource or illegal config file

create

public TextProcessor create(InputStream stream)
Create the bb-processor from XML InputStream

Parameters:
stream - the input stream with XML
Returns:
bb-code processor
Throws:
TextProcessorFactoryException - when can't build Document

create

public TextProcessor create(File file)
Create the bb-code processor from file with XML-configuration.

Parameters:
file - file with configuration
Returns:
bb-code processor
Throws:
TextProcessorFactoryException - any problems

create

public TextProcessor create(String fileName)
Create the bb-code processor from file with XML-configuration.

Parameters:
fileName - name of file with configuration
Returns:
bb-code processor
Throws:
TextProcessorFactoryException - any problems


Copyright © 2013. All Rights Reserved.