1 28 29 package com.caucho.jsp.cfg; 30 31 import com.caucho.config.types.Signature; 32 33 import javax.servlet.jsp.tagext.JspFragment ; 34 35 38 public class TldAttribute { 39 private String _name; 40 private boolean _required; 41 private boolean _rtexprvalue; 42 private Class _type; 43 private String _description; 44 private boolean _isFragment; 45 46 private DeferredMethod _deferredMethod; 47 private DeferredValue _deferredValue; 48 49 52 public void setName(String name) 53 { 54 _name = name; 55 } 56 57 60 public String getName() 61 { 62 return _name; 63 } 64 65 68 public void setDescription(String description) 69 { 70 _description = description; 71 } 72 73 public String getDescription() 74 { 75 return _description; 76 } 77 78 81 public void setRequired(boolean required) 82 { 83 _required = required; 84 } 85 86 89 public boolean getRequired() 90 { 91 return _required; 92 } 93 94 97 public void setRtexprvalue(boolean rtexprvalue) 98 { 99 _rtexprvalue = rtexprvalue; 100 } 101 102 105 public boolean getRtexprvalue() 106 { 107 return _rtexprvalue; 108 } 109 110 113 public void setFragment(boolean isFragment) 114 { 115 _isFragment = isFragment; 116 } 117 118 121 public boolean isFragment() 122 { 123 return _isFragment; 124 } 125 126 129 public void setType(Class type) 130 { 131 _type = type; 132 } 133 134 137 public Class getType() 138 { 139 if (_type != null) 140 return _type; 141 else if (isFragment()) 142 return JspFragment .class; 143 else 144 return String .class; 145 } 146 147 150 public void setDeferredValue(DeferredValue v) 151 { 152 _deferredValue = v; 153 } 154 155 158 public DeferredValue getDeferredValue() 159 { 160 return _deferredValue; 161 } 162 163 166 public void setDeferredMethod(DeferredMethod defer) 167 { 168 _deferredMethod = defer; 169 } 170 171 public String getExpectedType() 172 { 173 if (_deferredValue != null) 174 return _deferredValue.getType(); 175 else 176 return null; 177 } 178 179 public DeferredMethod getDeferredMethod() 180 { 181 return _deferredMethod; 182 } 183 184 public String getDeferredMethodSignature() 185 { 186 if (_deferredMethod != null) { 187 Signature sig = _deferredMethod.getMethodSignature(); 188 189 if (sig != null) 190 return sig.getSignature(); 191 } 192 193 return null; 194 } 195 196 public static class DeferredMethod { 197 private Signature _signature; 198 199 public void setMethodSignature(Signature sig) 200 { 201 _signature = sig; 202 } 203 204 public Signature getMethodSignature() 205 { 206 return _signature; 207 } 208 } 209 210 public static class DeferredValue { 211 private String _type; 212 213 public void setId(String id) 214 { 215 } 216 217 public void setType(String type) 218 { 219 _type = type; 220 } 221 222 public String getType() 223 { 224 return _type; 225 } 226 } 227 } 228 | Popular Tags |