KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > infoglue > cms > applications > workflowtool > util > ContentVersionValues


1 /* ===============================================================================
2 *
3 * Part of the InfoGlue Content Management Platform (www.infoglue.org)
4 *
5 * ===============================================================================
6 *
7 * Copyright (C)
8 *
9 * This program is free software; you can redistribute it and/or modify it under
10 * the terms of the GNU General Public License version 2, as published by the
11 * Free Software Foundation. See the file LICENSE.html for more information.
12 *
13 * This program is distributed in the hope that it will be useful, but WITHOUT
14 * ANY WARRANTY, including the implied warranty of MERCHANTABILITY or FITNESS
15 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License along with
18 * this program; if not, write to the Free Software Foundation, Inc. / 59 Temple
19 * Place, Suite 330 / Boston, MA 02111-1307 / USA.
20 *
21 * ===============================================================================
22 */

23 package org.infoglue.cms.applications.workflowtool.util;
24
25 import java.util.HashMap JavaDoc;
26 import java.util.Map JavaDoc;
27
28 /**
29  * Bean class used for populating content version attributes from
30  * the request and/or the property set.
31  */

32 public class ContentVersionValues
33 {
34     /**
35      * A mapping from attribute names to attribute values.
36      */

37     private final Map JavaDoc values = new HashMap JavaDoc(); // <String> -> <String>
38

39     /**
40      * Default constructor.
41      */

42     public ContentVersionValues()
43     {
44         super();
45     }
46     
47     /**
48      * Returns the value of the attribute with the specified name.
49      *
50      * @param name the name of the attribute.
51      * @return the value of the attribute with the specified name.
52      */

53     public String JavaDoc get(final String JavaDoc name)
54     {
55         return (String JavaDoc) values.get(name);
56     }
57
58     /**
59      * Sets the value of the specified attribute.
60      *
61      * @param name the name of the attribute.
62      * @param value the new value.
63      */

64     public void set(final String JavaDoc name, final String JavaDoc value)
65     {
66         values.put(name, value == null ? "" : value);
67     }
68
69     /**
70      * Returns true if the attribute with the specified name exists; false otherwise.
71      *
72      * @param the name of the attribute.
73      * @return true if the attribute with the specified name exists; false otherwise.
74      */

75     public boolean contains(final String JavaDoc name)
76     {
77         return values.containsKey(name);
78     }
79 }
Popular Tags