Package org.pentaho.reporting.engine.classic.core.filter

Examples of org.pentaho.reporting.engine.classic.core.filter.MessageFormatSupport


      return new String[]{String.valueOf(attributeValue)};
    }
    else if ("Message".equals(propertyRole))
    {
      final String message = String.valueOf(attributeValue);
      final MessageFormatSupport messageFormatSupport = new MessageFormatSupport();
      messageFormatSupport.setFormatString(message);
      return messageFormatSupport.getFields();
    }
    else if ("Formula".equals(propertyRole))
    {
      final String formula = String.valueOf(attributeValue);
      try
View Full Code Here


  }

  public void testQuotedExample ()
  {
    final String example = "$(\"customer.firstName\") $(\"customer.lastName\")";
    final MessageFormatSupport support = new MessageFormatSupport();
    support.setFormatString(example);
    assertEquals("CompiledFormat", "{0} {1}", support.getCompiledFormat());
  }
View Full Code Here

    assertEquals(tokenizer.nextToken(), "Test");
  }

  public void testComplexReplacement ()
  {
    MessageFormatSupport support = new MessageFormatSupport();
    support.setFormatString("$(null,number,integer), $(dummy), $(null,date), $(null,number,integer)");
    SimpleDataRow sdr = new SimpleDataRow();
    sdr.add("null", null);
    sdr.add("dummy", "Content");

    String text = support.performFormat(sdr);
    assertEquals("Expected content w/o nullString", "<null>, Content, <null>, <null>", text);
    System.out.println(text);

    support.setNullString("-");
    String ntext = support.performFormat(sdr);
    assertEquals("Expected content w nullString", "-, Content, -, -",ntext);
    System.out.println(ntext);
  }
View Full Code Here

      return new String[]{String.valueOf(attributeValue)};
    }
    else if ("Message".equals(valueRole))
    {
      final String message = String.valueOf(attributeValue);
      final MessageFormatSupport messageFormatSupport = new MessageFormatSupport();
      messageFormatSupport.setFormatString(message);
      return messageFormatSupport.getFields();
    }
    else if ("Formula".equals(valueRole))
    {
      final String formula = String.valueOf(attributeValue);
      try
View Full Code Here

      return new String[]{String.valueOf(attributeValue)};
    }
    else if ("Message".equals(propertyRole))
    {
      final String message = String.valueOf(attributeValue);
      final MessageFormatSupport messageFormatSupport = new MessageFormatSupport();
      messageFormatSupport.setFormatString(message);
      return messageFormatSupport.getFields();
    }
    else if ("Formula".equals(propertyRole))
    {
      final String formula = String.valueOf(attributeValue);
      try
View Full Code Here

  /**
   * Default constructor.
   */
  public ResourceMesssageFormatExpression()
  {
    messageFormatSupport = new MessageFormatSupport();
  }
View Full Code Here

  /**
   * Default constructor.
   */
  public MessageFormatExpression()
  {
    messageFormatSupport = new MessageFormatSupport();
    encoding = "ISO-8859-1";
  }
View Full Code Here


  public Expression getInstance()
  {
    final MessageFormatExpression ex = (MessageFormatExpression) super.getInstance();
    ex.messageFormatSupport = new MessageFormatSupport();
    return ex;
  }
View Full Code Here

          //noinspection SimpleDateFormatWithoutLocale
          final DateFormat fmt = new SimpleDateFormat(fmtString);
        }
        else if ("Message".equals(role))//NON-NLS
        {
          final MessageFormatSupport support = new MessageFormatSupport();
          support.setFormatString(fmtString);
        }
      }
      catch (Exception e)
      {
        resultHandler.notifyInspectionResult(new InspectionResult(this, InspectionResult.Severity.WARNING,
View Full Code Here

            //noinspection SimpleDateFormatWithoutLocale
            final DateFormat fmt = new SimpleDateFormat(String.valueOf(o));
          }
          else if ("Message".equals(role))//NON-NLS
          {
            final MessageFormatSupport support = new MessageFormatSupport();
            support.setFormatString(fmtString);
          }
        }
        catch (Exception e)
        {
          final AttributeMetaData attrMetaData =
View Full Code Here

TOP

Related Classes of org.pentaho.reporting.engine.classic.core.filter.MessageFormatSupport

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.