Package org.pentaho.reporting.libraries.formula.lvalues

Examples of org.pentaho.reporting.libraries.formula.lvalues.ContextLookup


                                    final LValue val = (LValue) parser.parse(reportExp.getFormulaExpression());
                                    if (val instanceof FormulaFunction)
                                    {
                                        final FormulaFunction reportFunction = (FormulaFunction) val;
                                   
                                        final ContextLookup context = (ContextLookup) reportFunction.getChildValues()[0];
                                        name = context.getName();
                                    }
                                    else if (val instanceof Term)
                                    {
                                        final Term term = (Term) val;
                                        final ContextLookup context = (ContextLookup) term.getHeadValue().getChildValues()[0];
                                        name = context.getName();
                                    }
                                    break;
                                }
                            }
                        }
View Full Code Here


    public LValue getRaw(final int row, final int column) throws EvaluationException
    {
      if (column == 0)
      {
        final ContextLookup lookup = new ContextLookup("." + firstColumnName + (firstRow + row));
        lookup.initialize(TestFormulaContext.this);
        return lookup;
      }
      return null;
    }
View Full Code Here

      ;
    }
    switch (jj_nt.kind) {
    case COLUMN_LOOKUP:
      value = jj_consume_token(COLUMN_LOOKUP);
                                retval = new ContextLookup (ParserTools.stripReferenceQuote(value.image), createPosition(value));
      break;
    case STRING_LITERAL:
      value = jj_consume_token(STRING_LITERAL);
                                 retval = new StaticValue (ParserTools.stripQuote(value.image), TextType.TYPE, createPosition(value));
      break;
View Full Code Here

        collectReferences(childValue, map);
      }
    }
    else if (lval instanceof ContextLookup)
    {
      final ContextLookup cl = (ContextLookup) lval;
      map.put(cl.getName(), Boolean.TRUE);
    }
  }
View Full Code Here

          return String.valueOf(o);
        }
      }
      else if (lValue instanceof ContextLookup)
      {
        ContextLookup l = (ContextLookup) lValue;
        return l.toString();
      }

      final String cellText = formula;
      return cellText.startsWith("=") ? cellText : "=" + cellText;
    }
View Full Code Here

    protected boolean isReferenceChanged(final LValue lValue)
    {
        if (lValue instanceof ContextLookup)
        {
            final ContextLookup rval = (ContextLookup) lValue;
            final String s = rval.getName();
            final DataRow view = getFlowController().getMasterRow().getGlobalView();
            try
            {
                final DataFlags flags = view.getFlags(s);
                if (flags != null && flags.isChanged())
View Full Code Here

                                    final LValue val = (LValue) parser.parse(reportExp.getFormulaExpression());
                                    if (val instanceof FormulaFunction)
                                    {
                                        final FormulaFunction reportFunction = (FormulaFunction) val;
                                   
                                        final ContextLookup context = (ContextLookup) reportFunction.getChildValues()[0];
                                        name = context.getName();
                                    }
                                    else if (val instanceof Term)
                                    {
                                        final Term term = (Term) val;
                                        final ContextLookup context = (ContextLookup) term.getHeadValue().getChildValues()[0];
                                        name = context.getName();
                                    }
                                    break;
                                }
                            }
                        }
View Full Code Here

                    if (parameters.length > 0)
                    {
                        String name = parameters[0].toString();
                        if (parameters[0] instanceof ContextLookup)
                        {
                            final ContextLookup context = (ContextLookup) parameters[0];
                            name = context.getName();
                        }
                        for (int j = 0; j < reportFunctions.length; j++)
                        {
                            if (reportFunctions[j] instanceof FormulaExpression)
                            {
                                final FormulaExpression reportExp = (FormulaExpression) reportFunctions[j];

                                if (reportExp.getName().equals(name))
                                {
                                    LValue val = parser.parse(reportExp.getFormulaExpression());
                                    while( !(val instanceof ContextLookup))
                                    {
                                        if (val instanceof Term)
                                        {
                                            val = ((Term)val).getHeadValue();
                                        }
                                        else if (val instanceof FormulaFunction)
                                        {
                                            final FormulaFunction reportFunction = (FormulaFunction) val;
                                            val = reportFunction.getChildValues()[0];
                                        }
                                    }
                                    if (val instanceof ContextLookup)
                                    {
                                        final ContextLookup context = (ContextLookup) val;
                                        name = context.getName();
                                    }
                                    break;
                                }
                            }
                        }
View Full Code Here

    protected boolean isReferenceChanged(final LValue lValue)
    {
        if (lValue instanceof ContextLookup)
        {
            final ContextLookup rval = (ContextLookup) lValue;
            final String s = rval.getName();
            final DataRow view = getFlowController().getMasterRow().getGlobalView();
            try
            {
                final DataFlags flags = view.getFlags(s);
                if (flags != null && flags.isChanged())
View Full Code Here

    public LValue getRaw(final int row, final int column) throws EvaluationException
    {
      if (column == 0)
      {
        final ContextLookup lookup = new ContextLookup("." + firstColumnName + (firstRow + row));
        lookup.initialize(formulaContext);
        return lookup;
      }
      return null;
    }
View Full Code Here

TOP

Related Classes of org.pentaho.reporting.libraries.formula.lvalues.ContextLookup

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.