View Javadoc

1   /*
2    * Copyright 2003,2004,2005 The Apache Software Foundation.
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.apache.pluto.portlet.admin.bean;
17  
18  /***
19   * Encapsulates a simple String message to be displayed in a JSP
20   * usually using the MessageTag tag library.
21   *
22   * @author Craig Doremus
23   *@see org.apache.pluto.portlet.admin.taglib.MessageTag
24   */
25  public class PortletMessage {
26  	private String message = null;
27  	private PortletMessageType type = null;
28  
29  	/***
30  	 *
31  	 */
32  	public PortletMessage(String message, String type) {
33  		super();
34  		this.message = message;
35  		this.type = PortletMessageType.getTypeByName(type);
36  	}
37  
38  	/***
39  	 *
40  	 */
41  	public PortletMessage(String message, PortletMessageType type) {
42  		super();
43  		this.message = message;
44  		this.type = type;
45  	}
46  
47  	/***
48  	 * @return Returns the message.
49  	 */
50  	public String getMessage() {
51  		return message;
52  	}
53  	/***
54  	 * @param message The message to set.
55  	 */
56  	public void setMessage(String message) {
57  		this.message = message;
58  	}
59  	/***
60  	 * @return Returns the type.
61  	 */
62  	public PortletMessageType getType() {
63  		return type;
64  	}
65  	/***
66  	 * @param type The type to set.
67  	 */
68  	public void setType(PortletMessageType type) {
69  		this.type = type;
70  	}
71  }