Package de.hybris.bootstrap.xml
Class DateTagWriter
java.lang.Object
de.hybris.bootstrap.xml.XMLTagWriter
de.hybris.bootstrap.xml.SimpleTagWriter
de.hybris.bootstrap.xml.DateTagWriter
XML tag writer for outputting
Date objects. Additionally it allows to define the date format
pattern.-
Constructor Summary
ConstructorsConstructorDescriptionDateTagWriter(XMLTagWriter parent, String tagName) Creates a new optional date tag writer.DateTagWriter(XMLTagWriter parent, String tagName, boolean mandatory) Creates a new date tag writer. -
Method Summary
Modifier and TypeMethodDescriptionprotected DateFormatCreates the date format for this tag once.protected final DateFormatvoidsetDateFormat(String pattern) Allows to define the date format by passing aSimpleDateFormatpattern to this tag.protected voidwriteContent(org.znerd.xmlenc.XMLOutputter xmlOut, Object object) Outputs the given objects by calling itsObject.toString()method.Methods inherited from class de.hybris.bootstrap.xml.SimpleTagWriter
getTagNameMethods inherited from class de.hybris.bootstrap.xml.XMLTagWriter
addSubTagWriter, addSubTagWriter, addSubTagWriter, debug, error, getAllSubTagWriter, getAttributesMap, getEnclosingWriter, getParent, getSubTagWriter, getSubTagWriter, getSubTagWriterMap, info, isDebugEnabled, isErrorEnabled, isInfoEnabled, isMandatory, isWarnEnabled, warn, write
-
Constructor Details
-
DateTagWriter
Creates a new optional date tag writer.- Parameters:
parent- the parent tag writertagName- the tag name
-
DateTagWriter
Creates a new date tag writer.- Parameters:
parent- the parent tag writertagName- the tag namemandatory- tells whether or not the tag writer requires a non-null value
-
-
Method Details
-
setDateFormat
Allows to define the date format by passing aSimpleDateFormatpattern to this tag.Be sure to call this before writing any object!
- Parameters:
pattern- the pattern to use as date format- Throws:
IllegalStateException- when the tag writer has already begun to write any object
-
createDateFormat
Creates the date format for this tag once. -
getDateFormat
-
writeContent
Description copied from class:SimpleTagWriterOutputs the given objects by calling itsObject.toString()method.- Overrides:
writeContentin classSimpleTagWriter- Parameters:
xmlOut- theXMLOutputterto write toobject- the data object provided by the parent tag writer, may be null- Throws:
IOException
-