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.model.iface;
14  
15  import javax.wsdl.Part;
16  import javax.xml.namespace.QName;
17  
18  import org.apache.xmlbeans.SchemaGlobalElement;
19  import org.apache.xmlbeans.SchemaType;
20  
21  /***
22   * A message part in a Request
23   * 
24   * @author ole.matzura
25   */
26  
27  public interface MessagePart
28  {
29  	public String getName();
30  
31  	public String getDescription();
32  
33  	public PartType getPartType();
34  
35  	public enum PartType
36  	{
37  		HEADER, CONTENT, ATTACHMENT, FAULT, PARAMETER
38  	};
39  
40  	public abstract static class ContentPart implements MessagePart
41  	{
42  		public abstract SchemaType getSchemaType();
43  
44  		public abstract QName getPartElementName();
45  
46  		public abstract SchemaGlobalElement getPartElement();
47  
48  		public PartType getPartType()
49  		{
50  			return PartType.CONTENT;
51  		}
52  	}
53  
54  	public abstract static class AttachmentPart implements MessagePart
55  	{
56  		public abstract String[] getContentTypes();
57  
58  		public abstract boolean isAnonymous();
59  
60  		public PartType getPartType()
61  		{
62  			return PartType.ATTACHMENT;
63  		}
64  	}
65  
66  	public abstract static class HeaderPart extends ContentPart
67  	{
68  		public PartType getPartType()
69  		{
70  			return PartType.HEADER;
71  		}
72  	}
73  
74  	public abstract static class ParameterPart extends ContentPart
75  	{
76  		public PartType getPartType()
77  		{
78  			return PartType.PARAMETER;
79  		}
80  	}
81  
82  	public abstract static class FaultPart extends ContentPart
83  	{
84  		public PartType getPartType()
85  		{
86  			return PartType.FAULT;
87  		}
88  
89  		public abstract Part[] getWsdlParts();
90  	}
91  }