public class FormatParser extends Object implements DataFilter
Constructor and Description |
---|
FormatParser()
DefaultConstructor.
|
Modifier and Type | Method and Description |
---|---|
FormatParser |
clone()
Clones the parser.
|
DataSource |
getDataSource()
Returns the data source for the filter.
|
Format |
getFormatter()
Returns the format for the filter.
|
Object |
getNullValue()
Returns the object representing a null value from the data source.
|
Object |
getValue(ExpressionRuntime runtime,
ReportElement element)
Returns the parsed object.
|
protected boolean |
isValidOutput(Object o)
Checks whether the given value is already a valid result.
|
void |
setDataSource(DataSource ds)
Sets the data source.
|
void |
setFormatter(Format format)
Sets the format for the filter.
|
void |
setNullValue(Object nullvalue)
Sets the value that will be displayed if the data source supplies a null value.
|
public void setFormatter(Format format)
format
- The format.NullPointerException
- if the given format is nullpublic Format getFormatter()
public Object getValue(ExpressionRuntime runtime, ReportElement element)
getValue
in interface DataSource
runtime
- the expression runtime that is used to evaluate formulas and expressions when computing the value of this
filter.element
- protected boolean isValidOutput(Object o)
o
- the object to parse.public DataSource getDataSource()
getDataSource
in interface DataTarget
public void setDataSource(DataSource ds)
setDataSource
in interface DataTarget
ds
- The data source.public void setNullValue(Object nullvalue)
nullvalue
- The value returned when the parsing failed.public Object getNullValue()
public FormatParser clone() throws CloneNotSupportedException
clone
in interface DataSource
clone
in interface DataTarget
clone
in class Object
CloneNotSupportedException
- this should never happen.Copyright © 2017 Hitachi Vantara. All rights reserved.