Package org.apache.empire.commons
Class ColumnUtils
java.lang.Object
org.apache.empire.commons.ColumnUtils
ColumnUtils
This class contains a set of generic functions for Columns
- Author:
- doebele
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetColumnAttribute(ColumnExpr columnExpr, String name) Returns the column attributeintgetColumnMaxLength(ColumnExpr columnExpr) getColumnNumberFormat(ColumnExpr columnExpr, Locale locale) doublegetColumnSize(ColumnExpr columnExpr) Return the size of the column of 0.0d if unknownstatic ColumnUtilsstatic intgetMaxLength(ColumnExpr columnExpr) Return the maximum character length of a columnExprstatic NumbergetMaxValue(ColumnExpr columnExpr) Returns the maximum allowed valuestatic intgetMinLength(ColumnExpr columnExpr) Returns the minimum length, usually 0static NumbergetMinValue(ColumnExpr columnExpr) Returns the maximum allowed value or 0 if not setstatic NumberFormatgetNumberFormat(ColumnExpr columnExpr, Locale locale) Returns the number format for a particular columnExprvoidsetColumnNumberFormat(ColumnExpr columnExpr, String numberType, boolean groupSeparator) static voidsetInstance(ColumnUtils columnUtils) static <T extends ColumnExpr>
TsetMinMaxValue(T columnExpr, Number minValue, Number maxValue) Set the minimum and maximum values of a columnExprstatic <T extends ColumnExpr>
TsetNumberFormat(T columnExpr, String numberType, boolean groupSeparator) Sets the number format options for a columnExpr
-
Constructor Details
-
ColumnUtils
public ColumnUtils()
-
-
Method Details
-
getInstance
-
setInstance
-
getMinLength
Returns the minimum length, usually 0- Parameters:
columnExpr- the columnExpr- Returns:
- the minimum length
-
getMaxLength
Return the maximum character length of a columnExpr- Parameters:
columnExpr- the columnExpr- Returns:
- the max number or characters
-
getMinValue
Returns the maximum allowed value or 0 if not set- Parameters:
columnExpr- the columnExpr- Returns:
- the minimum value
-
getMaxValue
Returns the maximum allowed value- Parameters:
columnExpr- the columnExpr- Returns:
- the maximum value
-
setMinMaxValue
public static <T extends ColumnExpr> T setMinMaxValue(T columnExpr, Number minValue, Number maxValue) Set the minimum and maximum values of a columnExpr- Parameters:
columnExpr- the columnExprminValue- the min valuemaxValue- the max value- Returns:
- the columnExpr
-
getNumberFormat
Returns the number format for a particular columnExpr- Parameters:
columnExpr- the columnExprlocale- the locale for which to get the format- Returns:
- the NumberFormat
-
setNumberFormat
public static <T extends ColumnExpr> T setNumberFormat(T columnExpr, String numberType, boolean groupSeparator) Sets the number format options for a columnExpr- Parameters:
columnExpr- the column expressionnumberType- the number typegroupSeparator- should be used- Returns:
- the columnExpr
-
getColumnAttribute
Returns the column attribute- Parameters:
columnExpr- the column expressionname- the attribute name- Returns:
- the attribute value
-
getColumnSize
Return the size of the column of 0.0d if unknown- Parameters:
columnExpr- the column expression- Returns:
- the size in the form [integer digits].[fraction digits]
-
getColumnMaxLength
-
getColumnNumberFormat
-
setColumnNumberFormat
-