|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.Writer
java.io.FilterWriter
org.caleigo.core.EntityWriter
The EntityWriter is a FilterWriter that adds write methods for wrting entities, selections and related data.
Field Summary | |
static int |
DEFAULT_DECIMAL_COUNT
|
protected static java.text.DateFormat |
sDefaultDateFormat
|
protected static java.text.NumberFormat |
sDefaultFloatFormat
|
protected static java.text.NumberFormat |
sDefaultIntegerFormat
|
Fields inherited from class java.io.FilterWriter |
out |
Fields inherited from class java.io.Writer |
lock |
Constructor Summary | |
EntityWriter(java.io.Writer out)
|
|
EntityWriter(java.io.Writer out,
int fieldSeparator,
int entitySeparator)
|
Method Summary | |
void |
addBlockedDataType(DataType dataType)
This method makes it possible to register data types that should be ignored when writing. |
static java.lang.String |
createDragString(ISelection selection)
Static help method that creates a string representation of a entity selection suitable for end-user display considering the default local. |
static java.text.DateFormat |
getDefaultDateFormat()
|
static java.text.NumberFormat |
getDefaultFloatFormat()
|
static java.text.NumberFormat |
getDefaultIntegerFormat()
|
int |
getFieldSeparator()
|
java.lang.String |
getNullValue()
|
int |
getRecordSeparator()
|
int |
getStringDelimiter()
|
boolean |
isDataTypeBlocked(DataType dataType)
Returns true if the provided data type is blocked. |
boolean |
isPrintFormat()
Returns true if print format is active. |
static void |
setDefaultDateFormat(java.text.DateFormat format)
|
static void |
setDefaultFloatFormat(java.text.NumberFormat format)
|
static void |
setDefaultIntegerFormat(java.text.NumberFormat format)
|
void |
setFieldSeparator(int character)
|
void |
setNullValue(java.lang.String nullString)
Setting the string mark to zero means that no string quotes will be used. |
void |
setPrintFormat(boolean usePrintFormat)
Print format indicates that the data written should be formated for end-user display using the current locale settings. |
void |
setRecordSeparator(int character)
|
void |
setStringDelimiter(int character)
|
protected boolean |
useStringDelimiter(DataType dataType)
|
protected void |
writeData(DataType dataType,
java.lang.Object data)
|
void |
writeEntity(IEntity entity)
Writes a single entity to the writer. |
void |
writeFieldTitles(IEntityDescriptor entityDescriptor)
Writes a header row with titles using the display names of the fields from the provided entity descriptor. |
void |
writeMappedSelection(ISelection selection)
Writes a selection to the writer preceded with a row consisting of the source names for the fields defined by the selections entity descriptor. |
void |
writeSelection(ISelection selection)
Writes a selection to the writer. |
Methods inherited from class java.io.FilterWriter |
close, flush, write, write, write |
Methods inherited from class java.io.Writer |
write, write |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int DEFAULT_DECIMAL_COUNT
protected static java.text.DateFormat sDefaultDateFormat
protected static java.text.NumberFormat sDefaultIntegerFormat
protected static java.text.NumberFormat sDefaultFloatFormat
Constructor Detail |
public EntityWriter(java.io.Writer out)
public EntityWriter(java.io.Writer out, int fieldSeparator, int entitySeparator)
Method Detail |
public static java.lang.String createDragString(ISelection selection)
public static java.text.NumberFormat getDefaultIntegerFormat()
public static void setDefaultIntegerFormat(java.text.NumberFormat format)
public static java.text.NumberFormat getDefaultFloatFormat()
public static void setDefaultFloatFormat(java.text.NumberFormat format)
public static java.text.DateFormat getDefaultDateFormat()
public static void setDefaultDateFormat(java.text.DateFormat format)
public void writeFieldTitles(IEntityDescriptor entityDescriptor) throws java.io.IOException
java.io.IOException
public void writeEntity(IEntity entity) throws java.io.IOException
java.io.IOException
public void writeSelection(ISelection selection) throws java.io.IOException
java.io.IOException
public void writeMappedSelection(ISelection selection) throws java.io.IOException
java.io.IOException
public int getFieldSeparator()
public void setFieldSeparator(int character)
public int getRecordSeparator()
public void setRecordSeparator(int character)
public int getStringDelimiter()
public void setStringDelimiter(int character)
public java.lang.String getNullValue()
public void setNullValue(java.lang.String nullString)
public void addBlockedDataType(DataType dataType)
public boolean isDataTypeBlocked(DataType dataType)
public void setPrintFormat(boolean usePrintFormat)
public boolean isPrintFormat()
protected void writeData(DataType dataType, java.lang.Object data) throws java.io.IOException
java.io.IOException
protected boolean useStringDelimiter(DataType dataType)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |