public T attr ( Attribute attribute ) { Iterator < Attribute > iterator = attributes . iterator ( ) ; String name = attribute . getName ( ) ; if ( name != null ) { // name == null is allowed, but those Attributes are not rendered. So we add them anyway. while ( iterator . hasNext ( ) ) { Attribute existingAttribute = iterator . next ( ) ; if ( existingAttribute . getName ( ) . equals ( name ) ) { iterator . remove ( ) ; } } } attributes . add ( attribute ) ; return ( T ) this ; }
Adds the specified attribute . If the Tag previously contained an attribute with the same name the old attribute is replaced by the specified attribute .