public static < T > void collectAttributeValues ( Attributes attributes , String name , Collection < T > collection , Class < T > clazz ) { Assert . notNull ( attributes , "Attributes must not be null" ) ; Assert . hasText ( name , "Name must not be empty" ) ; Assert . notNull ( collection , "Collection must not be null" ) ; Attribute attribute = attributes . get ( name ) ; if ( attribute == null ) { throw new NoSuchAttributeException ( "No attribute with name '" + name + "'" ) ; } iterateAttributeValues ( attribute , new CollectingAttributeValueCallbackHandler < T > ( collection , clazz ) ) ; }
Collect all the values of a the specified attribute from the supplied Attributes as the specified class .