public void add ( Binding binding , boolean override ) { final Set < Binding > moduleBindings = this . module . get ( ) . getBindings ( ) ; final Binding otherBinding = findBinding ( moduleBindings , binding ) ; if ( ! override ) { if ( otherBinding != null ) { throw new IllegalArgumentException ( MessageFormat . format ( "Forbidden override of {0} by {1}." , //$NON-NLS-1$ otherBinding , binding ) ) ; } } else if ( otherBinding != null ) { this . removableBindings . add ( otherBinding ) ; } if ( ! this . bindings . add ( binding ) ) { throw new IllegalArgumentException ( MessageFormat . format ( "Duplicate binding for {0} in {1}" , binding . getKey ( ) , this . name ) ) ; //$NON-NLS-1$ } }
Add the binding .