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 31 37 public class StringCriterion extends FormCriterionWithOperator { 38 39 50 public StringCriterion(String name, Class associatedEntity, CriterionProperty property, String bundleName, Locale locale) { 51 super(name, associatedEntity, property, bundleName, locale); 52 } 53 54 66 public StringCriterion(String name, Class associatedEntity, CriterionProperty property, String bundleName, Locale locale, boolean isDynamic) { 67 super(name, associatedEntity, property, bundleName, locale, isDynamic); 68 } 69 70 78 public StringCriterion(StringCriterion criterion) { 79 super(criterion); 80 } 81 82 88 public void setPropertyValue(String value) { 89 if (value != null) { 90 setValue(value); 91 } 92 } 93 94 99 public String getPropertyValue() { 100 if (getValue() != null) { 101 return getValue().toString(); 102 } 103 104 return ""; 105 } 106 107 108 114 public Class getObjectType() { 115 return String .class; 116 } 117 118 123 public Operator[] getOperators() { 124 return new Operator[] { 125 new Operator("operator.string.like.label", OperatorTypes.LIKE, getBundle(), getLocale()), 126 new Operator("operator.string.startWith.label", OperatorTypes.START_WITH, getBundle(), getLocale()), 127 new Operator("operator.string.endWith.label", OperatorTypes.END_WITH, getBundle(), getLocale()) 128 }; 129 } 130 131 136 public CriterionFormPattern getFormPattern() { 137 return CriterionFormPatterns.OPERATOR_INPUT; 138 } 139 } 140 | Popular Tags |