de.smartics.properties.config.transfer.templatestream
Class Factory

Package class diagram package Factory
java.lang.Object
  extended by de.smartics.properties.config.transfer.templatestream.Factory
All Implemented Interfaces:
de.smartics.properties.api.config.transfer.PropertySinkFactory< StreamPropertySink>
Direct Known Subclasses:
CsvFactory, HSqlFactory, MySqlFactory, XmlFactory

public class Factory
     
     
extends Object
implements de.smartics.properties.api.config.transfer.PropertySinkFactory< StreamPropertySink>

Creates instances of StreamPropertySink.


Constructor Summary
Factory()
          Default constructor.
 
Method Summary
 StreamPropertySink create()
          
 String getEncoding()
          Returns the encoding to use to write to the file.
 void setConfigColumn(String configColumn)
          Sets the name of the optional configuration key column.
 void setDocumentExtro(String extro)
          Sets the text to write to the stream at the end before closing the stream.
 void setDocumentIntro(String intro)
          Sets the introduction to write to the stream at the start.
 void setEncoding(String encoding)
          Sets the encoding to use to write to the file.
protected  void setEscaper(ValueEscaper escaper)
          Sets the escaper for config key, property name and value.
 void setEscaperType(String type)
          Sets the type of the escaper for config key, property name and value.
 void setFile(String fileName)
          Sets the file to write to.
 void setLineExtro(String extro)
          Sets the text to write after each property provider.
 void setLineIntro(String intro)
          Sets the introduction to write before each property provider.
 void setNameColumn(String nameColumn)
          Sets the name of the property name column.
 void setStream(PrintWriter stream)
          Sets the stream to write to.
 void setTable(String table)
          Sets the name of the configuration table.
 void setTemplate(String template)
          Sets the template to apply on each property.
 void setValueColumn(String valueColumn)
          Sets the name of the property value column.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Factory

public Factory()
Default constructor.

Method Detail

setDocumentIntro

public final void setDocumentIntro(String intro)
Sets the introduction to write to the stream at the start.

Parameters:
intro - the introduction to write to the stream at the start.

setDocumentExtro

public final void setDocumentExtro(String extro)
Sets the text to write to the stream at the end before closing the stream.

Parameters:
extro - the text to write to the stream at the end before closing the stream.

setLineIntro

public final void setLineIntro(String intro)
Sets the introduction to write before each property provider.

Parameters:
intro - the introduction to write before each property provider.

setLineExtro

public final void setLineExtro(String extro)
Sets the text to write after each property provider.

Parameters:
extro - the text to write after each property provider.

setTemplate

public final void setTemplate(String template)
Sets the template to apply on each property.

Parameters:
template - the template to apply on each property.

setTable

public final void setTable(String table)
                    throws NullPointerException,
                           IllegalArgumentException
Sets the name of the configuration table.

Parameters:
table - the name of the configuration table.
Throws:
NullPointerException - if table is null.
IllegalArgumentException - if table is blank.

setConfigColumn

public final void setConfigColumn(String configColumn)
                           throws NullPointerException,
                                  IllegalArgumentException
Sets the name of the optional configuration key column.

Parameters:
configColumn - the name of the optional configuration key column.
Throws:
NullPointerException - if configColumn is null .
IllegalArgumentException - if configColumn is blank.

setNameColumn

public final void setNameColumn(String nameColumn)
                         throws NullPointerException,
                                IllegalArgumentException
Sets the name of the property name column.

Parameters:
nameColumn - the name of the property name column.
Throws:
NullPointerException - if nameColumn is null.
IllegalArgumentException - if nameColumn is blank.

setValueColumn

public final void setValueColumn(String valueColumn)
                          throws NullPointerException,
                                 IllegalArgumentException
Sets the name of the property value column.

Parameters:
valueColumn - the name of the property value column.
Throws:
NullPointerException - if valueColumn is null.
IllegalArgumentException - if valueColumn is blank.

setStream

public final void setStream(PrintWriter stream)
Sets the stream to write to.

Parameters:
stream - the stream to write to.

setFile

public final void setFile(String fileName)
Sets the file to write to.

Parameters:
fileName - the name of the file to write to.

setEncoding

public final void setEncoding(String encoding)
Sets the encoding to use to write to the file. Defaults to UTF-8.

Parameters:
encoding - the encoding to use to write to the file.

getEncoding

public final String getEncoding()
Returns the encoding to use to write to the file. Defaults to UTF-8.

Returns:
the encoding to use to write to the file.

setEscaper

protected final void setEscaper(ValueEscaper escaper)
Sets the escaper for config key, property name and value.

Parameters:
escaper - the escaper for config key, property name and value.

setEscaperType

public final void setEscaperType(String type)
                          throws de.smartics.properties.spi.config.transfer.TransferException
Sets the type of the escaper for config key, property name and value.

Parameters:
type - the type of the escaper for config key, property name and value.
Throws:
de.smartics.properties.spi.config.transfer.TransferException - if the type cannot be instantiated.

create

public StreamPropertySink create()
                          throws de.smartics.properties.spi.config.transfer.TransferException

Specified by:
create in interface de.smartics.properties.api.config.transfer.PropertySinkFactory<StreamPropertySink>
Throws:
de.smartics.properties.spi.config.transfer.TransferException - on any problem opening the stream.


Copyright © 2013 Kronseder & Reiner GmbH - smartics. All Rights Reserved.