Examples of StringPtg


Examples of org.apache.poi.hssf.record.formula.StringPtg

        sb.append('\0'); // list delimiter is the nul char
      }
      sb.append(_explicitListValues[i]);
   
    }
    return new Ptg[] { new StringPtg(sb.toString()), };
  }
View Full Code Here

Examples of org.apache.poi.hssf.record.formula.StringPtg

  private static void confirmStringParse(String singleQuotedValue) {
    // formula: internal quotes become double double, surround with double quotes
    String formula = '"' + singleQuotedValue.replaceAll("'", "\"\"") + '"';
    String expectedValue = singleQuotedValue.replace('\'', '"');

    StringPtg sp = (StringPtg) parseSingleToken(formula, StringPtg.class);
    assertEquals(expectedValue, sp.getValue());
  }
View Full Code Here

Examples of org.apache.poi.hssf.record.formula.StringPtg

    StringPtg sp = (StringPtg) parseSingleToken(formula, StringPtg.class);
    assertEquals(expectedValue, sp.getValue());
  }
  public void testParseStringLiterals_bug28754() {

    StringPtg sp;
    try {
      sp = (StringPtg) parseSingleToken("\"test\"\"ing\"", StringPtg.class);
    } catch (RuntimeException e) {
      if(e.getMessage().startsWith("Cannot Parse")) {
        throw new AssertionFailedError("Identified bug 28754a");
      }
      throw e;
    }
    assertEquals("test\"ing", sp.getValue());

    HSSFWorkbook wb = new HSSFWorkbook();
    HSSFSheet sheet = wb.createSheet();
    wb.setSheetName(0, "Sheet1");
View Full Code Here

Examples of org.apache.poi.ss.formula.ptg.StringPtg

    if (Character.isDigit(look)) {
      return new ParseNode(parseNumber());
    }
    if (look == '"') {
      return new ParseNode(new StringPtg(parseStringLiteral()));
    }
   
    // from now on we can only be dealing with non-quoted identifiers
    // which will either be named ranges or functions
    String name = parseAsName();
View Full Code Here

Examples of org.apache.poi.ss.formula.ptg.StringPtg

        Match('(');
        ParseNode inside = comparisonExpression();
        Match(')');
        return new ParseNode(ParenthesisPtg.instance, inside);
      case '"':
        return new ParseNode(new StringPtg(parseStringLiteral()));
      case '{':
        Match('{');
        ParseNode arrayNode = parseArray();
        Match('}');
        return arrayNode;
View Full Code Here

Examples of org.apache.poi.ss.formula.ptg.StringPtg

  private static void confirmStringParse(String singleQuotedValue) {
    // formula: internal quotes become double double, surround with double quotes
    String formula = '"' + singleQuotedValue.replaceAll("'", "\"\"") + '"';
    String expectedValue = singleQuotedValue.replace('\'', '"');

    StringPtg sp = (StringPtg) parseSingleToken(formula, StringPtg.class);
    assertEquals(expectedValue, sp.getValue());
  }
View Full Code Here

Examples of org.apache.poi.ss.formula.ptg.StringPtg

    StringPtg sp = (StringPtg) parseSingleToken(formula, StringPtg.class);
    assertEquals(expectedValue, sp.getValue());
  }
  public void testParseStringLiterals_bug28754() {

    StringPtg sp;
    try {
      sp = (StringPtg) parseSingleToken("\"test\"\"ing\"", StringPtg.class);
    } catch (RuntimeException e) {
      if(e.getMessage().startsWith("Cannot Parse")) {
        throw new AssertionFailedError("Identified bug 28754a");
      }
      throw e;
    }
    assertEquals("test\"ing", sp.getValue());

    HSSFWorkbook wb = new HSSFWorkbook();
    HSSFSheet sheet = wb.createSheet();
    wb.setSheetName(0, "Sheet1");
View Full Code Here

Examples of org.apache.poi.ss.formula.ptg.StringPtg

        sb.append('\0'); // list delimiter is the nul char
      }
      sb.append(_explicitListValues[i]);
   
    }
    return new Ptg[] { new StringPtg(sb.toString()), };
  }
View Full Code Here

Examples of org.apache.poi.ss.formula.ptg.StringPtg

  private static void confirmStringParse(String singleQuotedValue) {
    // formula: internal quotes become double double, surround with double quotes
    String formula = '"' + singleQuotedValue.replaceAll("'", "\"\"") + '"';
    String expectedValue = singleQuotedValue.replace('\'', '"');

    StringPtg sp = (StringPtg) parseSingleToken(formula, StringPtg.class);
    assertEquals(expectedValue, sp.getValue());
  }
View Full Code Here

Examples of org.apache.poi.ss.formula.ptg.StringPtg

    StringPtg sp = (StringPtg) parseSingleToken(formula, StringPtg.class);
    assertEquals(expectedValue, sp.getValue());
  }
  public void testParseStringLiterals_bug28754() {

    StringPtg sp;
    try {
      sp = (StringPtg) parseSingleToken("\"test\"\"ing\"", StringPtg.class);
    } catch (RuntimeException e) {
      if(e.getMessage().startsWith("Cannot Parse")) {
        throw new AssertionFailedError("Identified bug 28754a");
      }
      throw e;
    }
    assertEquals("test\"ing", sp.getValue());

    HSSFWorkbook wb = new HSSFWorkbook();
    HSSFSheet sheet = wb.createSheet();
    wb.setSheetName(0, "Sheet1");
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.