@Override
public void generatePrologue(JspJavaWriter out)
throws Exception
{
for (int i = 0; i < _attributeNames.size(); i++) {
QName name = _attributeNames.get(i);
Object value = _attributeValues.get(i);
if (! (value instanceof JspFragmentNode))
continue;
JspFragmentNode frag = (JspFragmentNode) value;
TagAttributeInfo attribute = getAttributeInfo(name);
String typeName = null;
boolean isFragment = false;
if (attribute != null && attribute.isFragment())
isFragment = true;
String fragmentClass = JspFragment.class.getName();
if (attribute != null && fragmentClass.equals(attribute.getTypeName()))
isFragment = true;
Method method = getAttributeMethod(name);
if (method != null) {
typeName = method.getParameterTypes()[0].getName();
if (fragmentClass.equals(typeName))
isFragment = true;
}
if (isFragment)
frag.generateFragmentPrologue(out);
}
TagInstance parent = getParent().getTag();
boolean isBodyTag = BodyTag.class.isAssignableFrom(_tagClass);
boolean isEmpty = isEmpty();
boolean hasBodyContent = isBodyTag && ! isEmpty;
_tag = parent.findTag(getQName(), _attributeNames,
hasBodyContent);
if (_tag == null || ! _parseState.isRecycleTags()) {
_tag = parent.addTag(_gen, getQName(), _tagInfo, _tagClass,
_attributeNames, _attributeValues,
hasBodyContent);
if (! JspTagFileSupport.class.isAssignableFrom(_tagClass)) {
out.printClass(_tagClass);
out.println(" " + _tag.getId() + " = null;");
}
_isDeclaringInstance = true;
/*
if (SimpleTag.class.isAssignableFrom(_tagClass) && hasCustomTag())
out.println("javax.servlet.jsp.tagext.Tag " + _tag.getId() + "_adapter = null;");
*/
}
else {
// Any conflicting values must be set each time.
for (int i = 0; i < _attributeNames.size(); i++) {
QName name = _attributeNames.get(i);
Object value = _attributeValues.get(i);
_tag.addAttribute(name, value);
}
}