Class ColumnUtils

java.lang.Object
org.apache.empire.commons.ColumnUtils

public class ColumnUtils extends Object
ColumnUtils This class contains a set of generic functions for Columns
Author:
doebele
  • Constructor Details

    • ColumnUtils

      public ColumnUtils()
  • Method Details

    • getInstance

      public static ColumnUtils getInstance()
    • setInstance

      public static void setInstance(ColumnUtils columnUtils)
    • getMinLength

      public static int getMinLength(ColumnExpr columnExpr)
      Returns the minimum length, usually 0
      Parameters:
      columnExpr - the columnExpr
      Returns:
      the minimum length
    • getMaxLength

      public static int getMaxLength(ColumnExpr columnExpr)
      Return the maximum character length of a columnExpr
      Parameters:
      columnExpr - the columnExpr
      Returns:
      the max number or characters
    • getMinValue

      public static Number getMinValue(ColumnExpr columnExpr)
      Returns the maximum allowed value or 0 if not set
      Parameters:
      columnExpr - the columnExpr
      Returns:
      the minimum value
    • getMaxValue

      public static Number getMaxValue(ColumnExpr columnExpr)
      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 columnExpr
      minValue - the min value
      maxValue - the max value
      Returns:
      the columnExpr
    • getNumberFormat

      public static NumberFormat getNumberFormat(ColumnExpr columnExpr, Locale locale)
      Returns the number format for a particular columnExpr
      Parameters:
      columnExpr - the columnExpr
      locale - 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 expression
      numberType - the number type
      groupSeparator - should be used
      Returns:
      the columnExpr
    • getColumnAttribute

      public Object getColumnAttribute(ColumnExpr columnExpr, String name)
      Returns the column attribute
      Parameters:
      columnExpr - the column expression
      name - the attribute name
      Returns:
      the attribute value
    • getColumnSize

      public double getColumnSize(ColumnExpr columnExpr)
      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

      public int getColumnMaxLength(ColumnExpr columnExpr)
    • getColumnNumberFormat

      public NumberFormat getColumnNumberFormat(ColumnExpr columnExpr, Locale locale)
    • setColumnNumberFormat

      public void setColumnNumberFormat(ColumnExpr columnExpr, String numberType, boolean groupSeparator)