Examples of format()


Examples of org.apache.logging.log4j.core.Layout.format()

        Layout layout = getLayout();
        if (layout == null) {
            events.add(event);
        } else if (layout instanceof SerializedLayout) {
            byte[] header = layout.getHeader();
            byte[] content = layout.format(event);
            byte[] record = new byte[header.length + content.length];
            System.arraycopy(header, 0, record, 0, header.length);
            System.arraycopy(content, 0, record, header.length, content.length);
            data.add(record);
        } else {
View Full Code Here

Examples of org.apache.maven.plugin.assembly.format.FileFormatter.format()

            {
                source = new File( basedir, sourcePath );
            }

            source =
                fileFormatter.format( source, fileItem.isFiltered(), fileItem.getLineEnding(),
                                      configSource.getEncoding() );

            String destName = fileItem.getDestName();

            if ( destName == null )
View Full Code Here

Examples of org.apache.myfaces.dateformat.SimpleDateFormatter.format()

                Calendar timeKeeper = Calendar.getInstance(locale);
                int firstDayOfWeek = timeKeeper.getFirstDayOfWeek() - 1;
                org.apache.myfaces.dateformat.DateFormatSymbols symbols = new org.apache.myfaces.dateformat.DateFormatSymbols(locale);

                SimpleDateFormatter dateFormat = new SimpleDateFormatter(formatStr, symbols, firstDayOfWeek);
                return dateFormat.format(date);
            }
            else
            {
                DateFormat dateFormat = createStandardDateFormat(facesContext);
                dateFormat.setLenient(false);
View Full Code Here

Examples of org.apache.myfaces.extensions.cdi.message.api.Formatter.format()

            formatter = this.messageContext.config().getFormatterFactory().findFormatter(argument.getClass());

            if (formatter != null && !isDefaultFormatter(formatter.getClass()))
            {
                //noinspection unchecked
                result.append(formatter.format(this.messageContext, argument));
            }
            else if(argument instanceof Localizable)
            {
                result.append(((Localizable)argument).toString(this.messageContext));
            }
View Full Code Here

Examples of org.apache.myfaces.trinidad.util.FastMessageFormat.format()

      FastMessageFormat titleFormat = _getTitleFormat(arc);

      String monthName = monthNames[monthIndex];
      String yearName = String.valueOf(year);

      String title = titleFormat.format(new String[]{monthName, yearName});

      writer.writeText(title, null);
    }
  }
View Full Code Here

Examples of org.apache.myfaces.trinidadinternal.share.util.FastMessageFormat.format()

  }

  public static String getFormattedString(String pattern, String[] parameters)
  {
    FastMessageFormat formatter = new FastMessageFormat(pattern);
    return formatter.format(parameters);
  }

  /** HashMap mapping names to their scriptlets */
  private static Map<Object, Scriptlet> _sScriptletTable =
    Collections.synchronizedMap(new HashMap<Object, Scriptlet>(37));
View Full Code Here

Examples of org.apache.poi.ss.usermodel.FractionFormat.format()

*/
public final class TestFractionFormat extends TestCase {
      public void testSingle() throws Exception {
        FractionFormat f = new FractionFormat("", "##");
        double val = 321.321;
        String ret = f.format(val);
        assertEquals("26027/81", ret);
    }
    
    public void testTruthFile() throws Exception {
        File truthFile = HSSFTestDataSamples.getSampleFile("54686_fraction_formats.txt");
View Full Code Here

Examples of org.apache.shiro.crypto.hash.format.HashFormat.format()

            if (format == null) {
                throw new IllegalArgumentException("Unrecognized hash format '" + formatString + "'.");
            }

            String output = format.format(hash);

            System.out.println(output);

        } catch (IllegalArgumentException iae) {
            exit(iae, debug);
View Full Code Here

Examples of org.apache.sis.io.wkt.WKTFormat.format()

            final WKTFormat f = new WKTFormat(locale, timezone);
            f.setConvention(wkt);
            if (colors) {
                f.setColors(Colors.DEFAULT);
            }
            f.format(crs, out);
            out.println();
        } else {
            final TreeTable tree = MetadataStandard.ISO_19115.asTreeTable(metadata, ValueExistencePolicy.NON_EMPTY);
            final TreeTableFormat tf = new TreeTableFormat(locale, timezone);
            tf.setColumns(TableColumn.NAME, TableColumn.VALUE);
View Full Code Here

Examples of org.apache.sis.math.StatisticsFormat.format()

        out.println("Statistics on the keys before and after garbage collection.");
        out.println("The minimum value should be greater after GC.");
        final StatisticsFormat format = StatisticsFormat.getInstance();
        format.setBorderWidth(1);
        try {
            format.format(new Statistics[] {beforeGC, afterGC}, out);
        } catch (IOException e) {
            throw new AssertionError(e);
        }
        assertTrue("Minimum key value should be greater after garbage collection.",
                afterGC.minimum() >= beforeGC.minimum());
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.