public void addAttribute ( Attribute attribute , Object value ) { if ( attribute == null ) { throw new NullPointerException ( ) ; } int len = length ( ) ; if ( len == 0 ) { throw new IllegalArgumentException ( "Can't add attribute to 0-length text" ) ; } addAttributeImpl ( attribute , value , 0 , len ) ; }
Adds an attribute to the entire string .