FileDocCategorySizeDatePackage
LogTableColumn.javaAPI DocApache log4j 1.2.155455Sat Aug 25 00:09:38 BST 2007org.apache.log4j.lf5.viewer

LogTableColumn

public class LogTableColumn extends Object implements Serializable
LogTableColumn
author
Michael J. Sikorsky
author
Brad Marlborough

Fields Summary
private static final long
serialVersionUID
public static final LogTableColumn
DATE
public static final LogTableColumn
THREAD
public static final LogTableColumn
MESSAGE_NUM
public static final LogTableColumn
LEVEL
public static final LogTableColumn
NDC
public static final LogTableColumn
CATEGORY
public static final LogTableColumn
MESSAGE
public static final LogTableColumn
LOCATION
public static final LogTableColumn
THROWN
protected String
_label
private static LogTableColumn[]
_log4JColumns
private static Map
_logTableColumnMap
Constructors Summary
public LogTableColumn(String label)


  //--------------------------------------------------------------------------
  //   Constructors:
  //--------------------------------------------------------------------------
   
    _log4JColumns = new LogTableColumn[]{DATE, THREAD, MESSAGE_NUM, LEVEL, NDC, CATEGORY,
                                         MESSAGE, LOCATION, THROWN};

    _logTableColumnMap = new HashMap();

    for (int i = 0; i < _log4JColumns.length; i++) {
      _logTableColumnMap.put(_log4JColumns[i].getLabel(), _log4JColumns[i]);
    }
  
    _label = label;
  
Methods Summary
public booleanequals(java.lang.Object o)

    boolean equals = false;

    if (o instanceof LogTableColumn) {
      if (this.getLabel() ==
          ((LogTableColumn) o).getLabel()) {
        equals = true;
      }
    }

    return equals;
  
public java.lang.StringgetLabel()
Return the Label of the LogLevel.

    return _label;
  
public static org.apache.log4j.lf5.viewer.LogTableColumn[]getLogTableColumnArray()

    return _log4JColumns;
  
public static java.util.ListgetLogTableColumns()

return
A List of LogTableColumn/code> objects that map to log4j Column objects.

    return Arrays.asList(_log4JColumns);
  
public inthashCode()

    return _label.hashCode();
  
public java.lang.StringtoString()

    return _label;
  
public static org.apache.log4j.lf5.viewer.LogTableColumnvalueOf(java.lang.String column)
Convert a column label into a LogTableColumn object.

param
column The label of a level to be converted into a LogTableColumn.
return
LogTableColumn The LogTableColumn with a label equal to column.
throws
LogTableColumnFormatException Is thrown when the column can not be converted into a LogTableColumn.

    LogTableColumn tableColumn = null;
    if (column != null) {
      column = column.trim();
      tableColumn = (LogTableColumn) _logTableColumnMap.get(column);
    }

    if (tableColumn == null) {
      StringBuffer buf = new StringBuffer();
      buf.append("Error while trying to parse (" + column + ") into");
      buf.append(" a LogTableColumn.");
      throw new LogTableColumnFormatException(buf.toString());
    }
    return tableColumn;