public final class FormatHelper extends Object
Constructor and Description |
---|
FormatHelper() |
Modifier and Type | Method and Description |
---|---|
static String |
formatSqlBoolean(ColumnType columnType,
boolean b) |
static String |
formatSqlTime(ColumnType columnType,
Date date)
Formats a date according to a specific column type (DATE, TIME or
TIMESTAMP)
|
static String |
formatSqlTime(ColumnType columnType,
Date date,
boolean typeCastDeclaration)
Formats a date according to a specific column type (DATE, TIME or
TIMESTAMP).
|
static String |
formatSqlTime(ColumnType columnType,
Date date,
boolean typeCastDeclaration,
String beforeDateLiteral,
String afterDateLiteral)
Formats a date according to a specific column type (DATE, TIME or
TIMESTAMP)
|
static String |
formatSqlValue(ColumnType columnType,
Object value) |
static NumberFormat |
getSqlNumberFormat() |
static NumberFormat |
getUiNumberFormat()
Creates a uniform number format which is similar to that of eg.
|
static Date |
parseSqlTime(ColumnType columnType,
String value)
Parses a SQL string representation of a time based value
|
public static NumberFormat getUiNumberFormat()
public static NumberFormat getSqlNumberFormat()
public static String formatSqlBoolean(ColumnType columnType, boolean b)
public static String formatSqlTime(ColumnType columnType, Date date)
columnType
- the column typedate
- the date valuepublic static String formatSqlTime(ColumnType columnType, Date date, boolean typeCastDeclaration, String beforeDateLiteral, String afterDateLiteral)
columnType
- the column typedate
- the date valuetypeCastDeclaration
- whether or not to include a type cast declarationbeforeDateLiteral
- before date literalafterDateLiteral
- after date literalpublic static String formatSqlTime(ColumnType columnType, Date date, boolean typeCastDeclaration)
columnType
- date
- typeCastDeclaration
- public static Date parseSqlTime(ColumnType columnType, String value)
columnType
- value
- public static String formatSqlValue(ColumnType columnType, Object value)
Copyright © 2007–2021 The Apache Software Foundation. All rights reserved.