KickJava   Java API By Example, From Geeks To Geeks.

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


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
26 /**
27  * <p> This class holds OutputMapping value meta information for individual
28  * instances of Handler Objects. This information is necessary to provide
29  * the location to store the output value for a specific invocation of a
30  * handler. This is data consists of the name the Handler uses for the
31  * output, the OutputType, and optionally the OutputType key to use when
32  * storing/retrieving the output value.</p>
33  *
34  * @author Ken Paulsen (ken.paulsen@sun.com)
35  */

36 public class OutputMapping implements java.io.Serializable JavaDoc {
37
38     /**
39      * <p> Constructor with targetKey as null. This constructor will
40      * throw an IllegalArgumentException if outputName or
41      * targetOutputType is null.</p>
42      *
43      * @param outputName The name the Handler uses for output value
44      * @param targetOutputType OutputType that will store the output value
45      *
46      * @see OutputTypeManager
47      *
48      * @throws IllegalArumentException If outputName / targetOutputType is null
49      */

50     public OutputMapping(String JavaDoc outputName, String JavaDoc targetOutputType) {
51     this(outputName, null, targetOutputType);
52     }
53
54
55     /**
56      * <p> Constructor with all values supplied as Strings. This constructor
57      * will throw an IllegalArgumentException if outputName or
58      * targetOutputType is null.</p>
59      *
60      * @param outputName The name the Handler uses for output value
61      * @param targetKey The key the OutputType will use
62      * @param targetOutputType OutputType that will store the output value
63      *
64      * @see OutputTypeManager
65      *
66      * @throws IllegalArumentException If outputName / targetOutputType is null
67      */

68     public OutputMapping(String JavaDoc outputName, String JavaDoc targetKey, String JavaDoc targetOutputType) {
69     // Sanity checks...
70
if ((outputName == null) || (outputName.length() == 0)) {
71         throw new NullPointerException JavaDoc("'outputName' is required!");
72     }
73     if (targetOutputType == null) {
74         throw new NullPointerException JavaDoc("'targetOutputType' is required!");
75     }
76     _outputName = outputName;
77     _targetKey = targetKey;
78     _targetOutputType = targetOutputType;
79     }
80
81     /**
82      * <p> Constructor with all the values passed in. This constructor will
83      * throw an IllegalArgumentException if outputName or
84      * targetOutputType is null.</p>
85      *
86      * @param outputName The name the Handler uses for output value
87      * @param targetKey The key the OutputType will use
88      * @param targetOutputType OutputType that will store the output value
89      *
90      * @see OutputTypeManager
91      *
92      * @throws IllegalArumentException If outputName or
93      * targetOutputType is null
94     public OutputMapping(String outputName, String targetKey, OutputType targetOutputType) {
95     _outputName = outputName;
96     _targetKey = targetKey;
97     _targetOutputType = targetOutputType;
98     }
99      */

100
101     /**
102      * Accessor for outputName.
103      */

104     public String JavaDoc getOutputName() {
105     return _outputName;
106     }
107
108     /**
109      * Accessor for targetKey.
110      */

111     public String JavaDoc getOutputKey() {
112     return _targetKey;
113     }
114
115     /**
116      * Accessor for targetOutputType.
117      */

118     public OutputType getOutputType() {
119     return OutputTypeManager.getInstance().getOutputType(_targetOutputType);
120     }
121
122
123     private String JavaDoc _outputName = null;
124     private String JavaDoc _targetKey = null;
125     private String JavaDoc _targetOutputType = null;
126 }
127
Popular Tags