Package org.pentaho.reporting.libraries.formatting

Examples of org.pentaho.reporting.libraries.formatting.FastMessageFormat


      if (fields.length > 0)
      {
        final Locale locale = this.locale == null ? Locale.getDefault() : this.locale;
        final TimeZone timeZone = this.timeZone == null ? TimeZone.getDefault() : this.timeZone;

        this.format = new FastMessageFormat(this.compiledFormat, locale, timeZone);
        if (nullString != null)
        {
          this.format.setNullString(nullString);
        }
      }
View Full Code Here


  public static String generateUniqueExpressionName(final DataSchema dataSchema,
                                                    final String pattern,
                                                    final String[] extraColumns) throws ReportProcessingException
  {
    final FastMessageFormat fastMessageFormat = new FastMessageFormat(pattern);
    if (fastMessageFormat.getSubFormatCount() == 0)
    {
      throw new IllegalArgumentException();
    }

    final HashSet<String> names = new HashSet<String>(Arrays.asList(dataSchema.getNames()));
    for (int i = 0; i < extraColumns.length; i++)
    {
      names.add(extraColumns[i]);
    }

    final Object[] data = new Object[1];
    int i = 0;
    // call me at any time if you have more than 32000 functions of the same name-pattern in a single report.
    while (i < Short.MAX_VALUE)
    {
      data[0] = IntegerCache.getInteger(i);
      final String s = fastMessageFormat.format(data);
      if (names.contains(s) == false)
      {
        return s;
      }
      i += 1;
View Full Code Here

  public static String generateUniqueExpressionName(final DataSchema dataSchema,
                                                    final String pattern,
                                                    final AbstractReportDefinition extraColumns)
      throws ReportProcessingException
  {
    final FastMessageFormat fastMessageFormat = new FastMessageFormat(pattern);
    if (fastMessageFormat.getSubFormatCount() == 0)
    {
      throw new IllegalArgumentException();
    }

    final HashSet<String> names = new HashSet<String>(Arrays.asList(dataSchema.getNames()));
    final Expression[] expressions = extraColumns.getExpressions().getExpressions();
    for (int i = 0; i < expressions.length; i++)
    {
      final Expression expression = expressions[i];
      names.add(expression.getName());
    }

    final Object[] data = new Object[1];
    int i = 0;
    // call me at any time if you have more than 32000 functions of the same name-pattern in a single report.
    while (i < Short.MAX_VALUE)
    {
      data[0] = IntegerCache.getInteger(i);
      final String s = fastMessageFormat.format(data);
      if (names.contains(s) == false)
      {
        return s;
      }
      i += 1;
View Full Code Here

          return "null"; // NON-NLS
        }
        return quote(String.valueOf(o));
      }

      final FastMessageFormat messageFormat = new FastMessageFormat(formatString, locale);
      return messageFormat.format(new Object[]{o});
    }
View Full Code Here

          return "null";
        }
        return quote(String.valueOf(o));
      }

      final FastMessageFormat messageFormat = new FastMessageFormat(formatString, locale);
      return messageFormat.format(new Object[]{o});
    }
View Full Code Here

        final String name = pathModel.getName();
        final String path = pathModel.getPath();
        final String solution = pathModel.getSolution();

        final FastMessageFormat messageFormat = new FastMessageFormat
            ("/content/reporting/?renderMode=XML&amp;solution={0}&amp;path={1}&amp;name={2}");
        messageFormat.setNullString("");
        return loginData.getUrl() + messageFormat.format(new Object[]{solution, path, name});
      }

      logger.debug("Ancient pentaho system detected: We will not have access to a working parameter service");
      return null;
    }
View Full Code Here

TOP

Related Classes of org.pentaho.reporting.libraries.formatting.FastMessageFormat

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.