01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17:
18: package javax.naming;
19:
20: /**
21: * A <code>StringRefAddr</code> refers to an address which is represented by a
22: * string such as a URL or hostname.
23: */
24: public class StringRefAddr extends RefAddr {
25:
26: /*
27: * This constant is used during deserialization to check the version which
28: * created the serialized object.
29: */
30: static final long serialVersionUID = -8913762495138505527L;
31:
32: /**
33: * The address itself. For StringRefAddr the address is a string such as a
34: * URL or hostname.
35: *
36: * @serial
37: */
38: private String contents;
39:
40: /**
41: * Constructs a <code>StringRefAddr</code> object using the supplied
42: * address type and address.
43: *
44: * @param type
45: * the address type which cannot be null
46: * @param address
47: * the address itself which may be null
48: */
49: public StringRefAddr(String type, String address) {
50: super (type);
51: this .contents = address;
52: }
53:
54: /**
55: * Get the string containing this address.
56: *
57: * @return a string containing this address which may be null
58: */
59: @Override
60: public Object getContent() {
61: return contents;
62: }
63:
64: }
|