Package org.pentaho.reporting.libraries.formula.typing

Examples of org.pentaho.reporting.libraries.formula.typing.Type


    String quote = "\"";
    String separator = ",";
    boolean doQuoting = false;
    if (parameterCount > 1)
    {
      final Type indexType = parameters.getType(1);
      final Object indexValue = parameters.getValue(1);
      final Boolean indexNumber = context.getTypeRegistry().convertToLogical(indexType, indexValue);
      doQuoting = Boolean.TRUE.equals(indexNumber);
    }

    if (parameterCount > 2)
    {
      final Type indexType = parameters.getType(2);
      final Object indexValue = parameters.getValue(2);
      separator = context.getTypeRegistry().convertToText(indexType, indexValue);
    }

    if (parameterCount > 3)
    {
      final Type indexType = parameters.getType(1);
      final Object indexValue = parameters.getValue(1);
      quote = context.getTypeRegistry().convertToText(indexType, indexValue);
    }

    final ArrayList resultList;
View Full Code Here


      throw EvaluationException.getInstance(LibFormulaErrorValue.ERROR_ARGUMENTS_VALUE);
    }

    try
    {
      final Type type = parameters.getType(0);
      final Object value = parameters.getValue(0);

      if (ErrorType.TYPE.equals(type) && value instanceof ErrorValue)
      {
        logger.warn ("Passing errors around is deprecated. Throw exceptions instead.");
View Full Code Here

    final int parameterCount = parameters.getParameterCount();
    if (parameterCount < 1)
    {
      throw EvaluationException.getInstance(LibFormulaErrorValue.ERROR_ARGUMENTS_VALUE);
    }
    final Type type1 = parameters.getType(0);
    final Object value1 = parameters.getValue(0);
    final String result = context.getTypeRegistry().convertToText(type1, value1);

    if(result == null)
    {
View Full Code Here

      throw EvaluationException.getInstance(LibFormulaErrorValue.ERROR_ARGUMENTS_VALUE);
    }

    try
    {
      final Type type = parameters.getType(0);
      final Object value = parameters.getValue(0);

      if(ErrorType.TYPE.equals(type) && value instanceof ErrorValue)
      {
        return RETURN_TRUE;
View Full Code Here

    if (value1Raw == null || value2Raw == null)
    {
      throw EvaluationException.getInstance(LibFormulaErrorValue.ERROR_NA_VALUE);
    }

    final Type type1 = parameters.getType(0);
    final Type type2 = parameters.getType(1);
    final ExtendedComparator comparator = typeRegistry.getComparator(type1, type2);
    final boolean result = comparator.isEqual (type1, value1Raw, type2, value2Raw);
    if (result)
    {
      return RETURN_TRUE;
View Full Code Here

    }

    final TypeRegistry typeRegistry = context.getTypeRegistry();
    for (int paramIdx = 0; paramIdx < parameterCount; paramIdx++)
    {
      final Type type = parameters.getType(paramIdx);
      final Object value = parameters.getValue(paramIdx);
      final Sequence sequence = typeRegistry.convertToSequence(type, value);

      while (sequence.hasNext())
      {
        final LValue lValue = sequence.nextRawValue();
        final TypeValuePair pair = lValue.evaluate();
        final Type type1 = pair.getType();
        final Object o = pair.getValue();
        final String str = typeRegistry.convertToText(type1, o);
        computedResult.append(str);
      }
    }
View Full Code Here

    if (parameterCount < 1)
    {
      throw EvaluationException.getInstance(LibFormulaErrorValue.ERROR_ARGUMENTS_VALUE);
    }

    final Type type1 = parameters.getType(0);
    if(type1.isFlagSet(Type.NUMERIC_TYPE))
    {
      return RETURN_TRUE;
    }

    return RETURN_FALSE;
View Full Code Here

    public TypeValuePair evaluate(FormulaContext context, ParameterCallback parameters) throws EvaluationException {
        final int parameterCount = parameters.getParameterCount();
        if (parameterCount != 1) {
            throw EvaluationException.getInstance(LibFormulaErrorValue.ERROR_ARGUMENTS_VALUE);
        }
        final Type type1 = parameters.getType(0);
        final Object value1 = parameters.getValue(0);
        final Number result = context.getTypeRegistry().convertToNumber(type1, value1);
        if (result == null ) {
            throw EvaluationException.getInstance(LibFormulaErrorValue.ERROR_INVALID_ARGUMENT_VALUE);
        }
View Full Code Here

    {
      throw EvaluationException.getInstance(LibFormulaErrorValue.ERROR_ARGUMENTS_VALUE);
    }

    final TypeRegistry typeRegistry = context.getTypeRegistry();
    final Type type = parameters.getType(0);
    final Object value = parameters.getValue(0);

    final Date date1 = typeRegistry.convertToDate(type, value);
    final Date time = DateUtil.normalizeDate(date1, DateTimeType.TIME_TYPE);
    return new TypeValuePair(DateTimeType.TIME_TYPE, time);
View Full Code Here

    {
      throw EvaluationException.getInstance(LibFormulaErrorValue.ERROR_ARGUMENTS_VALUE);
    }
    final TypeRegistry typeRegistry = context.getTypeRegistry();

    final Type textType1 = parameters.getType(0);
    final Object textValue1 = parameters.getValue(0);
    final Type textType2 = parameters.getType(1);
    final Object textValue2 = parameters.getValue(1);

    final String text = typeRegistry.convertToText(textType1, textValue1);
    final String substring = typeRegistry.convertToText(textType2, textValue2);
View Full Code Here

TOP

Related Classes of org.pentaho.reporting.libraries.formula.typing.Type

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.