01: /*
02: * JBoss, Home of Professional Open Source.
03: * Copyright 2006, Red Hat Middleware LLC, and individual contributors
04: * as indicated by the @author tags. See the copyright.txt file in the
05: * distribution for a full listing of individual contributors.
06: *
07: * This is free software; you can redistribute it and/or modify it
08: * under the terms of the GNU Lesser General Public License as
09: * 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;
25: import java.util.Locale;
26:
27: /**
28: * Description meta data
29: *
30: * @author <a href="mailto:adrian@jboss.com">Adrian Brock</a>
31: * @version $Revision: 57189 $
32: */
33: public class DescriptionMetaData implements Serializable {
34: static final long serialVersionUID = -3100028904830435509L;
35:
36: /** The language */
37: private String lang;
38:
39: /** The description */
40: private String description;
41:
42: /**
43: * Create a new description meta data using the default langugage
44: */
45: public DescriptionMetaData() {
46: this (null);
47: }
48:
49: /**
50: * Create a new description meta data
51: *
52: * @param lang the language
53: */
54: public DescriptionMetaData(String lang) {
55: if (lang == null)
56: this .lang = Locale.getDefault().getLanguage();
57: else
58: this .lang = lang;
59: }
60:
61: /**
62: * Get the language
63: *
64: * @return the language
65: */
66: public String getLanguage() {
67: return lang;
68: }
69:
70: /**
71: * Get the description
72: *
73: * @return the description
74: */
75: public String getDescription() {
76: return description;
77: }
78:
79: /**
80: * Set the description
81: *
82: * @param description the description
83: */
84: public void setDescription(String description) {
85: this .description = description;
86: }
87:
88: public String toString() {
89: StringBuffer buffer = new StringBuffer();
90: buffer.append("DescriptionMetaData").append('@');
91: buffer.append(Integer
92: .toHexString(System.identityHashCode(this )));
93: buffer.append("[language=").append(lang);
94: if (description != null)
95: buffer.append(" description=").append(description);
96: buffer.append(']');
97: return buffer.toString();
98: }
99: }
|