150
150
n.setAtSTag(curNodes);
151
151
n.setUseTagPlugin(true);
152
152
pluginAttributes = new HashMap();
155
public TagPluginContext getParentContext() {
156
Node parent = node.getParent();
157
if (! (parent instanceof Node.CustomTag)) {
160
return ((Node.CustomTag) parent).getTagPluginContext();
163
public void setPluginAttribute(String key, Object value) {
164
pluginAttributes.put(key, value);
167
public Object getPluginAttribute(String key) {
168
return pluginAttributes.get(key);
171
public boolean isScriptless() {
172
return node.getChildInfo().isScriptless();
175
public boolean isConstantAttribute(String attribute) {
176
Node.JspAttribute attr = getNodeAttribute(attribute);
179
return attr.isLiteral();
182
public String getConstantAttribute(String attribute) {
183
Node.JspAttribute attr = getNodeAttribute(attribute);
186
return attr.getValue();
189
public boolean isAttributeSpecified(String attribute) {
190
return getNodeAttribute(attribute) != null;
193
public String getTemporaryVariableName() {
194
return JspUtil.nextTemporaryVariableName();
197
public void generateImport(String imp) {
198
pageInfo.addImport(imp);
201
public void generateDeclaration(String id, String text) {
202
if (pageInfo.isPluginDeclared(id)) {
205
curNodes.add(new Node.Declaration(text, node.getStart(), null));
208
public void generateJavaSource(String sourceCode) {
209
curNodes.add(new Node.Scriptlet(sourceCode, node.getStart(),
213
public void generateAttribute(String attributeName) {
214
curNodes.add(new Node.AttributeGenerator(node.getStart(),
219
public void dontUseTagPlugin() {
220
node.setUseTagPlugin(false);
223
public void generateBody() {
224
// Since we'll generate the body anyway, this is really a nop,
225
// except for the fact that it lets us put the Java sources the
226
// plugins produce in the correct order (w.r.t the body).
227
curNodes = node.getAtETag();
230
private Node.JspAttribute getNodeAttribute(String attribute) {
231
Node.JspAttribute[] attrs = node.getJspAttributes();
232
for (int i=0; attrs != null && i < attrs.length; i++) {
233
if (attrs[i].getName().equals(attribute)) {
155
public TagPluginContext getParentContext() {
156
Node parent = node.getParent();
157
if (! (parent instanceof Node.CustomTag)) {
160
return ((Node.CustomTag) parent).getTagPluginContext();
163
public void setPluginAttribute(String key, Object value) {
164
pluginAttributes.put(key, value);
167
public Object getPluginAttribute(String key) {
168
return pluginAttributes.get(key);
171
public boolean isScriptless() {
172
return node.getChildInfo().isScriptless();
175
public boolean isConstantAttribute(String attribute) {
176
Node.JspAttribute attr = getNodeAttribute(attribute);
179
return attr.isLiteral();
182
public String getConstantAttribute(String attribute) {
183
Node.JspAttribute attr = getNodeAttribute(attribute);
186
return attr.getValue();
189
public boolean isAttributeSpecified(String attribute) {
190
return getNodeAttribute(attribute) != null;
193
public String getTemporaryVariableName() {
194
return node.getRoot().nextTemporaryVariableName();
197
public void generateImport(String imp) {
198
pageInfo.addImport(imp);
201
public void generateDeclaration(String id, String text) {
202
if (pageInfo.isPluginDeclared(id)) {
205
curNodes.add(new Node.Declaration(text, node.getStart(), null));
208
public void generateJavaSource(String sourceCode) {
209
curNodes.add(new Node.Scriptlet(sourceCode, node.getStart(),
213
public void generateAttribute(String attributeName) {
214
curNodes.add(new Node.AttributeGenerator(node.getStart(),
219
public void dontUseTagPlugin() {
220
node.setUseTagPlugin(false);
223
public void generateBody() {
224
// Since we'll generate the body anyway, this is really a nop,
225
// except for the fact that it lets us put the Java sources the
226
// plugins produce in the correct order (w.r.t the body).
227
curNodes = node.getAtETag();
230
private Node.JspAttribute getNodeAttribute(String attribute) {
231
Node.JspAttribute[] attrs = node.getJspAttributes();
232
for (int i=0; attrs != null && i < attrs.length; i++) {
233
if (attrs[i].getName().equals(attribute)) {