public abstract class TagWriter<C extends ApplicationContext> extends DataWriter<C>
Modifier and Type | Field and Description |
---|---|
protected AttrList |
attrs |
static java.lang.String |
DEFAULT_ENCODING |
childTaskRef, isTestMode, monitorController, resultRef, stateFlag
Constructor and Description |
---|
TagWriter(C ctx,
java.io.File file) |
TagWriter(C ctx,
java.io.File file,
java.lang.String encoding) |
TagWriter(C ctx,
java.io.OutputStream out) |
TagWriter(C ctx,
java.io.OutputStream out,
java.lang.String encoding) |
TagWriter(C ctx,
java.lang.String fileName) |
TagWriter(C ctx,
java.lang.String fileName,
java.lang.String encoding) |
Modifier and Type | Method and Description |
---|---|
AttrList |
attr(java.lang.String key,
java.lang.String value)
Convenience method for single attribute
|
void |
close()
Closes the output stream.
|
void |
closeTag()
Closes the tag that was last opened.
|
protected java.lang.String |
getSimpleTagCloseBracket() |
protected java.lang.String |
getTag(java.lang.String tag) |
boolean |
isWritingEmptyTags()
Tells whether tags that contain no content should be written at all.
|
void |
openTag(java.lang.String tag)
Opens a tag with the given name.
|
void |
openTag(java.lang.String tag,
AttrList attrs)
Opens a tag with the given name and the given attribute list.
|
protected void |
performWrite()
Needs to be overridden to actually write data.
|
protected abstract void |
performWriteBody() |
protected void |
performWriteFooter() |
protected void |
performWriteHeader() |
protected void |
printIndent() |
void |
setIndentString(java.lang.String indentStr)
Sets the indentation String which is a String of two blanks by default.
|
void |
setWriteEmptyTags(boolean state)
Tells whether tags that contain no content should be written at all.
|
void |
writeComment(java.lang.String comment)
Writes a tagged comment.
|
void |
writeTag(java.lang.String tag)
Writes a simple non argument tag.
|
void |
writeTag(java.lang.String tag,
AttrList attrs)
Writes a complete tag which has attributes only but no value.
|
void |
writeTag(java.lang.String tag,
AttrList attrs,
java.lang.String value)
Opens, writes and closes a tag with the given name, attributes and value.
|
void |
writeTag(java.lang.String tag,
java.lang.String value)
Opens, writes and closes a tag with the given name and value.
|
void |
writeValue(java.lang.String value)
Writes the value for the last opened tag.
|
protected void |
writeXmlHeader() |
createFileOutputStream, executeAsync, flush, format, format, getEncoding, getOutputFile, getWriteDuration, getWriter, openStream, print, print, print, print, print, print, print, print, print, printf, printf, printLine, println, println, println, println, println, println, println, println, println, println, setCloseStreamWhenFinished, setEncoding, setOutputFile, setOutputStream, write, write, write, write, write
addMonitor, checkCancelled, checkForErrorAndRethrow, clearMonitors, createRunStateFlag, doOnCancel, doOnFailure, execute, executeSubTask, getError, getMaxProgressSteps, getMonitorCount, getMonitors, getName, getProgressStepCount, getResult, getRunStateFlag, getTaskId, getType, handleCancellation, handleFailure, handleFinish, handleStart, handleSuccess, hasError, hasMonitor, isCancellable, notifyProceeded, registerTaskStateChange, removeMonitor, resetProgress, setCancellable, setLogLevel, setMaxProgressSteps, setMonitor, setName, setName, setResult, setRunStateFlag, setTaskId, setType, shouldFireMonitor, sleepChecked, wasCancelled
getApplicationContext, getLogChannel, isLogDebug, isLogVerbose, logDebug, logDump, logError, logError, logFatal, logInfo, logVerbose, logWarning, setLogChannel
configureDumpHeadlineLength, configureDumpMaxElementsPrinted, copyDumpStringValues, copyToStringValues, createDumpHeader, toDumpString, toDumpString, toString, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getApplicationContext
getLogChannel, isLogDebug, isLogVerbose, logDebug, logDump, logError, logError, logFatal, logInfo, logVerbose, logWarning, setLogChannel
public static final java.lang.String DEFAULT_ENCODING
protected final AttrList attrs
public TagWriter(C ctx, java.lang.String fileName)
public TagWriter(C ctx, java.lang.String fileName, java.lang.String encoding)
public TagWriter(C ctx, java.io.File file)
public TagWriter(C ctx, java.io.File file, java.lang.String encoding)
public TagWriter(C ctx, java.io.OutputStream out)
public TagWriter(C ctx, java.io.OutputStream out, java.lang.String encoding)
protected void writeXmlHeader()
protected final void performWrite() throws java.lang.Exception
DataWriter
performWrite
in class DataWriter<C extends ApplicationContext>
java.lang.Exception
protected void performWriteHeader() throws java.lang.Exception
java.lang.Exception
protected abstract void performWriteBody() throws java.lang.Exception
java.lang.Exception
protected void performWriteFooter() throws java.lang.Exception
java.lang.Exception
public AttrList attr(java.lang.String key, java.lang.String value)
public void setIndentString(java.lang.String indentStr)
public void setWriteEmptyTags(boolean state)
public boolean isWritingEmptyTags()
public void openTag(java.lang.String tag)
closeTag()
method.public void openTag(java.lang.String tag, AttrList attrs)
closeTag()
method.public void writeTag(java.lang.String tag)
public void writeTag(java.lang.String tag, java.lang.String value)
public void writeTag(java.lang.String tag, AttrList attrs)
protected java.lang.String getSimpleTagCloseBracket()
public void writeTag(java.lang.String tag, AttrList attrs, java.lang.String value)
public void closeTag()
protected java.lang.String getTag(java.lang.String tag)
public void writeValue(java.lang.String value)
public void writeComment(java.lang.String comment)
protected void printIndent()
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class DataWriter<C extends ApplicationContext>
java.io.IOException
Copyright © 2014 EsprIT-Systems. All Rights Reserved.