org.fuin.objects4j
Class TableColumnInfo

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

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

Table column information for a field of a class.


Constructor Summary
TableColumnInfo(Field field, String text, String shortText, int pos, FontSize width, String getter)
          Constructor with all data.
 
Method Summary
 int compareTo(TableColumnInfo theOther)
           
static List<TableColumnInfo> create(Class<?> clasz, Locale locale)
          Return a list of table column informations for the given class.
static TableColumnInfo create(Field field, Locale locale)
          Return the table column information for a given field.
 boolean equals(Object obj)
           
 Field getField()
          Returns the field.
 String getGetter()
          The name of the getter for the table column field.
 int getPos()
          The position of the column.
 String getShortText()
          Returns the abbreviation of the text.
 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(Field field,
                                     String text,
                                     String shortText,
                                     int pos,
                                     FontSize width,
                                     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 Field getField()
Returns the field.

Returns:
Field.

getText

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

Returns:
Long text.

getShortText

public final 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 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 Comparable<TableColumnInfo>

hashCode

public final int hashCode()
Overrides:
hashCode in class Object

equals

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

create

@Requires(value="(clasz != null) && (locale!=null)")
public static List<TableColumnInfo> create(Class<?> clasz,
                                                         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(Field field,
                                                   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 © 2011 Future Invent Informationsmanagement GmbH. All Rights Reserved.