01: /*
02: * soapUI, copyright (C) 2004-2007 eviware.com
03: *
04: * soapUI is free software; you can redistribute it and/or modify it under the
05: * terms of version 2.1 of the GNU Lesser General Public License as published by
06: * the Free Software Foundation.
07: *
08: * soapUI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
09: * 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: /**
21: * A message part in a Request
22: *
23: * @author ole.matzura
24: */
25:
26: public interface MessagePart {
27: public String getName();
28:
29: public String getDescription();
30:
31: public PartType getPartType();
32:
33: public enum PartType {
34: HEADER, CONTENT, ATTACHMENT, FAULT
35: };
36:
37: public abstract static class ContentPart implements MessagePart {
38: public abstract SchemaType getSchemaType();
39:
40: public abstract QName getPartElement();
41:
42: public PartType getPartType() {
43: return PartType.CONTENT;
44: }
45: }
46:
47: public abstract static class AttachmentPart implements MessagePart {
48: public abstract String[] getContentTypes();
49:
50: public abstract boolean isAnonymous();
51:
52: public PartType getPartType() {
53: return PartType.ATTACHMENT;
54: }
55: }
56:
57: public abstract static class HeaderPart extends ContentPart {
58: public abstract SchemaType getSchemaType();
59:
60: public PartType getPartType() {
61: return PartType.HEADER;
62: }
63: }
64:
65: public abstract static class FaultPart extends ContentPart {
66: public abstract SchemaType getSchemaType();
67:
68: public PartType getPartType() {
69: return PartType.FAULT;
70: }
71:
72: public abstract Part[] getWsdlParts();
73: }
74: }
|