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.support.components;
14  
15  import com.eviware.soapui.model.ModelItem;
16  import com.eviware.soapui.support.editor.EditorInspector;
17  import com.eviware.soapui.support.editor.EditorView;
18  import com.eviware.soapui.support.editor.registry.*;
19  import com.eviware.soapui.support.editor.xml.XmlDocument;
20  import com.eviware.soapui.support.editor.xml.XmlEditorView;
21  import com.eviware.soapui.support.editor.xml.XmlInspector;
22  
23  /***
24   * XmlEditor for a response-message to a WsdlRequest
25   * 
26   * @author ole.matzura
27   */
28  
29  public class ResponseMessageXmlEditor<T extends ModelItem, T2 extends XmlDocument> extends ModelItemXmlEditor<T, T2>
30  {
31  	@SuppressWarnings("unchecked")
32  	public ResponseMessageXmlEditor( T2 xmlDocument, T modelItem  )
33  	{
34  		super( xmlDocument, modelItem );
35  		
36  		EditorViewFactory[] editorFactories = EditorViewFactoryRegistry.getInstance().getFactoriesOfType(
37  					ResponseEditorViewFactory.class );
38  		
39  		for( EditorViewFactory factory : editorFactories )
40  		{
41  			ResponseEditorViewFactory f = ( ResponseEditorViewFactory ) factory;
42  			XmlEditorView editorView = (XmlEditorView) f.createResponseEditorView( this, modelItem );
43  			if( editorView != null )
44  				addEditorView( (EditorView<T2>) editorView);
45  		}
46  		
47  		InspectorFactory[] inspectorFactories = InspectorRegistry.getInstance().getFactoriesOfType( 
48  					ResponseInspectorFactory.class );
49  		
50  		for( InspectorFactory factory : inspectorFactories )
51  		{
52  			ResponseInspectorFactory f = ( ResponseInspectorFactory ) factory;
53  			XmlInspector inspector = (XmlInspector) f.createResponseInspector( this, modelItem );
54  			if( inspector != null )
55  				addInspector( (EditorInspector<T2>) inspector);
56  		}
57  	}
58  }