public static void addUnspecifiedAttributes ( FeatureDescriptor descriptor , Tag tag , String [ ] standardAttributesSorted , FaceletContext ctx ) { for ( TagAttribute attribute : tag . getAttributes ( ) . getAll ( ) ) { final String name = attribute . getLocalName ( ) ; if ( Arrays . binarySearch ( standardAttributesSorted , name ) < 0 ) { // attribute not found in standard attributes // --> put it on the BeanDescriptor descriptor . setValue ( name , attribute . getValueExpression ( ctx , Object . class ) ) ; } } }
Adds all attributes from the given Tag which are NOT listed in standardAttributesSorted as a ValueExpression to the given BeanDescriptor . NOTE that standardAttributesSorted has to be alphabetically sorted in order to use binary search .