KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > juddi > datatype > Name


1 /*
2  * Copyright 2001-2004 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.juddi.datatype;
17
18 /**
19  * Used in BusinessEntity as the Name of the BusinessEntity, in BusinessService
20  * as the name of the BusinessService and in TModel as the name of the TModel.
21  *
22  * @author Steve Viens (sviens@apache.org)
23  */

24 public class Name implements RegistryObject
25 {
26   String JavaDoc nameValue;
27   String JavaDoc langCode; // ISO language code
28

29   /**
30    * Construct a new initialized name instance.
31    */

32   public Name()
33   {
34   }
35
36   /**
37    * Construct a new name from a String.
38    *
39    * @param name The name of the new name-object.
40    */

41   public Name(String JavaDoc name)
42   {
43     setValue(name);
44   }
45
46   /**
47    * Construct a new name with a given name.
48    *
49    * @param name The name of the new name-object.
50    * @param lang The language of the new name-object.
51    */

52   public Name(String JavaDoc name,String JavaDoc lang)
53   {
54     setValue(name);
55     setLanguageCode(lang);
56   }
57
58   /**
59    * Sets the name of this name-object to the new given name.
60    *
61    * @param newName The new name for this name-object.
62    */

63   public void setValue(String JavaDoc newName)
64   {
65     this.nameValue = newName;
66   }
67
68   /**
69    * Returns the name of this name-object.
70    *
71    * @return The name of this name-object.
72    */

73   public String JavaDoc getValue()
74   {
75     return this.nameValue;
76   }
77
78   /**
79    * Sets the name of this name-object to the new given name.
80    *
81    * @param newLang The new name for this name-object.
82    */

83   public void setLanguageCode(String JavaDoc newLang)
84   {
85     this.langCode = newLang;
86   }
87
88   /**
89    * Returns the LanguageCode of this Name object.
90    *
91    * @return The LanguageCode of this name-object.
92    */

93   public String JavaDoc getLanguageCode()
94   {
95     return this.langCode;
96   }
97 }
Popular Tags