code: protected void addFacesListener(FacesListener listener) {
  
          if (listener == null) {
              throw new NullPointerException();
          }
  
          if (listeners == null) {
              listeners = new AttachedObjectListHolder<FacesListener>();
          }
  
          listeners.add(listener);
  
      }
docs: <p>Add the specified {@link FacesListener} to the set of listeners
  registered to receive event notifications from this {@link UIComponent}.
  It is expected that {@link UIComponent} classes acting as event sources
  will have corresponding typesafe APIs for registering listeners of the
  required type, and the implementation of those registration methods
  will delegate to this method.  For example:</p>
  <pre>
  public class FooEvent extends FacesEvent {
  ...
  protected boolean isAppropriateListener(FacesListener listener) {
  return (listener instanceof FooListener);
  }
  protected void processListener(FacesListener listener) {
  ((FooListener) listener).processFoo(this);
  }
  ...
  }
  <p/>
  public interface FooListener extends FacesListener {
  public void processFoo(FooEvent event);
  }
  <p/>
  public class FooComponent extends UIComponentBase {
  ...
  public void addFooListener(FooListener listener) {
  addFacesListener(listener);
  }
  public void removeFooListener(FooListener listener) {
  removeFacesListener(listener);
  }
  ...
  }
  </pre>
  
  @param listener The {@link FacesListener} to be registered
  @throws NullPointerException if <code>listener</code>
  is <code>null</code>