org.fuin.objects4j
Class TableColumnInfo

java.lang.Object
  extended by org.fuin.objects4j.TableColumnInfo
All Implemented Interfaces:
java.lang.Comparable<TableColumnInfo>

@Immutable
public final class TableColumnInfo
extends java.lang.Object
implements java.lang.Comparable<TableColumnInfo>

Table column information for a field of a class.


Constructor Summary
TableColumnInfo(java.lang.reflect.Field field, java.lang.String text, java.lang.String shortText, int pos, FontSize width, java.lang.String getter)
          Constructor with all data.
 
Method Summary
 int compareTo(TableColumnInfo theOther)
           
static java.util.List<TableColumnInfo> create(java.lang.Class<?> clasz, java.util.Locale locale)
          Return a list of table column informations for the given class.
static TableColumnInfo create(java.lang.reflect.Field field, java.util.Locale locale)
          Return the table column information for a given field.
 boolean equals(java.lang.Object obj)
           
 java.lang.reflect.Field getField()
          Returns the field.
 java.lang.String getGetter()
          The name of the getter for the table column field.
 int getPos()
          The position of the column.
 java.lang.String getShortText()
          Returns the abbreviation of the text.
 java.lang.String getText()
          Returns the text of the label.
 FontSize getWidth()
          Returns the column width.
 int hashCode()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TableColumnInfo

@Requires(value="(field != null) && (width != null) && (getter!=null)")
public TableColumnInfo(java.lang.reflect.Field field,
                                     java.lang.String text,
                                     java.lang.String shortText,
                                     int pos,
                                     FontSize width,
                                     java.lang.String getter)
Constructor with all data.

Parameters:
field - The field.
text - Text.
shortText - Abbreviation of the text.
pos - Position of the column (starting with zero).
width - Witdh of the column.
getter - Name of the getter for the field.
Method Detail

getField

@Ensures(value="\result != null")
public final java.lang.reflect.Field getField()
Returns the field.

Returns:
Field.

getText

public final java.lang.String getText()
Returns the text of the label.

Returns:
Long text.

getShortText

public final java.lang.String getShortText()
Returns the abbreviation of the text.

Returns:
Short text.

getWidth

public final FontSize getWidth()
Returns the column width.

Returns:
Width of the column.

getPos

public final int getPos()
The position of the column.

Returns:
Position of the column (starting with zero).

getGetter

@Ensures(value="\result != null")
public final java.lang.String getGetter()
The name of the getter for the table column field.

Returns:
Getter name.

compareTo

public final int compareTo(TableColumnInfo theOther)
Specified by:
compareTo in interface java.lang.Comparable<TableColumnInfo>

hashCode

public final int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public final boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

create

@Requires(value="(clasz != null) && (locale!=null)")
public static java.util.List<TableColumnInfo> create(java.lang.Class<?> clasz,
                                                                   java.util.Locale locale)
Return a list of table column informations for the given class.

Parameters:
clasz - Class to check for @TableColumn and @Label annotations.
locale - Locale to use.
Returns:
List of table columns sorted by the position.

create

@Requires(value="(field != null) && (locale!=null)")
public static TableColumnInfo create(java.lang.reflect.Field field,
                                                   java.util.Locale locale)
Return the table column information for a given field.

Parameters:
field - Field to check for @TableColumn and @Label annotations.
locale - Locale to use.
Returns:
Information or null.


Copyright © 2010 Future Invent Informationsmanagement GmbH. All Rights Reserved.