View Javadoc

1   /*
2    *  soapUI, copyright (C) 2004-2009 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.support.definition.support;
14  
15  import java.util.List;
16  
17  import com.eviware.soapui.impl.support.AbstractInterface;
18  import com.eviware.soapui.impl.support.definition.DefinitionCache;
19  import com.eviware.soapui.impl.support.definition.InterfaceDefinition;
20  import com.eviware.soapui.impl.support.definition.InterfaceDefinitionPart;
21  
22  public abstract class AbstractInterfaceDefinition<T extends AbstractInterface> implements InterfaceDefinition<T>
23  {
24  	private DefinitionCache definitionCache;
25  	private T iface;
26  
27  	protected AbstractInterfaceDefinition( T iface )
28  	{
29  		this.iface = iface;
30  	}
31  
32  	public DefinitionCache getDefinitionCache()
33  	{
34  		return definitionCache;
35  	}
36  
37  	public void setDefinitionCache( DefinitionCache definitionCache )
38  	{
39  		this.definitionCache = definitionCache;
40  	}
41  
42  	public InterfaceDefinitionPart getRootPart()
43  	{
44  		return definitionCache == null ? null : definitionCache.getRootPart();
45  	}
46  
47  	public List getDefinitionParts() throws Exception
48  	{
49  		return definitionCache == null ? null : definitionCache.getDefinitionParts();
50  	}
51  
52  	public T getInterface()
53  	{
54  		return iface;
55  	}
56  
57  	public void setIface( T iface )
58  	{
59  		this.iface = iface;
60  	}
61  }