Package org.pentaho.reporting.libraries.base.util

Examples of org.pentaho.reporting.libraries.base.util.CSVTokenizer


        if (transferData == null)
        {
          return false;
        }

        final CSVTokenizer tokenizer = new CSVTokenizer(transferData, ",", "\"");
        final ArrayList<String> items = new ArrayList<String>();
        while (tokenizer.hasMoreElements())
        {
          items.add(tokenizer.nextToken());
        }

        final DropLocation dropLocation = support.getDropLocation();
        final Point point = dropLocation.getDropPoint();
        final int idx = targetList.locationToIndex(point);
View Full Code Here


      resultList = new ArrayList(strtokenizer.countTokens());
      strtok = strtokenizer;
    }
    else
    {
      final CSVTokenizer strtokenizer = new CSVTokenizer(sequence, separator, quote, false);
      resultList = new ArrayList(strtokenizer.countTokens());
      strtok = strtokenizer;
    }

    while (strtok.hasMoreElements())
    {
View Full Code Here

    if (s == null)
    {
      throw new NullPointerException();
    }

    final CSVTokenizer tokenizer = new CSVTokenizer(s, false);
    final ArrayList<Object> elements = new ArrayList<Object>();
    while (tokenizer.hasMoreTokens())
    {
      final String token = tokenizer.nextToken();
      if (token == null || token.length() == 0)
      {
        elements.add(null);
      }
      else
View Full Code Here

  protected String lookupVariable(final String entity)
  {
    // first, split the entity into separate strings (separator is '.').

    final CSVTokenizer tokenizer = new CSVTokenizer(entity, ".");
    if (tokenizer.hasMoreTokens())
    {
      final String name = tokenizer.nextToken();
      final Object base = performInitialLookup(name);
      try
      {
        if (tokenizer.hasMoreTokens())
        {
          return BeanPropertyLookupParser.continueLookupVariable(tokenizer, base);
        }
        else
        {
View Full Code Here

    {
      throw new ReportDataFactoryException("Malformed query: " + query); //$NON-NLS-1$
    }
    final String parameterText =
        query.substring(parameterStartIdx + 1, parameterEndIdx);
    final CSVTokenizer tokenizer = new CSVTokenizer(parameterText, ",", "\"", false);
    final int size = tokenizer.countTokens();
    final String[] parameterNames = new String[size];
    int i = 0;
    while (tokenizer.hasMoreTokens())
    {
      parameterNames[i] = tokenizer.nextToken();
      i += 1;
    }
    return parameterNames;
  }
View Full Code Here

  }

  public void testCSVTokenizer()
  {
    final String example = "\"Test\"";
    final CSVTokenizer tokenizer = new CSVTokenizer(example, false);
    assertTrue("Tokenizer has at least one element", tokenizer.hasMoreTokens());
    assertEquals(tokenizer.nextToken(), "Test");
  }
View Full Code Here

  }

  private String[] splitLine(final String line, final boolean trim)
  {
    final ArrayList row = new ArrayList();
    final CSVTokenizer tokenizer = new CSVTokenizer(line, getSeparator(), "\"", trim);
    while (tokenizer.hasMoreElements())
    {
      final String o = (String) tokenizer.nextElement();
      if (trim)
      {
        row.add(o.trim());
      }
      else
View Full Code Here

     * @param name the name of the property to look up.
     * @return the translated value.
     */
    protected String lookupVariable(final String name)
    {
      final CSVTokenizer tokenizer = new CSVTokenizer(name, false);
      if (tokenizer.hasMoreTokens() == false)
      {
        return null;
      }
      final String varName = tokenizer.nextToken();

      final StringBuilder b = new StringBuilder(name.length());
      b.append('{');
      b.append(String.valueOf(fields.size()));
      while (tokenizer.hasMoreTokens())
      {
        b.append(',');
        b.append(tokenizer.nextToken());
      }
      b.append('}');
      final String formatString = b.toString();
      fields.add(varName);
      return formatString;
View Full Code Here

     * @param name the name of the property to look up.
     * @return the translated value.
     */
    protected String lookupVariable(final String name)
    {
      final CSVTokenizer tokenizer = new CSVTokenizer(name, false);
      if (tokenizer.hasMoreTokens() == false)
      {
        // invalid reference ..
        return null;
      }

      final String parameterName = tokenizer.nextToken();
      collectedParameter.add(parameterName);
      final Object o = parameters.get(parameterName);
      String subType = null;
      final StringBuilder b = new StringBuilder(name.length() + 4);
      b.append('{');
      b.append("0");
      while (tokenizer.hasMoreTokens())
      {
        b.append(',');
        final String token = tokenizer.nextToken();
        b.append(token);
        if (subType == null)
        {
          subType = token;
        }
View Full Code Here

      final String bootModules =
          getGlobalConfig().getConfigProperty
              ("org.pentaho.reporting.engine.classic.core.boot.Modules"); // NON-NLS
      if (bootModules != null)
      {
        final CSVTokenizer csvToken = new CSVTokenizer(bootModules, ",");
        while (csvToken.hasMoreTokens())
        {
          final String token = csvToken.nextToken();
          getPackageManager().load(token);
        }
      }
    }
    catch (SecurityException se)
View Full Code Here

TOP

Related Classes of org.pentaho.reporting.libraries.base.util.CSVTokenizer

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.