View Javadoc

1   /*
2    *  soapUI, copyright (C) 2004-2010 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.wsdl.teststeps;
14  
15  import java.lang.reflect.InvocationTargetException;
16  
17  import com.eviware.soapui.impl.wsdl.AbstractWsdlModelItem;
18  
19  public class SettingPathPropertySupport extends AbstractPathPropertySupport
20  {
21  	private final String defaultValue;
22  
23  	public SettingPathPropertySupport( AbstractWsdlModelItem<?> modelItem, String settingName )
24  	{
25  		this( modelItem, settingName, null );
26  	}
27  
28  	public SettingPathPropertySupport( AbstractWsdlModelItem<?> modelItem, String settingName, String defaultValue )
29  	{
30  		super( modelItem, settingName );
31  		this.defaultValue = defaultValue;
32  	}
33  
34  	public void setPropertyValue( String value ) throws IllegalAccessException, InvocationTargetException
35  	{
36  		getModelItem().getSettings().setString( getPropertyName(), value );
37  	}
38  
39  	public String getPropertyValue() throws IllegalAccessException, InvocationTargetException, NoSuchMethodException
40  	{
41  		return getModelItem().getSettings().getString( getPropertyName(), defaultValue );
42  	}
43  }