public class DefaultTypeRegistry extends java.lang.Object implements TypeRegistry
| Constructor and Description |
|---|
DefaultTypeRegistry() |
| Modifier and Type | Method and Description |
|---|---|
TypeValuePair |
convertTo(Type targetType,
TypeValuePair valuePair)
Checks whether the target type would accept the specified value object and value type.
This method is called for auto conversion of fonction parameters using the conversion type declared by the function metadata. |
ArrayCallback |
convertToArray(Type type,
java.lang.Object value) |
java.util.Date |
convertToDate(Type type1,
java.lang.Object value)
Converts the object of the given type into a date.
|
java.lang.Boolean |
convertToLogical(Type type1,
java.lang.Object value)
Converts the object of the given type into a boolean.
|
java.lang.Number |
convertToNumber(Type sourceType,
java.lang.Object value)
converts the object of the given type into a number.
|
NumberSequence |
convertToNumberSequence(Type type,
java.lang.Object value,
boolean strict)
Converts the given (type,value) pair into a numeric sequence.
|
Sequence |
convertToSequence(Type type,
java.lang.Object value) |
java.lang.String |
convertToText(Type type1,
java.lang.Object value)
(This conversion is used by the operator implementations.)
|
ExtendedComparator |
getComparator(Type type1,
Type type2)
Returns an comparator for the given types.
|
Type |
guessTypeOfObject(java.lang.Object o) |
void |
initialize(org.pentaho.reporting.libraries.base.config.Configuration configuration,
FormulaContext formulaContext)
Deprecated.
Use the single-argument function instead.
|
void |
initialize(FormulaContext formulaContext) |
public ExtendedComparator getComparator(Type type1, Type type2)
getComparator in interface TypeRegistrytype1 - type2 - public java.lang.Number convertToNumber(Type sourceType, java.lang.Object value) throws EvaluationException
convertToNumber in interface TypeRegistrysourceType - value - java.lang.NumberFormatException - if the type cannot be represented as number.TypeConversionException - if the type cannot be represented as number.EvaluationExceptionpublic void initialize(org.pentaho.reporting.libraries.base.config.Configuration configuration,
FormulaContext formulaContext)
configuration - formulaContext - public void initialize(FormulaContext formulaContext)
public java.lang.String convertToText(Type type1, java.lang.Object value) throws EvaluationException
TypeRegistryconvertToText in interface TypeRegistryTypeConversionExceptionEvaluationExceptionpublic java.lang.Boolean convertToLogical(Type type1, java.lang.Object value) throws TypeConversionException
TypeRegistryconvertToLogical in interface TypeRegistryTypeConversionExceptionpublic java.util.Date convertToDate(Type type1, java.lang.Object value) throws EvaluationException
TypeRegistryconvertToDate in interface TypeRegistryEvaluationExceptionpublic ArrayCallback convertToArray(Type type, java.lang.Object value) throws EvaluationException
convertToArray in interface TypeRegistryEvaluationExceptionpublic Sequence convertToSequence(Type type, java.lang.Object value) throws EvaluationException
convertToSequence in interface TypeRegistryEvaluationExceptionpublic NumberSequence convertToNumberSequence(Type type, java.lang.Object value, boolean strict) throws EvaluationException
TypeRegistryconvertToNumberSequence in interface TypeRegistryTypeConversionExceptionEvaluationExceptionpublic TypeValuePair convertTo(Type targetType, TypeValuePair valuePair) throws EvaluationException
convertTo in interface TypeRegistrytargetType - valuePair - EvaluationExceptionpublic Type guessTypeOfObject(java.lang.Object o)
guessTypeOfObject in interface TypeRegistry