{
tag = tag.mutable();
for (Iterator<IBehavior> i = behaviors.iterator(); i.hasNext();)
{
IBehavior behavior = 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<? extends IBehavior> tagBehaviors = tag.getBehaviors();
while (tagBehaviors.hasNext())
{
final IBehavior behavior = tagBehaviors.next();
behavior.onComponentTag(this, tag);
}
}
// Write the tag
tag.writeOutput(getResponse(), stripWicketTags, findMarkupStream().getWicketNamespace());