public JasperTagInfo(String tagName, String tagClassName, String bodyContent, String infoString, TagLibraryInfo taglib, TagExtraInfo tagExtraInfo, TagAttributeInfo[] attributeInfo, String displayName, String smallIcon, String largeIcon, TagVariableInfo[] tvi, String mapName) { super(tagName, tagClassName, bodyContent, infoString, taglib, tagExtraInfo, attributeInfo, displayName, smallIcon, largeIcon, tvi); this.dynamicAttrsMapName = mapName; }
public TagInfo getTagInfo() throws JasperException { if (name == null) { // XXX Get it from tag file name } if (bodycontent == null) { bodycontent = TagInfo.BODY_CONTENT_SCRIPTLESS; } String tagClassName = JspUtil.getTagHandlerClassName( path, tagLibInfo.getReliableURN(), err); TagVariableInfo[] tagVariableInfos = new TagVariableInfo[variableVector .size()]; variableVector.copyInto(tagVariableInfos); TagAttributeInfo[] tagAttributeInfo = new TagAttributeInfo[attributeVector .size()]; attributeVector.copyInto(tagAttributeInfo); return new JasperTagInfo(name, tagClassName, bodycontent, description, tagLibInfo, tei, tagAttributeInfo, displayName, smallIcon, largeIcon, tagVariableInfos, dynamicAttrsMapName); }
private void checkUniqueName(String name, String type, Node n, TagAttributeInfo attr) throws JasperException { HashMap<String, NameEntry> table = (VAR_NAME_FROM.equals(type)) ? nameFromTable : nameTable; NameEntry nameEntry = table.get(name); if (nameEntry != null) { if (!TAG_DYNAMIC.equals(type) || !TAG_DYNAMIC.equals(nameEntry.getType())) { int line = nameEntry.getNode().getStart().getLineNumber(); err.jspError(n, "jsp.error.tagfile.nameNotUnique", type, nameEntry.getType(), Integer.toString(line)); } } else { table.put(name, new NameEntry(type, n, attr)); } }
/** * Perform miscellaneous checks after the nodes are visited. */ void postCheck() throws JasperException { // Check that var.name-from-attributes has valid values. for (Entry<String, NameEntry> entry : nameFromTable.entrySet()) { String key = entry.getKey(); NameEntry nameEntry = nameTable.get(key); NameEntry nameFromEntry = entry.getValue(); Node nameFromNode = nameFromEntry.getNode(); if (nameEntry == null) { err.jspError(nameFromNode, "jsp.error.tagfile.nameFrom.noAttribute", key); } else { Node node = nameEntry.getNode(); TagAttributeInfo tagAttr = nameEntry.getTagAttributeInfo(); if (!"java.lang.String".equals(tagAttr.getTypeName()) || !tagAttr.isRequired() || tagAttr.canBeRequestTime()) { err.jspError(nameFromNode, "jsp.error.tagfile.nameFrom.badAttribute", key, Integer.toString(node.getStart() .getLineNumber())); } } } }
public TagInfo getTagInfo() throws JasperException { if (name == null) { // XXX Get it from tag file name } if (bodycontent == null) { bodycontent = TagInfo.BODY_CONTENT_SCRIPTLESS; } String tagClassName = JspUtil.getTagHandlerClassName(path, tagLibInfo.getReliableURN(), err); TagVariableInfo[] tagVariableInfos = new TagVariableInfo[variableVector.size()]; variableVector.copyInto(tagVariableInfos); TagAttributeInfo[] tagAttributeInfo = new TagAttributeInfo[attributeVector.size()]; attributeVector.copyInto(tagAttributeInfo); return new JasperTagInfo(name, tagClassName, bodycontent, description, tagLibInfo, tei, tagAttributeInfo, displayName, smallIcon, largeIcon, tagVariableInfos, dynamicAttrsMapName); }
/** * Perform miscellaneous checks after the nodes are visited. */ void postCheck() throws JasperException { // Check that var.name-from-attributes has valid values. for (Entry<String, NameEntry> entry : nameFromTable.entrySet()) { String key = entry.getKey(); NameEntry nameEntry = nameTable.get(key); NameEntry nameFromEntry = entry.getValue(); Node nameFromNode = nameFromEntry.getNode(); if (nameEntry == null) { err.jspError(nameFromNode, "jsp.error.tagfile.nameFrom.noAttribute", key); } else { Node node = nameEntry.getNode(); TagAttributeInfo tagAttr = nameEntry.getTagAttributeInfo(); if (!"java.lang.String".equals(tagAttr.getTypeName()) || !tagAttr.isRequired() || tagAttr.canBeRequestTime()) { err.jspError(nameFromNode, "jsp.error.tagfile.nameFrom.badAttribute", key, Integer.toString(node.getStart().getLineNumber())); } } } }
private void checkUniqueName(String name, Name type, Node n, TagAttributeInfo attr) throws JasperException { HashMap<String, NameEntry> table = (type == Name.VAR_NAME_FROM)? nameFromTable: nameTable; NameEntry nameEntry = table.get(name); if (nameEntry != null) { if (type != Name.TAG_DYNAMIC || nameEntry.getType() != Name.TAG_DYNAMIC) { int line = nameEntry.getNode().getStart().getLineNumber(); err.jspError(n, "jsp.error.tagfile.nameNotUnique", type.getAttribute(), type.getDirective(), nameEntry.getType().getAttribute(), nameEntry.getType().getDirective(), Integer.toString(line)); } } else { table.put(name, new NameEntry(type, n, attr)); } }
private void checkUniqueName(String name, String type, Node n, TagAttributeInfo attr) throws JasperException { HashMap<String, NameEntry> table = (type == VAR_NAME_FROM) ? nameFromTable : nameTable; NameEntry nameEntry = table.get(name); if (nameEntry != null) { if (!TAG_DYNAMIC.equals(type) || !TAG_DYNAMIC.equals(nameEntry.getType())) { int line = nameEntry.getNode().getStart().getLineNumber(); err.jspError(n, "jsp.error.tagfile.nameNotUnique", type, nameEntry.getType(), Integer.toString(line)); } } else { table.put(name, new NameEntry(type, n, attr)); } }
/** * Perform miscellaneous checks after the nodes are visited. */ void postCheck() throws JasperException { // Check that var.name-from-attributes has valid values. Iterator<String> iter = nameFromTable.keySet().iterator(); while (iter.hasNext()) { String nameFrom = iter.next(); NameEntry nameEntry = nameTable.get(nameFrom); NameEntry nameFromEntry = nameFromTable.get(nameFrom); Node nameFromNode = nameFromEntry.getNode(); if (nameEntry == null) { err.jspError(nameFromNode, "jsp.error.tagfile.nameFrom.noAttribute", nameFrom); } else { Node node = nameEntry.getNode(); TagAttributeInfo tagAttr = nameEntry.getTagAttributeInfo(); if (!"java.lang.String".equals(tagAttr.getTypeName()) || !tagAttr.isRequired() || tagAttr.canBeRequestTime()) { err.jspError(nameFromNode, "jsp.error.tagfile.nameFrom.badAttribute", nameFrom, Integer.toString(node.getStart() .getLineNumber())); } } } }
/** * Checks to see if the attribute of the given name is of type * JspFragment. */ public boolean checkIfAttributeIsJspFragment(String name) { boolean result = false; TagAttributeInfo[] attributes = tagInfo.getAttributes(); for (int i = 0; i < attributes.length; i++) { if (attributes[i].getName().equals(name) && attributes[i].isFragment()) { result = true; break; } } return result; }
JspAttribute(TagAttributeInfo tai, String qName, String uri, String localName, String value, boolean expr, ELNode.Nodes el, boolean dyn) { this.qName = qName; this.uri = uri; this.localName = localName; this.value = value; this.namedAttributeNode = null; this.expression = expr; this.el = el; this.dynamic = dyn; this.namedAttribute = false; this.tai = tai; }
/** * Use this constructor if the JspAttribute represents a named * attribute. In this case, we have to store the nodes of the body of * the attribute. */ JspAttribute(NamedAttribute na, TagAttributeInfo tai, boolean dyn) { this.qName = na.getName(); this.localName = na.getLocalName(); this.value = null; this.namedAttributeNode = na; this.expression = false; this.el = null; this.dynamic = dyn; this.namedAttribute = true; this.tai = null; }
public TagFileDirectiveVisitor(Compiler compiler, TagLibraryInfo tagLibInfo, String name, String path) { err = compiler.getErrorDispatcher(); this.tagLibInfo = tagLibInfo; this.name = name; this.path = path; attributeVector = new Vector<TagAttributeInfo>(); variableVector = new Vector<TagVariableInfo>(); }
public TagAttributeInfo getTagAttributeInfo(String name) { TagInfo info = this.getTagInfo(); if (info == null) return null; TagAttributeInfo[] tai = info.getAttributes(); for (int i = 0; i < tai.length; i++) { if (tai[i].getName().equals(name)) { return tai[i]; } } return null; }
private void checkUniqueName(String name, String type, Node n, TagAttributeInfo attr) throws JasperException { HashMap table = (type == VAR_NAME_FROM) ? nameFromTable : nameTable; NameEntry nameEntry = (NameEntry) table.get(name); if (nameEntry != null) { if (type != TAG_DYNAMIC || nameEntry.getType() != TAG_DYNAMIC) { int line = nameEntry.getNode().getStart().getLineNumber(); err.jspError(n, "jsp.error.tagfile.nameNotUnique", type, nameEntry.getType(), Integer.toString(line)); } } else { table.put(name, new NameEntry(type, n, attr)); } }
/** * Perform miscellean checks after the nodes are visited. */ void postCheck() throws JasperException { // Check that var.name-from-attributes has valid values. Iterator iter = nameFromTable.keySet().iterator(); while (iter.hasNext()) { String nameFrom = (String) iter.next(); NameEntry nameEntry = (NameEntry) nameTable.get(nameFrom); NameEntry nameFromEntry = (NameEntry) nameFromTable .get(nameFrom); Node nameFromNode = nameFromEntry.getNode(); if (nameEntry == null) { err.jspError(nameFromNode, "jsp.error.tagfile.nameFrom.noAttribute", nameFrom); } else { Node node = nameEntry.getNode(); TagAttributeInfo tagAttr = nameEntry.getTagAttributeInfo(); if (!"java.lang.String".equals(tagAttr.getTypeName()) || !tagAttr.isRequired() || tagAttr.canBeRequestTime()) { err.jspError(nameFromNode, "jsp.error.tagfile.nameFrom.badAttribute", nameFrom, Integer.toString(node.getStart() .getLineNumber())); } } } }