|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD | ||||||||
java.lang.Objectjava.lang.Enum<ODValueType>
org.jopendocument.dom.ODValueType
@Immutable public enum ODValueType
A type of value, as per 16.1 "Data Types" and 6.7.1 "Variable Value Types and Values"
| Enum Constant Summary | |
|---|---|
BOOLEAN
|
|
CURRENCY
|
|
DATE
|
|
FLOAT
Parses to BigDecimal to return the exact number. |
|
PERCENTAGE
|
|
STRING
|
|
TIME
|
|
| Method Summary | |
|---|---|
boolean |
canFormat(Class<?> toFormat)
|
abstract String |
format(Object o)
|
static ODValueType |
forObject(Object o)
Try to guess the value type for the passed object. |
static ODValueType |
get(String name)
The instance for the passed value type. |
static Calendar |
getCalendar()
Get the framework default calendar. |
static Locale |
getLocale(boolean notNull)
The framework default locale. |
String |
getName()
The value for the value-type attribute. |
static TimeZone |
getTimeZone(boolean notNull)
The framework default time zone. |
String |
getValueAttribute()
The name of the value attribute for this value type. |
static boolean |
isTimeZoneIgnored()
Whether to ignore explicit time zone in dates. |
abstract Object |
parse(String s)
|
static Calendar |
parseDateValue(String date)
Parse an OpenDocument date value with the framework defaults. |
static Calendar |
parseDateValue(String date,
TimeZone tz,
Locale locale,
Boolean ignoreTZ)
Parse an OpenDocument date value with the passed parameters. |
static void |
setLocale(Locale locale)
Set the framework default locale. |
static void |
setTimeZone(TimeZone tz)
Set the framework default time zone. |
static void |
setTimeZoneIgnored(boolean b)
|
static ODValueType |
valueOf(String name)
Returns the enum constant of this type with the specified name. |
static ODValueType[] |
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, toString, valueOf |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Enum Constant Detail |
|---|
public static final ODValueType FLOAT
BigDecimal to return the exact number.
public static final ODValueType PERCENTAGE
public static final ODValueType CURRENCY
public static final ODValueType DATE
public static final ODValueType TIME
public static final ODValueType BOOLEAN
public static final ODValueType STRING
| Method Detail |
|---|
public static ODValueType[] values()
for (ODValueType c : ODValueType.values()) System.out.println(c);
public static ODValueType valueOf(String name)
name - the name of the enum constant to be returned.
IllegalArgumentException - if this enum type has no constant
with the specified name
NullPointerException - if the argument is nullpublic final String getValueAttribute()
public boolean canFormat(Class<?> toFormat)
public abstract String format(Object o)
public abstract Object parse(String s)
public final String getName()
public static ODValueType get(String name)
name - the value of the value-type attribute, e.g. "date".
null, e.g. DATE.
IllegalArgumentException - if name isn't a valid type.
public static ODValueType forObject(Object o)
throws NullPointerException
o - the object.
o or null.
NullPointerException - if o is null.public static final void setTimeZone(TimeZone tz)
null to always use the VM default
(passing TimeZone.getDefault() would set the value once and for all and wouldn't be
changed by TimeZone.setDefault(TimeZone)).
tz - the new default time zone, null to use the VM default.public static final TimeZone getTimeZone(boolean notNull)
notNull - true if null should be replaced by
TimeZone.getDefault().
null if notNull is
false.public static final void setLocale(Locale locale)
null to always use the VM default
(passing Locale.getDefault() would set the value once and for all and wouldn't be
changed by Locale.setDefault(Locale)).
locale - the new default locale, null to use the VM default.public static final Locale getLocale(boolean notNull)
notNull - true if null should be replaced by
Locale.getDefault().
null if notNull is
false.public static final Calendar getCalendar()
getTimeZone(boolean),
getLocale(boolean)public static final void setTimeZoneIgnored(boolean b)
public static final boolean isTimeZoneIgnored()
true if the time zone part should be ignored.
public static Calendar parseDateValue(String date)
throws ParseException
date - the string formatted value.
ParseException - if the value couldn't be parsed.parseDateValue(String, TimeZone, Locale, Boolean)
public static Calendar parseDateValue(String date,
TimeZone tz,
Locale locale,
Boolean ignoreTZ)
throws ParseException
date - the string formatted value.tz - the time zone of the returned calendar, null meaning
getTimeZone(boolean).locale - the locale of the returned calendar, null meaning
getLocale(boolean).ignoreTZ - whether to ignore the time zone part of part, null
meaning isTimeZoneIgnored().
ParseException - if the value couldn't be parsed.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD | ||||||||