Examples of FormulaParser


Examples of org.pentaho.reporting.libraries.formula.parser.FormulaParser

    public int getFunctionStartAtIndex(String formula, int position)
    {
        int nStartPos = -1;
        try
        {
            final FormulaParser parser = new FormulaParser();
            final LValue x = parser.parse(formula);
            String part = x.toString();
            while ( part.length() < position )
            {
                final LValue[] children = x.getChildValues();
                if ( children != null )
View Full Code Here

Examples of org.pentaho.reporting.libraries.formula.parser.FormulaParser

                parameters.put(SDBCReportDataFactory.DETAIL_COLUMNS, detailColumns);
            }

            final Node[] nodes = report.getNodeArray();

            final FormulaParser parser = new FormulaParser();
            final ArrayList expressions = new ArrayList();
            final OfficeReport officeReport = (OfficeReport) ((Section) nodes[0]).getNode(0);
            final Section reportBody = (Section) officeReport.getBodySection();
            collectGroupExpressions(reportBody.getNodeArray(), expressions, parser, officeReport.getExpressions());
            parameters.put(SDBCReportDataFactory.GROUP_EXPRESSIONS, expressions);
View Full Code Here

Examples of org.pentaho.reporting.libraries.formula.parser.FormulaParser

        m_xContext = context;
        final ClassLoader cl = java.lang.Thread.currentThread().getContextClassLoader();
        Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader());

        parser = new FormulaParser();
        try
        {
            final XFormulaOpCodeMapper mapper = (XFormulaOpCodeMapper) UnoRuntime.queryInterface(XFormulaOpCodeMapper.class, m_xContext.getServiceManager().createInstanceWithContext("simple.formula.FormulaOpCodeMapperObj", m_xContext));
            FormulaOpCodeMapEntry[] opCodes = mapper.getAvailableMappings(FormulaLanguage.ODFF, FormulaMapGroup.FUNCTIONS);
            final DefaultFormulaContext defaultContext = new DefaultFormulaContext();
View Full Code Here

Examples of org.pentaho.reporting.libraries.formula.parser.FormulaParser

      {
        formula = FormulaUtil.extractFormula(formulaWithPrefix);
      }
      try
      {
        final FormulaParser parser = new FormulaParser();
        final LValue value = parser.parse(formula);
        if (value instanceof FormulaFunction)
        {
          final FormulaFunction function = (FormulaFunction) value;
          if ("DRILLDOWN".equals(function.getFunctionName())) // NON-NLS
          {
View Full Code Here

Examples of org.pentaho.reporting.libraries.formula.parser.FormulaParser

      throw new NullPointerException();
    }

    try
    {
      final FormulaParser parser = new FormulaParser();
      this.rootReference = parser.parse(formulaText.trim());
    }
    catch (TokenMgrError tokenMgrError)
    {
      // This is ugly.
      throw new FormulaParseException(tokenMgrError);
View Full Code Here

Examples of org.pentaho.reporting.libraries.formula.parser.FormulaParser

    {
      return null;
    }
    try
    {
      final FormulaParser parser = new FormulaParser();
      final LValue lValue = parser.parse(formula);
      if (lValue.isConstant())
      {
        if (lValue instanceof StaticValue)
        {
          final StaticValue staticValue = (StaticValue) lValue;
View Full Code Here

Examples of org.pentaho.reporting.libraries.formula.parser.FormulaParser

  public static boolean isValidFormulaFragment(final String formula)
  {
    try
    {
      final FormulaParser parser = new FormulaParser();
      final LValue lValue = parser.parse(formula);
      return true;
    }
    catch (Exception e)
    {
      return false;
View Full Code Here

Examples of org.pentaho.reporting.libraries.formula.parser.FormulaParser

  public static String createCellUITextFromFormula(final String formula, final FormulaContext context)
  {
    try
    {
      final FormulaParser parser = new FormulaParser();
      final LValue lValue = parser.parse(formula);
      lValue.initialize(context);

      if (lValue.isConstant())
      {
        if (lValue instanceof StaticValue)
View Full Code Here

Examples of org.pentaho.reporting.libraries.formula.parser.FormulaParser

  {
    ArgumentNullException.validate("fomulaContext", formulaContext);

    try
    {
      final FormulaParser parser = new FormulaParser();
      final LValue lValue = parser.parse(formula);
      lValue.initialize(formulaContext);
      if (lValue.isConstant())
      {
        if (lValue instanceof StaticValue)
        {
View Full Code Here

Examples of org.pentaho.reporting.libraries.formula.parser.FormulaParser

        m_xContext = context;
        final ClassLoader cl = java.lang.Thread.currentThread().getContextClassLoader();
        Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader());

        parser = new FormulaParser();
        try
        {
            final XFormulaOpCodeMapper mapper = (XFormulaOpCodeMapper) UnoRuntime.queryInterface(XFormulaOpCodeMapper.class, m_xContext.getServiceManager().createInstanceWithContext("simple.formula.FormulaOpCodeMapperObj", m_xContext));
            FormulaOpCodeMapEntry[] opCodes = mapper.getAvailableMappings(FormulaLanguage.ODFF, FormulaMapGroup.FUNCTIONS);
            final DefaultFormulaContext defaultContext = new DefaultFormulaContext();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.