Examples of StringFormatter


Examples of br.net.woodstock.rockframework.core.string.StringFormatter

  private StringFormatter    format;

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

Examples of br.net.woodstock.rockframework.core.string.StringFormatter

    this.format = new StringFormatter(pattern);
  }

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

Examples of br.net.woodstock.rockframework.core.string.StringFormatter

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

    StringFormatter format = new StringFormatter(this.format, this.character);
    String value = this.value.toString();
    Writer writer = this.getJspContext().getOut();
    String formated = "";

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

Examples of com.github.sommeri.less4j.core.compiler.expressions.strings.StringFormatter

    String newValue = format(format.getValue(), parameters, problemsHandler, technicalUnderlying);
    return new CssString(format.getUnderlyingStructure(), newValue, "\"");
  }

  private String format(String value, List<Expression> parameters, ProblemsHandler problemsHandler, HiddenTokenAwareTree technicalUnderlying) {
    StringFormatter formatter = new StringFormatter(problemsHandler);
    return formatter.replaceIn(value, parameters.iterator(), technicalUnderlying);
  }
View Full Code Here

Examples of org.archive.wayback.util.StringFormatter

   * Set the Locale for the request, which impacts UI Strings
   * @param l
   */
  public void setLocale(Locale l) {
    ResourceBundle b = ResourceBundle.getBundle(UI_RESOURCE_BUNDLE_NAME,l);
    formatter = new StringFormatter(b,l);
  }
View Full Code Here

Examples of org.archive.wayback.util.StringFormatter

 
  private String getUserLocale(HttpServletRequest httpRequest) {
    Locale l = httpRequest.getLocale();
    ResourceBundle b = ResourceBundle.getBundle(UI_RESOURCE_BUNDLE_NAME,
        httpRequest.getLocale());
    formatter = new StringFormatter(b,l);
    return emptyIfNull(httpRequest.getLocale().getDisplayLanguage());
  }
View Full Code Here

Examples of org.archive.wayback.util.StringFormatter

   * Set the Locale for the request, which impacts UI Strings
   * @param l
   */
  public void setLocale(Locale l) {
    ResourceBundle b = ResourceBundle.getBundle(UI_RESOURCE_BUNDLE_NAME,l);
    formatter = new StringFormatter(b,l);
  }
View Full Code Here

Examples of org.archive.wayback.util.StringFormatter

 
  public BubbleCalendarData(UIResults results) {
    this.results = results;
    CaptureSearchResults cResults = results.getCaptureResults();
    WaybackRequest wbRequest = results.getWbRequest();
    StringFormatter fmt = wbRequest.getFormatter();
    String searchUrl =
      UrlOperations.stripDefaultPortFromUrl(wbRequest.getRequestUrl());

    searchUrlForHTML = fmt.escapeHtml(searchUrl);
    searchUrlForJS = fmt.escapeJavaScript(searchUrl);
    firstResultDate = cResults.getFirstResultDate();
    firstResultReplayUrl = fmt.escapeHtml(results.resultToReplayUrl(cResults.getResults().getFirst()));
    lastResultDate = cResults.getLastResultDate();
    lastResultReplayUrl = fmt.escapeHtml(results.resultToReplayUrl(cResults.getResults().getLast()));
    Date searchStartDate = wbRequest.getStartDate();
    Date searchEndDate = wbRequest.getEndDate();
    months = capturePartitioner.getRange(monthSize,searchStartDate,searchEndDate);
    years =  partitionPartitioner.getRange(yearSize,searchStartDate,searchEndDate);

   
    // To build the graph, we need to break all the results into 1 month
    // partitions, so partition all the results into the months:
    capturePartitioner.populate(months,cResults.iterator());
   
    // To fill in the calendar, we need to break the current year into day
    // sized partitions, so first partition those months into years:
    partitionPartitioner.populate(years,months.iterator());
    // find the active year:
    Partition<Partition<CaptureSearchResult>> activeYear = null;
    for(Partition<Partition<CaptureSearchResult>> year : years) {
      if(year.isContainsClosest()) {
        activeYear = year;
        break;
      }
    }
    // if there's no activeYear, something is quite wrong...
    // TODO: check anyways:
    if (activeYear == null) {
      activeYear = years.get(years.size() - 1);
    }
    String yearStr = fmt.format("{0,date,yyyy}",activeYear.getStart());
    yearNum = Integer.parseInt(yearStr);

    // now unroll the months in the active year into day-sized partitions:
    List<Partition<CaptureSearchResult>> days =
      capturePartitioner.getRange(daySize,
View Full Code Here

Examples of org.eclipse.birt.core.format.StringFormatter

                return "Scientific";
            }
            return new NumberFormatter(val).getPattern();

        } else if (val != null && data instanceof String) {
            return new StringFormatter(val).getPattern();
        }

        return null;
    }
View Full Code Here

Examples of org.opencustomer.framework.db.util.engine.configuration.StringFormatter

                           format = enumFormat;
                        } catch(ClassNotFoundException e) {
                            throw new TableEngineException("could get attribute 'class'", e);
                        }
                    } else if("string".equals(attributeNode.getNodeValue())) {
                        StringFormatter stringFormat = new StringFormatter();
                        NodeList nodes = node.getChildNodes();
                        for(int j=0; j<nodes.getLength(); j++) {
                            if(nodes.item(j).getNodeType() == Node.ELEMENT_NODE) {
                                if("value".equals(nodes.item(j).getNodeName())) {
                                    parseValue(stringFormat, nodes.item(j));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.