Examples of format()

Examples of java.time.ZonedDateTime.format()

    public void unmarshalProducesCorrectLocalDateTimeObject() throws Exception {
        final ZonedDateTime unmarshaled = adapter.unmarshal(DATE_AS_STRING);

        assertEquals(unmarshaled.format(getDateTimeFormatter()), DATE_AS_STRING);

    public void marshalProducesCorrectDateTimeString() throws Exception {
        final String marshal = adapter.marshal(ZonedDateTime.parse(DATE_AS_STRING, getDateTimeFormatter()));
View Full Code Here

Examples of java.time.format.DateTimeFormatter.format()


        //使用DateTimeFormatter API 解析 和 格式化
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy/MM/dd HH:mm:ss");
        LocalDateTime d6 = LocalDateTime.parse("2013/12/31 23:59:59", formatter);

View Full Code Here

Examples of java.util.Formatter.format()

    } catch (final Exception e) {

      final Formatter out = new Formatter();

      logger.error(out.format("Unable to load factory class [%s]", path)

//      throw new IllegalStateException(e);
View Full Code Here

Examples of java.util.logging.Formatter.format()

            for (int i = 0; i < lineCount; i++) {
                final int ix = (reversed) ?
                    Math.abs((theStart-i)%this.buffer.length) :
                record = this.buffer[ix];
            return logMessages.toString();
        } catch (final Exception ex) {
            // We don't want to throw an exception here, but we
            // report the exception to any registered ErrorManager.
View Full Code Here

Examples of java.util.logging.SimpleFormatter.format()

        testing = Errors.getResources(Locale.ENGLISH);
        final LogRecord record = testing.getLogRecord(Level.FINE, Errors.Keys.NullArgument_1, "CRS");
        assertEquals("NullArgument_1", record.getMessage());

        final SimpleFormatter formatter = new SimpleFormatter();
        final String message = formatter.format(record);
        assertTrue(message.contains("Argument ‘CRS’ shall not be null."));
        testing = null;

View Full Code Here

Examples of java.util.logging.XMLFormatter.format()

            + "  <thread>21</thread>\n"
            + "  <message>foobar</message>\n"
            + "</record>\n");
View Full Code Here

Examples of javax.mail.internet.MailDateFormat.format()

    * @param date
    * @return The http://www.faqs.org/rfcs/rfc822.html "date-time" string
   public static String dateTime(Date date) {
      DateFormat df = new MailDateFormat();
      return df.format(date);    
    * @param ts
    * @return The http://www.faqs.org/rfcs/rfc822.html "date-time" string
View Full Code Here

Examples of javax.measure.unit.UnitFormat.format()

                List<String> unitNames = new ArrayList<String>();
                // adding radiance as it's the most common, but it's not part of the standard units
                UnitFormat format = UnitFormat.getInstance(Locale.ENGLISH);
                for (Unit<?> unit : units) {

                List<String> choices = new ArrayList<String>();
                for (String name : unitNames) {
                    if (name.toLowerCase().startsWith(input.toLowerCase())) {
View Full Code Here

Examples of javolution.text.TextFormat.format()

                throws XMLStreamException {
            if (value == null)
            Class type = value.getClass();
            TextFormat format = TextFormat.getInstance(type);
            setAttribute(name, (TextBuilder) format.format(value,

        // Sets XML binding.
        void setBinding(XMLBinding xmlBinding) {
View Full Code Here

Examples of jnode.core.ConcurrentDateFormatAccess.format()

                    return "Bad date(2)";

                Date date = new Date(time);

                return dateFormat.format(date);

View Full Code Here
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.