org.pentaho.reporting.engine.classic.core.function
Class ConvertToDateExpression

java.lang.Object
  extended by org.pentaho.reporting.engine.classic.core.function.AbstractExpression
      extended by org.pentaho.reporting.engine.classic.core.function.ConvertToDateExpression
All Implemented Interfaces:
Serializable, Cloneable, Expression

public class ConvertToDateExpression
extends AbstractExpression

Parses a string into a date using the given date-format.

Author:
Thomas Morgner
See Also:
SimpleDateFormat, Serialized Form

Constructor Summary
ConvertToDateExpression()
          Default Constructor.
 
Method Summary
 String getField()
          Returns the name of the data-row column from where to read the string that should be parsed.
 String getFormat()
          Returns the SimpleDateFormat pattern that is used for the parsing.
 Locale getLocale()
          Returns the locale that is used for the parsing.
 TimeZone getTimeZone()
           
 Object getValue()
          Parses the value read from the column specified by the given field-name and tries to parse it into a Date using the given SimpleDateFormat-pattern.
 void setField(String field)
          Defines the name of the data-row column from where to read the string that should be parsed.
 void setFormat(String format)
          Defines the SimpleDateFormat pattern that is used for the parsing.
 void setLocale(Locale locale)
          Defines the locale that is used for the parsing.
 void setTimeZone(TimeZone timeZone)
           
 
Methods inherited from class org.pentaho.reporting.engine.classic.core.function.AbstractExpression
clone, getDataRow, getDependencyLevel, getInstance, getName, getReportConfiguration, getResourceBundleFactory, getRuntime, isActive, isDeepTraversing, isPreserve, setActive, setDependencyLevel, setName, setPreserve, setRuntime
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConvertToDateExpression

public ConvertToDateExpression()
Default Constructor.

Method Detail

getField

public String getField()
Returns the name of the data-row column from where to read the string that should be parsed.

Returns:
the field name.

setField

public void setField(String field)
Defines the name of the data-row column from where to read the string that should be parsed.

Parameters:
field - the name of the field.

getFormat

public String getFormat()
Returns the SimpleDateFormat pattern that is used for the parsing.

Returns:
the pattern string.
See Also:
SimpleDateFormat

setFormat

public void setFormat(String format)
Defines the SimpleDateFormat pattern that is used for the parsing.

Parameters:
format - the pattern string.
See Also:
SimpleDateFormat

getLocale

public Locale getLocale()
Returns the locale that is used for the parsing.

Returns:
the locale.

setLocale

public void setLocale(Locale locale)
Defines the locale that is used for the parsing.

Parameters:
locale - the locale.

getTimeZone

public TimeZone getTimeZone()

setTimeZone

public void setTimeZone(TimeZone timeZone)

getValue

public Object getValue()
Parses the value read from the column specified by the given field-name and tries to parse it into a Date using the given SimpleDateFormat-pattern.

Returns:
the value of the function.