jodd.datetime.format
Class Iso8601JdtFormatter

java.lang.Object
  extended by jodd.datetime.format.AbstractFormatter
      extended by jodd.datetime.format.Iso8601JdtFormatter
All Implemented Interfaces:
JdtFormatter

public class Iso8601JdtFormatter
extends AbstractFormatter

Default JdtFormatter uses ISO 8601 specification, enhanced by some custom patterns. For more information see: ISO 8601 on Wikipedia

Patterns list:

Patterns noted with + sign are used both for conversion and parsing. All patterns are used for conversion.


Field Summary
 
Fields inherited from class jodd.datetime.format.AbstractFormatter
escapeChar, patterns
 
Constructor Summary
Iso8601JdtFormatter()
           
 
Method Summary
protected  java.lang.String convertPattern(int patternIndex, JDateTime jdt)
          Creates a date-time string for founded pattern.
protected  void parseValue(int patternIndex, java.lang.String value, DateTimeStamp destination)
          Parses value for matched pattern.
 
Methods inherited from class jodd.datetime.format.AbstractFormatter
convert, findPattern, parse, preparePatterns, print2, print3, printPad4
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Iso8601JdtFormatter

public Iso8601JdtFormatter()
Method Detail

convertPattern

protected java.lang.String convertPattern(int patternIndex,
                                          JDateTime jdt)
Description copied from class: AbstractFormatter
Creates a date-time string for founded pattern. Founded patterns is identified by its AbstractFormatter.patterns index.

Specified by:
convertPattern in class AbstractFormatter
Parameters:
patternIndex - index of founded pattern
jdt - date time information

parseValue

protected void parseValue(int patternIndex,
                          java.lang.String value,
                          DateTimeStamp destination)
Description copied from class: AbstractFormatter
Parses value for matched pattern. Founded patterns is identified by its AbstractFormatter.patterns index. Note that value may represent both integer and decimals. May throw NumberFormatException.

Specified by:
parseValue in class AbstractFormatter
Parameters:
patternIndex - index of founded pattern
value - value to parse, no spaces or tabs
destination - destination to modify


Copyright © 2003-2012 Jodd Team