{
tag = tag.mutable();
for (Iterator i = behaviors.iterator(); i.hasNext();)
{
IBehavior behavior = (IBehavior)i.next();
// Components may reject some behavior components
if (isBehaviorAccepted(behavior))
{
behavior.onComponentTag(this, tag);
}
}
}
// apply behaviors that are attached to the component tag.
if (tag.hasBehaviors())
{
Iterator tagBehaviors = tag.getBehaviors();
while (tagBehaviors.hasNext())
{
final IBehavior behavior = (IBehavior)tagBehaviors.next();
behavior.onComponentTag(this, tag);
}
}
// Write the tag
tag.writeOutput(getResponse(), stripWicketTags, findMarkupStream().getWicketNamespace());