Package java.text

Examples of java.text.Format$Field


    Format[] fmt = format.getFormatsByArgumentIndex();

    for (int i = 0; i < fmt.length; i++)
    {
      Format format1 = fmt[i];
      System.out.println(format1);

    }

    format.setFormat(1, null);
View Full Code Here


    final String formatString = entry.getParameterAttribute(ParameterAttributeNames.Core.NAMESPACE,
        ParameterAttributeNames.Core.DATA_FORMAT, parameterContext);
    final Locale locale = parameterContext.getResourceBundleFactory().getLocale();
    final TimeZone timeZone = parameterContext.getResourceBundleFactory().getTimeZone();

    final Format format =
        TextComponentEditHandler.createFormat(formatString, locale, timeZone, entry.getValueType());

    handler =
        new TextComponentEditHandler(entry.getValueType(), entry.getName(), this, updateContext, format);
    setColumns(60);
View Full Code Here

    final String formatString = entry.getParameterAttribute(ParameterAttributeNames.Core.NAMESPACE,
        ParameterAttributeNames.Core.DATA_FORMAT, parameterContext);
    final Locale locale = parameterContext.getResourceBundleFactory().getLocale();
    final TimeZone timeZone = parameterContext.getResourceBundleFactory().getTimeZone();

    final Format format =
        TextComponentEditHandler.createFormat(formatString, locale, timeZone, entry.getValueType());

    textArea = new JTextArea();

    handler =
View Full Code Here

   * @param element
   * @return The formatted value.
   */
  public Object getValue(final ExpressionRuntime runtime, final Element element)
  {
    final Format f = getFormatter();
    if (f == null)
    {
      return getNullValue();
    }

    final DataSource ds = getDataSource();
    if (ds == null)
    {
      return getNullValue();
    }

    final Object o = ds.getValue(runtime, element);
    if (o == null)
    {
      return getNullValue();
    }

    if (cachedResult != null && (cachedFormat != f) &&
        ObjectUtilities.equal(cachedValue, o))
    {
      return cachedResult;
    }

    try
    {
      cachedResult = f.format(o);
    }
    catch (IllegalArgumentException e)
    {
      cachedResult = getNullValue();
    }
View Full Code Here

   * @param element
   * @return The formatted value.
   */
  public Object getValue(final ExpressionRuntime runtime, final Element element)
  {
    final Format f = getFormatter();
    if (f == null)
    {
      return getNullValue();
    }

    final DataSource ds = getDataSource();
    if (ds == null)
    {
      return getNullValue();
    }

    final Object o = ds.getValue(runtime, element);
    if (o == null)
    {
      return getNullValue();
    }

    if (isValidOutput(o))
    {
      return o;
    }

    try
    {
      return f.parseObject(String.valueOf(o));
    }
    catch (ParseException e)
    {
      return null;
    }
View Full Code Here

      }
      else
      {
        if (getLog().isDebugEnabled())
        {
          Format formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
          getLog().debug("- MagicDraw model file ["+sourceFile.getName()+"] date = " + formatter.format(new Date(sourceFile.lastModified())));
          getLog().debug("- EMF model file ["+destFile.getName()+"] date = " + formatter.format(new Date(destFile.lastModified())));
        }
        if (destFile.lastModified() >= sourceFile.lastModified())
        {
          getLog().info("Model file [" + dest + "] is up-to-date");
          return;
View Full Code Here

        textFieldValue = "";
      }
    }
    else
    {
      Format format = getFormat();
      if (format != null)
      {
        textFieldValue = format.format(textFieldValue);
      }
    }

    String oldRawText = getRawText();
    String newRawText = processMarkupText(String.valueOf(textFieldValue));
View Full Code Here

  /**
   *
   */
  protected Format getFormat()//FIXMEFORMAT optimize this with an interface
  {
    Format format = null;

    JRExpression valueExpression = getExpression();
    if (valueExpression != null)
    {
      Class valueClass = valueExpression.getValueClass();
View Full Code Here

   */
  protected String getTemplatePattern()//FIXMEFORMAT optimize this with an interface
  {
    String pattern = null;
    String originalPattern = getPattern();
    Format format = getFormat();
    JRExpression valueExpression = getExpression();
    if (format != null && valueExpression != null)
    {
      Class valueClass = valueExpression.getValueClass();
      if (java.util.Date.class.isAssignableFrom(valueClass))
View Full Code Here

  protected Format getDateFormat(String pattern)
  {
    Locale lc = getLocale();
    TimeZone tz = getTimeZone();
    String key = pattern + "|" + JRDataUtils.getLocaleCode(lc) + "|" + JRDataUtils.getTimeZoneId(tz);
    Format format = (Format)dateFormatCache.get(key);
    if (format == null)
    {
      format = getFormatFactory().createDateFormat(pattern, lc, tz);
      if (format != null)
      {
View Full Code Here

TOP

Related Classes of java.text.Format$Field

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.