1 15 package org.apache.tapestry.valid; 16 17 import java.io.Serializable ; 18 19 import org.apache.hivemind.util.Defense; 20 import org.apache.tapestry.IRender; 21 import org.apache.tapestry.form.IFormComponent; 22 23 29 30 public class FieldTracking implements IFieldTracking, Serializable 31 { 32 private static final long serialVersionUID = -5397563163968532716L; 33 34 private transient IFormComponent _component; 35 36 private String _input; 37 38 private IRender _renderer; 39 40 private String _fieldName; 41 42 private ValidationConstraint _constraint; 43 44 48 49 FieldTracking() 50 { 51 } 52 53 56 57 FieldTracking(String fieldName, IFormComponent component) 58 { 59 Defense.notNull(fieldName, "fieldName"); 60 Defense.notNull(component, "component"); 61 62 _fieldName = fieldName; 63 _component = component; 64 } 65 66 public IFormComponent getComponent() 67 { 68 return _component; 69 } 70 71 public IRender getErrorRenderer() 72 { 73 return _renderer; 74 } 75 76 public void setErrorRenderer(IRender value) 77 { 78 _renderer = value; 79 } 80 81 public String getInput() 82 { 83 return _input; 84 } 85 86 public void setInput(String value) 87 { 88 _input = value; 89 } 90 91 public String getFieldName() 92 { 93 return _fieldName; 94 } 95 96 public ValidationConstraint getConstraint() 97 { 98 return _constraint; 99 } 100 101 public void setConstraint(ValidationConstraint constraint) 102 { 103 _constraint = constraint; 104 } 105 106 107 108 public boolean isInError() 109 { 110 return _renderer != null; 111 } 112 113 } | Popular Tags |