|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.pentaho.reporting.engine.classic.core.filter.FormatParser
org.pentaho.reporting.engine.classic.core.filter.DateFormatParser
org.pentaho.reporting.engine.classic.core.filter.SimpleDateFormatParser
public class SimpleDateFormatParser
Parses a String into a java.util.Date. The string is read from the given datasource and then parsed by the dateformat contained in this FormatParser.
If the object read from the datasource is no string, the value is converted to string using String.valueOf (Object) This implementation uses a SimpleDateFormat and grants more control over the parsing results.
SimpleDateFormat
,
Serialized FormConstructor Summary | |
---|---|
SimpleDateFormatParser()
DefaultConstructor. |
Method Summary | |
---|---|
String |
getFormatString()
Returns the formatString for this SimpleDateFormat. |
String |
getLocalizedFormatString()
Returns a localized formatString for this SimpleDateFormat. |
SimpleDateFormat |
getSimpleDateFormat()
Returns the SimpleDateFormat object used in this parser. |
Object |
getValue(ExpressionRuntime runtime,
Element element)
Returns the formatted string. |
boolean |
isKeepState()
Defines, whether the filter should keep its state, if a locale change is detected. |
void |
setFormatString(String format)
defines the formatString for this SimpleDateFormat. |
void |
setFormatter(Format format)
Sets the date format for the filter. |
void |
setKeepState(boolean keepState)
Defines, whether the filter should keep its state, if a locale change is detected. |
void |
setLocalizedFormatString(String format)
defines the localized formatString for this SimpleDateFormat. |
void |
setSimpleDateFormat(SimpleDateFormat format)
Sets the date format for the parser. |
Methods inherited from class org.pentaho.reporting.engine.classic.core.filter.DateFormatParser |
---|
getDateFormat, setDateFormat, setNullValue |
Methods inherited from class org.pentaho.reporting.engine.classic.core.filter.FormatParser |
---|
clone, getDataSource, getFormatter, getNullValue, setDataSource |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SimpleDateFormatParser()
Method Detail |
---|
public SimpleDateFormat getSimpleDateFormat()
public void setSimpleDateFormat(SimpleDateFormat format)
format
- The format.
NullPointerException
- if the format given is nullpublic void setFormatter(Format format)
setFormatter
in class DateFormatParser
format
- The format.
NullPointerException
- if the format given is null
ClassCastException
- if the format given is no DateFormatpublic String getFormatString()
SimpleDateFormat
public void setFormatString(String format)
format
- the formatString
IllegalArgumentException
- if the string is invalidpublic String getLocalizedFormatString()
SimpleDateFormat
public void setLocalizedFormatString(String format)
format
- the formatString
IllegalArgumentException
- if the string is invalidpublic boolean isKeepState()
public void setKeepState(boolean keepState)
keepState
- set to true, if the locale should not update the DateSymbols, false otherwise.public Object getValue(ExpressionRuntime runtime, Element element)
getValue
in interface DataSource
getValue
in class DateFormatParser
runtime
- the expression runtime that is used to evaluate formulas and expressions when computing the value of
this filter.element
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |