1 18 package org.apache.struts.taglib.logic; 19 20 import javax.servlet.jsp.tagext.TagData ; 21 import javax.servlet.jsp.tagext.TagExtraInfo ; 22 import javax.servlet.jsp.tagext.VariableInfo ; 23 24 30 public class IterateTei extends TagExtraInfo { 31 32 35 public VariableInfo [] getVariableInfo(TagData data) { 36 37 VariableInfo [] variables = new VariableInfo [2]; 40 41 int counter = 0; 43 44 45 String id = data.getAttributeString("id"); 46 String type = data.getAttributeString("type"); 47 if (id != null) { 48 if (type == null) { 49 type = "java.lang.Object"; 50 } 51 variables[counter++] = new VariableInfo (data.getAttributeString("id"), 52 type, true, 53 VariableInfo.NESTED); 54 } 55 56 57 String indexId = data.getAttributeString("indexId"); 58 if (indexId != null) { 59 variables[counter++] = new VariableInfo (indexId, "java.lang.Integer", 60 true, VariableInfo.NESTED); 61 } 62 63 64 VariableInfo [] result; 65 if (counter > 0) { 66 result = new VariableInfo [counter]; 67 System.arraycopy(variables, 0, result, 0, counter); 68 } else { 69 result = new VariableInfo [0]; 70 } 71 return result; 72 } 73 } 74 | Popular Tags |