1 23 package org.mdarad.framework.util.struts.criteria; 24 25 import java.util.Locale ; 26 27 import org.mdarad.framework.expr.Operator; 28 import org.mdarad.framework.expr.OperatorTypes; 29 30 36 public class BooleanCriterion extends FormCriterionWithOperator { 37 38 49 public BooleanCriterion(String name, Class associatedEntity, CriterionProperty property, String bundleName, Locale locale) { 50 super(name, associatedEntity, property, bundleName, locale); 51 } 52 53 65 public BooleanCriterion(String name, Class associatedEntity, CriterionProperty property, String bundleName, Locale locale, boolean isDynamic) { 66 super(name, associatedEntity, property, bundleName, locale, isDynamic); 67 } 68 69 77 public BooleanCriterion(BooleanCriterion criterion) { 78 super(criterion); 79 } 80 81 87 public void setPropertyValue(String value) { 88 if (value != null) { 89 try { 90 setValue(new Boolean (value)); 91 } catch (NumberFormatException nfe) { 92 } 94 } 95 } 96 97 102 public String getPropertyValue() { 103 if (getValue() != null) { 104 return getValue().toString(); 105 } 106 107 return ""; 108 } 109 110 116 public Class getObjectType() { 117 return Boolean .class; 118 } 119 120 125 public Operator[] getOperators() { 126 127 return new Operator[] { 128 new Operator("operator.boolean.equal.label", OperatorTypes.EQUAL, getBundle(), getLocale()), 129 }; 130 } 131 132 137 public CriterionFormPattern getFormPattern() { 138 return CriterionFormPatterns.OPERATOR_INPUT; 139 } 140 } 141 | Popular Tags |