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  /***
    21   * A message part in a Request
    22   *
    23   * @author ole.matzura
    24   */
    25
    26  public interface MessagePart
    27  {
    28  	public String getName();
    29
    30  	public String getDescription();
    31
    32  	public PartType getPartType();
    33
    34  	public enum PartType { HEADER, CONTENT, ATTACHMENT, FAULT };
    35
    36  	public abstract static class ContentPart implements MessagePart
    37  	{
    38  		public abstract SchemaType getSchemaType();
    39
    40  		public abstract QName getPartElement();
    41
    42  		public PartType getPartType()
    43  		{
    44  			return PartType.CONTENT;
    45  		}
    46  	}
    47
    48  	public abstract static class AttachmentPart implements MessagePart
    49  	{
    50  		public abstract String[] getContentTypes();
    51
    52  		public abstract boolean isAnonymous();
    53
    54  		public PartType getPartType()
    55  		{
    56  			return PartType.ATTACHMENT;
    57  		}
    58  	}
    59
    60  	public abstract static class HeaderPart extends ContentPart
    61  	{
    62  		public abstract SchemaType getSchemaType();
    63
    64  		public PartType getPartType()
    65  		{
    66  			return PartType.HEADER;
    67  		}
    68  	}
    69
    70  	public abstract static class FaultPart extends ContentPart
    71  	{
    72  		public abstract SchemaType getSchemaType();
    73
    74  		public PartType getPartType()
    75  		{
    76  			return PartType.FAULT;
    77  		}
    78
    79  		public abstract Part [] getWsdlParts();
    80  	}
    81  }