KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > tools > jsfext > event > handlers > HandlerContext


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23 package com.sun.enterprise.tools.jsfext.event.handlers;
24
25 import com.sun.enterprise.tools.jsfext.layout.descriptor.LayoutElement;
26
27 import java.util.EventObject JavaDoc;
28
29 import javax.faces.context.FacesContext;
30
31
32 /**
33  *
34  * @author Ken Paulsen (ken.paulsen@sun.com)
35  */

36 public interface HandlerContext {
37
38     /**
39      * <p> Accessor for the FacesContext.</p>
40      *
41      * @return FacesContext
42      */

43     public FacesContext getFacesContext();
44
45     /**
46      * <p> Accessor for the LayoutElement associated with this Handler. The
47      * LayoutElement associated with this Handler is the LayoutElement
48      * which declared the handler. This provides a way for the handler
49      * to obtain access to the LayoutElement which is responsible for it
50      * being invoked.</p>
51      */

52     public LayoutElement getLayoutElement();
53
54     /**
55      * <p> Accessor for the EventObject associated with this Handler. This
56      * may be null if an EventObject was not created for this handler.
57      * An EventObject, if it does exist, may provide additional details
58      * describing the context in which this Event is invoked.</p>
59      */

60     public EventObject JavaDoc getEventObject();
61
62     /**
63      * <p> This method provides access to the EventType. This is mostly
64      * helpful for diagnostics, but may be used in a handler to determine
65      * more information about the context in which the code is
66      * executing.</p>
67      */

68     public String JavaDoc getEventType();
69
70     /**
71      * <p> Accessor for the Handler descriptor for this Handler. The Handler
72      * descriptor object contains specific meta information describing
73      * the invocation of this handler. This includes details such as
74      * input values, and where output values are to be set.</p>
75      */

76     public Handler getHandler();
77
78     /**
79      * <p> Setter for the Handler descriptor for this Handler.</p>
80      *
81      * @param handler The Handler
82      */

83     public void setHandler(Handler handler);
84
85     /**
86      * <p> Accessor for the Handler descriptor for this Handler. The
87      * HandlerDefinition descriptor contains meta information about the
88      * actual Java handler that will handle the processing. This
89      * includes the inputs required, outputs produces, and the types for
90      * both.</p>
91      */

92     public HandlerDefinition getHandlerDefinition();
93
94     /**
95      * <p> This method returns the value for the named input. Input values
96      * are not stored in this Context itself, but in the Handler. If
97      * you are trying to set input values for a handler, you must create
98      * a new Handler object and set its input values.</p>
99      *
100      * @param name The input name
101      *
102      * @return The value of the input (null if not found)
103      */

104     public Object JavaDoc getInputValue(String JavaDoc name);
105
106     /**
107      * <p> This method retrieves an Output value. Output values must not be
108      * stored in this Context itself (remember HandlerContext objects
109      * are shared). Output values are stored according to what is
110      * specified in the HandlerDefintion.</p>
111      *
112      * @param name The output name
113      *
114      * @return The value of the output (null if not found)
115      */

116     public Object JavaDoc getOutputValue(String JavaDoc name);
117
118     /**
119      * <p> This method sets an Output value. Output values must not be
120      * stored in this Context itself (remember HandlerContext objects
121      * are shared). Output values are stored according to what is
122      * specified in the HandlerDefintion.</p>
123      */

124     public void setOutputValue(String JavaDoc name, Object JavaDoc value);
125 }
126
Popular Tags