KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > resource > metadata > DescriptionMetaData


1 /*
2 * JBoss, Home of Professional Open Source
3 * Copyright 2005, JBoss Inc., and individual contributors as indicated
4 * by the @authors tag. See the copyright.txt in the distribution for a
5 * full listing of individual contributors.
6 *
7 * This is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU Lesser General Public License as
9 * published by the Free Software Foundation; either version 2.1 of
10 * the License, or (at your option) any later version.
11 *
12 * This software is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this software; if not, write to the Free
19 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21 */

22 package org.jboss.resource.metadata;
23
24 import java.io.Serializable JavaDoc;
25 import java.util.Locale JavaDoc;
26
27 /**
28  * Description meta data
29  *
30  * @author <a HREF="mailto:adrian@jboss.com">Adrian Brock</a>
31  * @version $Revision: 38342 $
32  */

33 public class DescriptionMetaData implements Serializable JavaDoc
34 {
35    static final long serialVersionUID = -3100028904830435509L;
36
37    /** The language */
38    private String JavaDoc lang;
39    
40    /** The description */
41    private String JavaDoc description;
42
43    /**
44     * Create a new description meta data using the default langugage
45     */

46    public DescriptionMetaData()
47    {
48       this(null);
49    }
50
51    /**
52     * Create a new description meta data
53     *
54     * @param lang the language
55     */

56    public DescriptionMetaData(String JavaDoc lang)
57    {
58       if (lang == null)
59          this.lang = Locale.getDefault().getLanguage();
60       else
61          this.lang = lang;
62    }
63
64    /**
65     * Get the language
66     *
67     * @return the language
68     */

69    public String JavaDoc getLanguage()
70    {
71       return lang;
72    }
73
74    /**
75     * Get the description
76     *
77     * @return the description
78     */

79    public String JavaDoc getDescription()
80    {
81       return description;
82    }
83
84    /**
85     * Set the description
86     *
87     * @param description the description
88     */

89    public void setDescription(String JavaDoc description)
90    {
91       this.description = description;
92    }
93    
94    public String JavaDoc toString()
95    {
96       StringBuffer JavaDoc buffer = new StringBuffer JavaDoc();
97       buffer.append("DescriptionMetaData").append('@');
98       buffer.append(Integer.toHexString(System.identityHashCode(this)));
99       buffer.append("[language=").append(lang);
100       if (description != null)
101          buffer.append(" description=").append(description);
102       buffer.append(']');
103       return buffer.toString();
104    }
105 }
106
Popular Tags