View Javadoc
1   /*
2    * Copyright 2001-2008 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   */
17  
18  package org.apache.juddi.v3.error;
19  
20  import org.apache.juddi.config.ResourceConfig;
21  
22  /**
23   * @author <a href="mailto:jfaath@apache.org">Jeff Faath</a>
24   */
25  public class ErrorMessage {
26  	private String message;
27  	private String value;
28  	
29  	public ErrorMessage(String messageCode) {
30  		this(messageCode, null);
31  	}
32  	
33  	public ErrorMessage(String messageCode, String value) {
34  		this.message = ResourceConfig.getGlobalMessage(messageCode);
35  		this.value = value;
36  	}
37  
38  	public String getMessage() {
39  		return message;
40  	}
41  
42  	public void setMessage(String message) {
43  		this.message = message;
44  	}
45  
46  	public String getValue() {
47  		return value;
48  	}
49  
50  	public void setValue(String value) {
51  		this.value = value;
52  	}
53  	
54  	public String toString() {
55  		if (value == null || value.length() == 0)
56  			return message;
57  		else
58  			return message + ":  " + value;
59  			
60  	}
61  }