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

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


  /**
   * Creates a new template.
   */
  public ResourceMessageTemplate()
  {
    resourceFilter = new ResourceMessageFormatFilter();
    stringFilter = new StringFilter();
    stringFilter.setDataSource(resourceFilter);
  }
View Full Code Here


  private ResourceMessageFormatFilter messageFormatFilter;
  private transient ElementMetaData elementType;

  public ResourceMessageType()
  {
    messageFormatFilter = new ResourceMessageFormatFilter();
  }
View Full Code Here

    if (resourceId == null)
    {
      return nullValue;
    }

    final ResourceMessageFormatFilter messageFormatFilter = element.getElementContext(ResourceMessageFormatFilter.class);
    messageFormatFilter.setFormatKey(String.valueOf(message));
    messageFormatFilter.setResourceIdentifier(String.valueOf(resourceId));

    final Object messageNullValue = element.getAttribute
        (AttributeNames.Core.NAMESPACE, AttributeNames.Core.MESSAGE_NULL_VALUE);
    if (messageNullValue != null)
    {
      messageFormatFilter.setNullString(String.valueOf(messageNullValue));
    }
    else if (nullValue != null)
    {
      messageFormatFilter.setNullString(String.valueOf(nullValue));
    }
    else
    {
      messageFormatFilter.setNullString(null);
    }

    final Object value = messageFormatFilter.getValue(runtime, element);
    if (value == null)
    {
      return nullValue;
    }
    return String.valueOf(value);
View Full Code Here


  @Test
  public void testResourceMessageFormatFilterAcceptLocaleAndTimeZone() throws Exception
  {
    ResourceMessageFormatFilter t = new ResourceMessageFormatFilter();
    t.setResourceIdentifier("test");
    t.setFormatKey("format");

    Assert.assertEquals("2009-02-13T15:31:30,123-0800", t.getValue(runtime, new Element()));
  }
View Full Code Here

  /**
   * Creates a new template.
   */
  public ResourceMessageTemplate()
  {
    resourceFilter = new ResourceMessageFormatFilter();
    stringFilter = new StringFilter();
    stringFilter.setDataSource(resourceFilter);
  }
View Full Code Here

TOP

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

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.