Class NumberFieldType
- java.lang.Object
-
- org.pentaho.reporting.engine.classic.core.filter.types.AbstractElementType
-
- org.pentaho.reporting.engine.classic.core.filter.types.NumberFieldType
-
- All Implemented Interfaces:
Serializable
,Cloneable
,DataSource
,RawDataSource
,RotatableText
,ElementType
public class NumberFieldType extends AbstractElementType implements RawDataSource, RotatableText
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
NumberFieldType.NumberFieldTypeContext
-
Field Summary
Fields Modifier and Type Field Description static NumberFieldType
INSTANCE
-
Constructor Summary
Constructors Constructor Description NumberFieldType()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
configureDesignTimeDefaults(ReportElement element, Locale locale)
Compute the design-time defaults that should be applied to an element after it was created by a design-tool.Object
getDesignValue(ExpressionRuntime runtime, ReportElement element)
Compute a design-time value.FormatSpecification
getFormatString(ExpressionRuntime runtime, ReportElement element, FormatSpecification formatSpecification)
Returns information about the formatstring that was used to transform a raw-value into a formatted text.Object
getRawValue(ExpressionRuntime runtime, ReportElement element)
Returns the unformated raw value.Object
getValue(ExpressionRuntime runtime, ReportElement element)
Returns the current value for the data source.-
Methods inherited from class org.pentaho.reporting.engine.classic.core.filter.types.AbstractElementType
clone, create, equals, getId, getMetaData, hashCode
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.pentaho.reporting.engine.classic.core.filter.DataSource
clone
-
Methods inherited from interface org.pentaho.reporting.engine.classic.core.filter.types.RotatableText
rotate
-
-
-
-
Field Detail
-
INSTANCE
public static final NumberFieldType INSTANCE
-
-
Method Detail
-
getDesignValue
public Object getDesignValue(ExpressionRuntime runtime, ReportElement element)
Description copied from interface:ElementType
Compute a design-time value. This value will be displayed when editing the element in the Pentaho Report Designer. If there is not enough data available to produce a sensible output, return a mock-object so that the user can interact with the element in a sensible fashion. When the element is called, all style and attribute expressions have been resolved and can be accessed via the normal static style and attribute accessor methods. If the content of your element depends on style information, the fully computed style must be retrieved via the.Element#getComputedStyle()
method. The local style-sheet for the element may not have all information.- Specified by:
getDesignValue
in interfaceElementType
- Parameters:
runtime
- the expression runtime holding the current report state.element
- the element.- Returns:
- the computed value.
-
getRawValue
public Object getRawValue(ExpressionRuntime runtime, ReportElement element)
Returns the unformated raw value. Whether that raw value is useable for the export is beyond the scope of this API definition, but providing access toNumber
orDate
objects is a good idea.- Specified by:
getRawValue
in interfaceRawDataSource
- Parameters:
runtime
- the expression runtime that is used to evaluate formulas and expressions when computing the value of this filter.element
-- Returns:
- the raw data.
-
getFormatString
public FormatSpecification getFormatString(ExpressionRuntime runtime, ReportElement element, FormatSpecification formatSpecification)
Returns information about the formatstring that was used to transform a raw-value into a formatted text. Not all elements will make use of a format-string. These elements will return.classic.core.filter.FormatSpecification#TYPE_UNDEFINED
in that case.- Specified by:
getFormatString
in interfaceRawDataSource
- Parameters:
runtime
- the Expression runtime used to possibly compute the raw-value.element
- the element to which this datasource is added.formatSpecification
- the format specification (can be null). @return a filled format specififcation. If theformatSpecification
parameter was not null, this given instance is reused.
-
configureDesignTimeDefaults
public void configureDesignTimeDefaults(ReportElement element, Locale locale)
Description copied from interface:ElementType
Compute the design-time defaults that should be applied to an element after it was created by a design-tool. Only declare explicit values. If you assume defaults when an attribute or style is undefined, then there is no need to set it here. Any value set here will be treated as user-defined value afterwards and will be explicitly stored in the XML files.- Specified by:
configureDesignTimeDefaults
in interfaceElementType
- Overrides:
configureDesignTimeDefaults
in classAbstractElementType
- Parameters:
element
- the element that should be configured.locale
- the locale.
-
getValue
public Object getValue(ExpressionRuntime runtime, ReportElement element)
Returns the current value for the data source.- Specified by:
getValue
in interfaceDataSource
- Parameters:
runtime
- the expression runtime that is used to evaluate formulas and expressions when computing the value of this filter.element
- the element from which to read attribute.- Returns:
- the value.
-
-