View Javadoc

1   /*
2    *  soapUI, copyright (C) 2004-2008 eviware.com
3    *
4    *  soapUI is free software; you can redistribute it and/or modify it under the
5    *  terms of version 2.1 of the GNU Lesser General Public License as published by
6    *  the Free Software Foundation.
7    *
8    *  soapUI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
9    *  even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10   *  See the GNU Lesser General Public License for more details at gnu.org.
11   */
12  
13  package com.eviware.soapui.impl.wadl.support;
14  
15  import com.eviware.soapui.impl.rest.RestService;
16  import com.eviware.soapui.impl.rest.WadlGenerator;
17  import com.eviware.soapui.impl.support.definition.support.AbstractDefinitionLoader;
18  import org.apache.xmlbeans.XmlObject;
19  import org.apache.xmlbeans.XmlOptions;
20  
21  public class GeneratedWadlDefinitionLoader extends AbstractDefinitionLoader
22  {
23     private RestService restService;
24  
25     public GeneratedWadlDefinitionLoader(RestService restService)
26     {
27        this.restService = restService;
28     }
29  
30     public XmlObject loadXmlObject(String wsdlUrl, XmlOptions options) throws Exception
31     {
32        return new WadlGenerator(restService).generateWadl();
33     }
34  
35     public String getBaseURI()
36     {
37        return restService.getName() + ".wadl";
38     }
39  	
40  	public void setNewBaseURI(String uri)
41  	{
42  		// not implemented
43  	}
44  	
45  	public String getFirstNewURI()
46  	{
47  		return getBaseURI();
48  	}
49  }