/[cashew-s-editor]/cashews/src/nongnu/cashews/language/grounding/MessagePart.java
ViewVC logotype

Diff of /cashews/src/nongnu/cashews/language/grounding/MessagePart.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by gnu_andrew, Wed May 4 11:05:53 2005 UTC revision 1.2 by gnu_andrew, Sat May 7 21:22:53 2005 UTC
# Line 22  Line 22 
22  package nongnu.cashews.language.grounding;  package nongnu.cashews.language.grounding;
23    
24  import java.net.URI;  import java.net.URI;
25    import java.net.URISyntaxException;
26    
27  import javax.xml.namespace.QName;  import javax.xml.namespace.QName;
28    
29    import nongnu.cashews.xml.Xmlizable;
30    
31  /**  /**
32   * Represents a single part of a SOAP message body.  This specifies   * Represents a single part of a SOAP message body.  This specifies
33   * the name and type of the element.   * the name and type of the element.
# Line 32  import javax.xml.namespace.QName; Line 35  import javax.xml.namespace.QName;
35   * @author Andrew John Hughes (gnu_andrew@member.fsf.org)   * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
36   */   */
37  public class MessagePart  public class MessagePart
38      implements Xmlizable
39  {  {
40    
41    /**    /**
# Line 55  public class MessagePart Line 59  public class MessagePart
59     */     */
60    private QName type;    private QName type;
61    
62      /**
63       * Constructs a new message part with the specified URI.
64       *
65       * @param uri the uri of this message part.
66       * @throws URISyntaxException if the supplied name is not a valid URI.
67       */
68      public MessagePart(String uri)
69        throws URISyntaxException
70      {
71        setURI(uri);
72      }
73    
74      /**
75       * Constructs a new message part with the specified URI.
76       *
77       * @param uri the uri of this message part.
78       */
79      public MessagePart(URI uri)
80      {
81        setURI(uri);
82      }
83    
84      /**
85       * Sets the URI of this message part to that specified.
86       *
87       * @param uri the uri of this message part.
88       * @throws URISyntaxException if the supplied name is not a valid URI.
89       */
90      public void setURI(String uri)
91        throws URISyntaxException
92      {
93        setURI(new URI(uri));
94      }
95    
96      /**
97       * Sets the URI of this message part to that specified.
98       *
99       * @param uri the uri of this message part.
100       */
101      public void setURI(URI uri)
102      {
103        this.uri = uri;
104      }
105    
106      /**
107       * Sets the qualified name of this SOAP message to that constructed
108       * from the supplied namespace URI and local part.
109       *
110       * @param namespaceURI the namespace URI of this SOAP message's name.
111       * @param localPart the local part of this SOAP message's name.
112       */
113      public void setName(String namespaceURI, String localPart)
114      {
115        setName(new QName(namespaceURI, localPart));
116      }
117    
118      /**
119       * Sets the qualified name of this SOAP message to that constructed
120       * from the supplied namespace URI, local part and prefix.
121       *
122       * @param namespaceURI the namespace URI of this SOAP message's name.
123       * @param localPart the local part of this SOAP message's name.
124       * @param prefix the prefix of this SOAP message's name.
125       */
126      public void setName(String namespaceURI, String localPart, String prefix)
127      {
128        setName(new QName(namespaceURI, localPart, prefix));
129      }
130    
131      /**
132       * Sets the name of this SOAP message to that specified.
133       *
134       * @param name the name of this SOAP message.
135       */
136      public void setName(QName name)
137      {
138        this.name = name;
139      }
140    
141      /**
142       * Sets the type of this SOAP message to that constructed
143       * from the supplied namespace URI and local part.
144       *
145       * @param namespaceURI the namespace URI of this SOAP message's type.
146       * @param localPart the local part of this SOAP message's type.
147       */
148      public void setType(String namespaceURI, String localPart)
149      {
150        setType(new QName(namespaceURI, localPart));
151      }
152    
153      /**
154       * Sets the qualified type of this SOAP message to that constructed
155       * from the supplied namespace URI, local part and prefix.
156       *
157       * @param namespaceURI the namespace URI of this SOAP message's type.
158       * @param localPart the local part of this SOAP message's type.
159       * @param prefix the prefix of this SOAP message's type.
160       */
161      public void setType(String namespaceURI, String localPart, String prefix)
162      {
163        setType(new QName(namespaceURI, localPart, prefix));
164      }
165    
166      /**
167       * Sets the type of this SOAP message to that specified.
168       *
169       * @param type the type of this SOAP message.
170       */
171      public void setType(QName type)
172      {
173        this.type = type;
174      }
175    
176      /**
177       * Returns a <code>String</code> representation of this SOAP message.
178       *
179       * @return a textual representation.
180       */
181      public String toString()
182      {
183        return getClass().getName() +
184          "[uri=" +
185          uri +
186          ",name=" +
187          name +
188          ",type=" +
189          type +
190          "]";
191      }
192    
193      /**
194       * Returns "part" as the element name for XML serialization.
195       *
196       * @return <code>part</code>
197       */
198      public String getElementName()
199      {
200        return "part";
201      }
202    
203      /**
204       * Returns null as this class needs no further namespace declarations.
205       *
206       * @return <code>null</code>.
207       */
208      public QName[] getDeclaredNamespaces()
209      {
210        return null;
211      }
212    
213  }  }
214    

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26