Package br.net.woodstock.rockframework.text

Examples of br.net.woodstock.rockframework.text.StringFormat


  private StringFormat  format;

  public TextConverter(final String pattern) {
    super();
    this.format = new StringFormat(pattern);
  }
View Full Code Here


    this.format = new StringFormat(pattern);
  }

  public TextConverter(final String pattern, final char character) {
    super();
    this.format = new StringFormat(pattern, character);
  }
View Full Code Here

  public void doTag() throws IOException {
    if (this.value == null) {
      return;
    }

    StringFormat format = null;

    if (ConditionUtils.isNotEmpty(this.template)) {
      format = StringFormatTemplate.getInstance().getFormat(this.template);
      if (format == null) {
        throw new IllegalStateException("Template not found");
      }
    } else if (ConditionUtils.isNotEmpty(this.format)) {
      format = new StringFormat(this.format, this.character);
    } else {
      throw new IllegalStateException("Pattern or template must be defined");
    }

    String value = this.value.toString();
    Writer writer = this.getJspContext().getOut();
    String formated = "";

    try {
      formated = format.format(value);
      formated = StringUtils.escapeHTML(formated);
    } catch (ArrayIndexOutOfBoundsException e) {
      WebLog.getInstance().getLog().warn("Error formating '" + value + "'  with mask '" + this.format + "'");
      formated = FormatTag.ERROR_VALUE;
    }
View Full Code Here

  public void doTag() throws IOException {
    if (this.value == null) {
      return;
    }

    StringFormat format = null;

    if (ConditionUtils.isNotEmpty(this.template)) {
      format = StringFormatTemplate.getInstance().getFormat(this.template);
      if (format == null) {
        throw new IllegalStateException("Template not found");
      }
    } else if (ConditionUtils.isNotEmpty(this.format)) {
      format = new StringFormat(this.format, this.character);
    } else {
      throw new IllegalStateException("Pattern or template must be defined");
    }

    String value = this.value.toString();
    Writer writer = this.getJspContext().getOut();
    String formated = "";

    try {
      formated = format.format(value);
      formated = StringUtils.escapeHTML(formated);
    } catch (ArrayIndexOutOfBoundsException e) {
      WebLog.getInstance().getLogger().warn("Error formating '" + value + "'  with mask '" + this.format + "'");
      formated = FormatTag.ERROR_VALUE;
    }
View Full Code Here

  public void doTag() throws IOException {
    if (this.value == null) {
      return;
    }

    StringFormat format = null;

    if (ConditionUtils.isNotEmpty(this.template)) {
      format = StringFormatTemplate.getInstance().getFormat(this.template);
      if (format == null) {
        throw new IllegalStateException("Template not found");
      }
    } else if (ConditionUtils.isNotEmpty(this.format)) {
      format = new StringFormat(this.format, this.character);
    } else {
      throw new IllegalStateException("Pattern or template must be defined");
    }

    String value = this.value.toString();
    Writer writer = this.getJspContext().getOut();
    String formated = "";

    try {
      formated = format.format(value);
      formated = StringUtils.escapeHTML(formated);
    } catch (ArrayIndexOutOfBoundsException e) {
      WebLog.getInstance().getLog().warning("Error formating '" + value + "'  with mask '" + this.format + "'");
      formated = FormatTag.ERROR_VALUE;
    }
View Full Code Here

TOP

Related Classes of br.net.woodstock.rockframework.text.StringFormat

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.