public final void addAttribute(Attribute attr) throws TemplateException {
String name=attr.getName().toLowerCase();
// name
if("name".equals(name)) {
throw new BytecodeException("name cannot be defined twice",getStart());
//this.name=CastString.toExprString(attr.getValue());
}
else if("returntype".equals(name)) {
this.returnType=toLitString(name,attr.getValue());
}
else if("access".equals(name)) {
LitString ls = toLitString(name,attr.getValue());
String strAccess = ls.getString();
int acc = ComponentUtil.toIntAccess(strAccess,-1);
if(acc==-1)
throw new BytecodeException("invalid access type ["+strAccess+"], access types are remote, public, package, private",getStart());
access=acc;
}
else if("output".equals(name)) this.output=toLitBoolean(name,attr.getValue());
else if("bufferoutput".equals(name))this.bufferOutput=toLitBoolean(name,attr.getValue());
else if("displayname".equals(name)) this.displayName=toLitString(name,attr.getValue());
else if("hint".equals(name)) this.hint=toLitString(name,attr.getValue());
else if("description".equals(name)) this.description=toLitString(name,attr.getValue());
else if("returnformat".equals(name))this.returnFormat=toLitString(name,attr.getValue());
else if("securejson".equals(name)) this.secureJson=toLitBoolean(name,attr.getValue());
else if("verifyclient".equals(name)) this.verifyClient=toLitBoolean(name,attr.getValue());
else if("localmode".equals(name)) {
Expression v = attr.getValue();
if(v!=null) {
String str = ASMUtil.toString(v,null);
if(!StringUtil.isEmpty(str)){
int mode = AppListenerUtil.toLocalMode(str, -1);
if(mode!=-1) this.localMode=LitInteger.toExpr(mode);
else throw new BytecodeException("Attribute localMode of the Tag Function, must be a literal value (modern, classic, true or false)",getStart());
}
}
}
else if("cachedwithin".equals(name)) {
try {