1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.apache.juddi.datatype;
17
18 /***
19 * A Description object contains a textual description and an optional
20 * language code.<p>
21 *
22 * A default ISO language code will be determined for a publisher at the time
23 * that a party establishes permissions to publish at a given operator site
24 * or implementation. This default language code will be applied to any
25 * description values that are provided with no language code.<p>
26 *
27 * @author Steve Viens (sviens@apache.org)
28 */
29 public class Description implements RegistryObject
30 {
31 String descValue;
32 String langCode;
33
34 /***
35 * Construct a new initialized Description instance.
36 */
37 public Description()
38 {
39 }
40
41 /***
42 * Construct a new initialized Description instance.
43 */
44 public Description(String descValue)
45 {
46 this.setValue(descValue);
47 }
48
49 /***
50 * Construct a new initialized Description instance.
51 */
52 public Description(String descValue,String langCode)
53 {
54 this.setValue(descValue);
55 this.setLanguageCode(langCode);
56 }
57
58 /***
59 * Sets the LanguageCode of this Description.
60 *
61 * @param langCode The new LanguageCode.
62 */
63 public void setLanguageCode(String langCode)
64 {
65 this.langCode = langCode;
66 }
67
68 /***
69 * Returns the LanguageCode of this Description.
70 *
71 * @return The LanguageCode of this Description, or null if this
72 * description doesn't have a LanguageCode.
73 */
74 public String getLanguageCode()
75 {
76 return this.langCode;
77 }
78
79 /***
80 * Sets the text of this Description to the given text. If the
81 * Description has more than 255 characters, it will be trunctated.
82 *
83 * @param newDesc The new text of this Description.
84 */
85 public void setValue(String newDesc)
86 {
87 this.descValue = newDesc;
88 }
89
90 /***
91 * Returns the text of this Description.
92 *
93 * @return The text of this Description.
94 */
95 public String getValue()
96 {
97 return this.descValue;
98 }
99 }