View Javadoc

1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  You may obtain a copy of the License at
9    *
10   *   http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing,
13   * software distributed under the License is distributed on an
14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   * KIND, either express or implied.  See the License for the
16   * specific language governing permissions and limitations
17   * under the License.
18   */
19  package javax.faces.view;
20  
21  import javax.faces.component.UIComponent;
22  import javax.faces.context.FacesContext;
23  
24  /**
25   * The abstract base interface for a handler representing an <em>attached object</em> in a PDL page. Subinterfaces are
26   * provided for the common attached objects that expose {@link javax.faces.convert.Converter Converter},
27   * {@link javax.faces.validator.Validator Validator}, {@link javax.faces.event.ValueChangeEvent ValueChangeEvent}, and
28   * {@link javax.faces.event.ActionListener ActionListener} for use by <em>page authors</em>.
29   * 
30   * @since 2.0
31   */
32  public interface AttachedObjectHandler
33  {
34      /**
35       * Take the argument <code>parent</code> and apply this attached <code>object</code> to it. The action taken varies
36       * with class that implements one of the subinterfaces of this interface.
37       * 
38       * @param context
39       *            The <code>FacesContext</code> for this request
40       * @param parent
41       *            The <code>UIComponent</code> to which this particular attached object must be applied.
42       */
43      public void applyAttachedObject(FacesContext context, UIComponent parent);
44  
45      /**
46       * Return the value of the "for" attribute specified by the <em>page author</em> on the tag for this
47       * <code>AttachedObjectHandler</code>.
48       * 
49       * @return the value of the "for" attribute specified by the <em>page author</em> on the tag for this
50       *         <code>AttachedObjectHandler</code>.
51       */
52      public String getFor();
53  }