org.springframework.roo.classpath.operations
Enum DateTime

java.lang.Object
  extended by java.lang.Enum<DateTime>
      extended by org.springframework.roo.classpath.operations.DateTime
All Implemented Interfaces:
Serializable, Comparable<DateTime>

public enum DateTime
extends Enum<DateTime>

Provides date format options for Date and Calendar types.

Since:
1.0
Author:
Stefan Schmidt

Enum Constant Summary
MEDIUM
           
NONE
           
SHORT
           
 
Method Summary
 char getShortKey()
           
static int parseDateFormat(char style)
          This method will return the DateTime style for the character of the style argument.
static DateTime parseDateTimeFormat(char style)
          This method will return the DateTime style for the character of the style argument.
 String toString()
           
static DateTime valueOf(String name)
          Returns the enum constant of this type with the specified name.
static DateTime[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

MEDIUM

public static final DateTime MEDIUM

NONE

public static final DateTime NONE

SHORT

public static final DateTime SHORT
Method Detail

values

public static DateTime[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (DateTime c : DateTime.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static DateTime valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

parseDateFormat

public static int parseDateFormat(char style)
This method will return the DateTime style for the character of the style argument. If no style is recognized it will return DateFormat.SHORT.

Parameters:
style - the date or time style, ie 'S'
Returns:
the DateTime style.

parseDateTimeFormat

public static DateTime parseDateTimeFormat(char style)
This method will return the DateTime style for the character of the style argument. For example style of '-' will return DateTime.NULL.

Parameters:
style - the date or time style, ie 'S'
Returns:
the DateTime style for the provided style argument

getShortKey

public char getShortKey()

toString

public String toString()
Overrides:
toString in class Enum<DateTime>


Copyright © 2009–2015. All rights reserved.