KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > axis > wsdl > toJava > NamespaceSelector


1 /*
2  * Copyright 2002,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.axis.wsdl.toJava;
17
18 /**
19    This class is used within the context of a FactorySpec to express
20    namespaces that should be either included and/or excluded from source
21    code generation. The ability to include/exclude specific namespaces from
22    wsdl2java generation allows certain namespaces to be mapped to custom
23    bean classes, have wsdl-generated stubs/skeletons declared to pass those
24    types, and not have the wsdl2java process generate classes which would
25    conflict with the externally developed custom beans.
26
27    @author Jim Stafford (jim.stafford@raba.com)
28 */

29 public class NamespaceSelector {
30     private String JavaDoc namespace_ = "";
31     
32     public NamespaceSelector() {}
33     public NamespaceSelector(String JavaDoc namespace) {
34         namespace_ = namespace;
35     }
36     
37     public void setNamespace(String JavaDoc value) {
38         namespace_ = value;
39     }
40     
41     public String JavaDoc getNamespace() {
42         return namespace_;
43     }
44     
45     public String JavaDoc toString() {
46         if (namespace_ != null) {
47             return "namespace=" + namespace_;
48         }
49         else {
50             return "";
51         }
52     }
53
54     public boolean equals(Object JavaDoc value) {
55         boolean isEqual = false;
56         if (value == null) {
57             isEqual = false;
58         }
59         else if (value instanceof String JavaDoc) {
60             isEqual = ((String JavaDoc)value).equals(namespace_);
61         }
62         else if (value instanceof NamespaceSelector) {
63             isEqual = ((NamespaceSelector)value).namespace_.equals(namespace_);
64         }
65         return isEqual;
66     }
67 }
68
Popular Tags