View Javadoc
1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one or more
3    * contributor license agreements.  See the NOTICE file distributed with
4    * this work for additional information regarding copyright ownership.
5    * The ASF licenses this file to You under the Apache License, Version 2.0
6    * (the "License"); you may not use this file except in compliance with
7    * the License.  You may obtain a copy of the License at
8    *
9    *      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  package org.apache.juneau.testutils.pojos;
18  
19  import java.net.*;
20  
21  import org.apache.juneau.annotation.*;
22  import org.apache.juneau.xml.annotation.*;
23  
24  @Bean(sort=true)
25  public class TestURI {
26  	@Uri
27  	@Xml(format=XmlFormat.ATTR)
28  	public String f0 = "f0/x0";
29  
30  	public URI f1, f2, f3;
31  
32  	@Uri
33  	public String f4, f5, f6;
34  
35  	public URL f7;
36  
37  	public TestURIb f8;
38  
39  	public String fa, fb, fc, fd, fe;
40  
41  	@Uri
42  	public String getF9() {
43  		return "f9/x9";
44  	}
45  
46  	public TestURI() throws Exception {
47  		f1 = new URI("f1/x1");
48  		f2 = new URI("/f2/x2");  // NOSONAR
49  		f3 = new URI("http://www.apache.org/f3/x3");  // NOSONAR
50  		f4 = "f4/x4";
51  		f5 = "/f5/x5";
52  		f6 = "http://www.apache.org/f6/x6";
53  		f7 = new URL("http://www.apache.org/f7/x7");  // NOSONAR
54  		f8 = new TestURIb();
55  		fa = "http://www.apache.org/fa/xa#MY_LABEL";
56  		fb = "http://www.apache.org/fb/xb?label=MY_LABEL&foo=bar";
57  		fc = "http://www.apache.org/fc/xc?foo=bar&label=MY_LABEL";
58  		fd = "http://www.apache.org/fd/xd?label2=MY_LABEL&foo=bar";
59  		fe = "http://www.apache.org/fe/xe?foo=bar&label2=MY_LABEL";
60  	}
61  
62  	@Uri
63  	public static class TestURIb {
64  		@Override /* Object */
65  		public String toString() {
66  			return "f8/x8";
67  		}
68  	}
69  }