public Tag addBehavior(TagBehavior behavior) {
dynamic = true;
if (behavior instanceof ConditionalTagBehavior) {
if (conditionalBehavior != null) {
throw new TemplateParsingException("Only one conditional behaviour be assigned to a tag. Tag: " + toString(), getBeginLine(), getBeginColumn());
}
conditionalBehavior = (ConditionalTagBehavior) behavior;
} else if (behavior instanceof LoopingTagBehavior) {
if (looping != null) {
throw new TemplateParsingException("Only one looping behaviour be assigned to a tag. Tag: " + toString(), getBeginLine(), getBeginColumn());
}
looping = (LoopingTagBehavior) behavior;
} else if (behavior instanceof ModifyingTagBehavior) {
if (modifyingBehaviors == null) {
modifyingBehaviors = new ArrayList<ModifyingTagBehavior>();