ThinkUI Data Generator 1.0.2 API

thinkui.db.io
Class AbstractDataObjectWriter

java.lang.Object
  extended bythinkui.db.io.AbstractDataObjectWriter
All Implemented Interfaces:
DataObjectWriter
Direct Known Subclasses:
AbstractStringBufferDataObjectWriter, DefaultDataObjectWriter

public abstract class AbstractDataObjectWriter
extends java.lang.Object
implements DataObjectWriter

Abstract implementation of the DataObjectWriter interface.


Constructor Summary
AbstractDataObjectWriter()
          AbstractDataObjectWriter constructor.
 
Method Summary
 void close()
          Closes the writer and flush the output stream (if any).
 void commit()
          Commit the current database transaction (if any).
 FormatFactory getFormatFactory(java.lang.String attrName)
           
 java.io.OutputStream getOutputStream()
          Returns the output stream to be used or null if not applicable.
 java.io.Writer getWriter()
          Returns the writer to be used or null if not applicable.
 void init()
          Initializes the writer.
 boolean isWriteHeader()
          Returns whether or not an output header should be written.
 boolean isWriteUppercase()
          Returns whether or not output should be written in uppercase.
 void rollback()
          Rollback the current database transaction (if any).
 void setFormatFactory(java.lang.String attrName, FormatFactory formatFactory)
          Sets the format factory for the given attribute name.
 void setOutputStream(java.io.OutputStream out)
          Sets the output stream to be used for writing the output.
 void setWriteHeader(boolean writeHeader)
          Sets whether or not an output header should be written.
 void setWriter(java.io.Writer writer)
          Sets the writer to be used for writing the output.
 void setWriteUppercase(boolean writeUppercase)
          Sets whether or not output should be written in uppercase.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface thinkui.db.io.DataObjectWriter
getCount, write, write
 

Constructor Detail

AbstractDataObjectWriter

public AbstractDataObjectWriter()
AbstractDataObjectWriter constructor.

Method Detail

close

public void close()
           throws java.lang.Exception
Closes the writer and flush the output stream (if any).

Specified by:
close in interface DataObjectWriter
Throws:
java.lang.Exception

commit

public void commit()
            throws java.lang.Exception
Commit the current database transaction (if any). The default implementation simply does nothing. Derived classes should override this method if needed.

Specified by:
commit in interface DataObjectWriter
Throws:
java.lang.Exception

getFormatFactory

public FormatFactory getFormatFactory(java.lang.String attrName)
Specified by:
getFormatFactory in interface DataObjectWriter
Returns:
the format factory for the given attribute name or null.

getOutputStream

public final java.io.OutputStream getOutputStream()
Description copied from interface: DataObjectWriter
Returns the output stream to be used or null if not applicable.

Specified by:
getOutputStream in interface DataObjectWriter
Returns:
the output stream to be used or null.

getWriter

public final java.io.Writer getWriter()
Description copied from interface: DataObjectWriter
Returns the writer to be used or null if not applicable.

Specified by:
getWriter in interface DataObjectWriter
Returns:
the writer to be used or null.

init

public void init()
          throws java.lang.Exception
Initializes the writer. The default implementation simply does nothing. Derived classes should override this method if needed.

Specified by:
init in interface DataObjectWriter
Throws:
java.lang.Exception

isWriteHeader

public final boolean isWriteHeader()
Description copied from interface: DataObjectWriter
Returns whether or not an output header should be written.

Specified by:
isWriteHeader in interface DataObjectWriter
Returns:
whether or not an output header should be written.

isWriteUppercase

public final boolean isWriteUppercase()
Description copied from interface: DataObjectWriter
Returns whether or not output should be written in uppercase.

Specified by:
isWriteUppercase in interface DataObjectWriter
Returns:
whether or not output should be written in uppercase.

rollback

public void rollback()
              throws java.lang.Exception
Rollback the current database transaction (if any). The default implementation simply does nothing. Derived classes should override this method if needed.

Specified by:
rollback in interface DataObjectWriter
Throws:
java.lang.Exception

setFormatFactory

public final void setFormatFactory(java.lang.String attrName,
                                   FormatFactory formatFactory)
Sets the format factory for the given attribute name.

Specified by:
setFormatFactory in interface DataObjectWriter

setOutputStream

public void setOutputStream(java.io.OutputStream out)
Description copied from interface: DataObjectWriter
Sets the output stream to be used for writing the output.

Specified by:
setOutputStream in interface DataObjectWriter

setWriteHeader

public final void setWriteHeader(boolean writeHeader)
Description copied from interface: DataObjectWriter
Sets whether or not an output header should be written.

Specified by:
setWriteHeader in interface DataObjectWriter

setWriter

public void setWriter(java.io.Writer writer)
Description copied from interface: DataObjectWriter
Sets the writer to be used for writing the output. If not explicitly set, a writer will be created automatically based on the configure output stream (if any).

Specified by:
setWriter in interface DataObjectWriter

setWriteUppercase

public final void setWriteUppercase(boolean writeUppercase)
Description copied from interface: DataObjectWriter
Sets whether or not output should be written in uppercase.

Specified by:
setWriteUppercase in interface DataObjectWriter

ThinkUI Data Generator 1.0.2 API

Copyright © 2007-2009. ThinkUI Software Inc. All rights reserved.