View Javadoc

1   /*
2    *  soapUI, copyright (C) 2004-2007 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.model.iface;
14  
15  import javax.wsdl.Part;
16  import javax.xml.namespace.QName;
17  
18  import org.apache.xmlbeans.SchemaType;
19  
20  public interface MessagePart
21  {
22  	public String getName();
23  	
24  	public String getDescription();
25  	
26  	public PartType getPartType();
27  	
28  	public enum PartType { HEADER, CONTENT, ATTACHMENT, FAULT };
29  	
30  	public abstract static class ContentPart implements MessagePart
31  	{
32  		public abstract SchemaType getSchemaType();
33  		
34  		public abstract QName getPartElement();
35  		
36  		public PartType getPartType()
37  		{
38  			return PartType.CONTENT;
39  		}
40  	}
41  	
42  	public abstract static class AttachmentPart implements MessagePart
43  	{
44  		public abstract String[] getContentTypes();
45  		
46  		public abstract boolean isAnonymous();
47  		
48  		public PartType getPartType()
49  		{
50  			return PartType.ATTACHMENT;
51  		}
52  	}
53  	
54  	public abstract static class HeaderPart extends ContentPart
55  	{
56  		public abstract SchemaType getSchemaType();
57  		
58  		public PartType getPartType()
59  		{
60  			return PartType.HEADER;
61  		}
62  	}
63  	
64  	public abstract static class FaultPart extends ContentPart
65  	{
66  		public abstract SchemaType getSchemaType();
67  		
68  		public PartType getPartType()
69  		{
70  			return PartType.FAULT;
71  		}
72  
73  		public abstract Part [] getWsdlParts();
74  	}
75  }