Package org.apache.commons.lang.time

Examples of org.apache.commons.lang.time.FastDateFormat$Rule


    return formatter.format(date);
  }

  public static FastDateFormat getFormatter(String pattern, Locale locale){
    FastDateFormat formatter = null;
   
    if (StringUtils.isBlank(pattern)) {
      // If the pattern being requested is empty, then use a default formatter
      formatter = FastDateFormat.getDateTimeInstance(FastDateFormat.LONG, FastDateFormat.SHORT, locale);
    } else {
View Full Code Here


    return messageTypeCombo;
  }

  private void syncFromMessage() throws JMSException {
    Calendar cal = Calendar.getInstance();
    FastDateFormat fmt = FastDateFormat.getInstance("yyyy-MM-dd HH:mm:ss.SSSZ");

    if (message.getJMSReplyTo() != null) {
      replyToDomain = Domain.getDomain(message.getJMSReplyTo());
    } else {
      replyToDomain = Domain.QUEUE;
    }
    tglbtnQueue.setText(replyToDomain.toString());

    messageIdField.setText(message.getJMSMessageID());
    replyToField.setText(JMSUtils.getDestinationName(message.getJMSReplyTo()));
    destinationField.setText(JMSUtils.getDestinationName(message.getJMSDestination()));
    correlationIDField.setText(message.getJMSCorrelationID());
    typeField.setText(message.getJMSType());
    timestampField.setText(fmt.format(new Date(message.getJMSTimestamp())));
    expirationSpinner.setValue(message.getJMSExpiration());
    priroritySpinner.setValue(message.getJMSPriority());
    if (message instanceof TextMessage) {
      messageTypeCombo.setSelectedItem(MessageType.TextMessage);
    } else if (message instanceof BytesMessage) {
View Full Code Here

        assertEquals("Round trip", in, out);
    }

    private String formatAsImap(Date date, TimeZone zone) {
        assertNotNull(date);
        FastDateFormat format = FastDateFormat.getInstance(
                "dd-MMM-yyyy hh:mm:ss Z", zone, Locale.US);
        String out = format.format(date);
        if (out.charAt(0) == '0') {
            out = ' ' + out.substring(1, out.length());
        }
        return out;
    }
View Full Code Here

     * @param date
     *            <code>Date</code>, not null
     * @return encoded IMAP <code>date-time</code>, not null
     */
    public static String encodeDateTime(final Date date) {
        final FastDateFormat format = FastDateFormat.getInstance("dd-MMM-yyyy HH:mm:ss Z", TimeZone.getTimeZone("GMT"), Locale.US);
        final String result = format.format(date);
        return result;
    }
View Full Code Here

        assertEquals("Round trip", in, out);
    }

    private String formatAsImap(Date date, TimeZone zone) {
        assertNotNull(date);
        FastDateFormat format = FastDateFormat.getInstance(
                "dd-MMM-yyyy hh:mm:ss Z", zone, Locale.US);
        String out = format.format(date);
        if (out.charAt(0) == '0') {
            out = ' ' + out.substring(1, out.length());
        }
        return out;
    }
View Full Code Here

   */
  public String graph() throws Exception {
    StringBuffer text = new StringBuffer();
   
    text.append("digraph M5Tree {\n");
    Rule temp = (Rule)m_ruleSet.elementAt(0);
    temp.topOfTree().graph(text);
    text.append("}\n");
    return text.toString();
  }
View Full Code Here

TOP

Related Classes of org.apache.commons.lang.time.FastDateFormat$Rule

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.