1 18 package org.apache.beehive.netui.databinding.datagrid.api.filter; 19 20 import org.apache.beehive.netui.util.Bundle; 21 22 31 public class FilterTypeHint 32 implements java.io.Serializable { 33 34 37 private static final String STR_DATE = "DATE"; 38 39 42 private static final String STR_STRING = "STRING"; 43 44 47 private static final String STR_NUMERIC = "NUMERIC"; 48 49 52 public static final FilterTypeHint DATE = new FilterTypeHint(STR_DATE); 53 54 57 public static final FilterTypeHint STRING = new FilterTypeHint(STR_STRING); 58 59 62 public static final FilterTypeHint NUMERIC = new FilterTypeHint(STR_NUMERIC); 63 64 private String _hint = null; 65 66 71 private FilterTypeHint(String hint) { 72 _hint = hint; 73 } 74 75 79 public String getHint() { 80 return _hint; 81 } 82 83 87 public static FilterTypeHint getDefault() { 88 return STRING; 89 } 90 91 97 public static FilterTypeHint getTypeHint(String hint) { 98 99 if(STRING.getHint().equals(hint)) 100 return STRING; 101 else if(NUMERIC.getHint().equals(hint)) 102 return NUMERIC; 103 else if(DATE.getHint().equals(hint)) 104 return DATE; 105 else throw new IllegalArgumentException (Bundle.getErrorString("FilterTypeHint_UnknownHintString", 106 new Object [] {hint})); 107 } 108 } 109 | Popular Tags |