01: /* *****************************************************************************
02: * LZSOAPMessage.java
03: * ****************************************************************************/
04:
05: /* J_LZ_COPYRIGHT_BEGIN *******************************************************
06: * Copyright 2001-2007 Laszlo Systems, Inc. All Rights Reserved. *
07: * Use is subject to license terms. *
08: * J_LZ_COPYRIGHT_END *********************************************************/
09:
10: package org.openlaszlo.remote.json.soap;
11:
12: import java.util.*;
13:
14: public class LZSOAPMessage {
15: String mName;
16: String mMode;
17: String mUse = null;
18: Set mPartNames = null;
19: List mParts = null;
20:
21: /**
22: * @param name name of soap message.
23: * @param type one of input or output.
24: */
25: public LZSOAPMessage(String name, String mode) {
26: mName = name;
27: mMode = mode;
28: }
29:
30: public String getName() {
31: return mName;
32: }
33:
34: public String getMode() {
35: return mMode;
36: }
37:
38: public void setUse(String use) {
39: mUse = use;
40: }
41:
42: public String getUse() {
43: return mUse;
44: }
45:
46: public Set getPartNames() {
47: return mPartNames;
48: }
49:
50: public void setPartNames(Set partNames) {
51: mPartNames = partNames;
52: }
53:
54: public void setParts(List parts) {
55: mParts = parts;
56: }
57:
58: public List getParts() {
59: return mParts;
60: }
61:
62: void toPartXML(StringBuffer sb) {
63: sb.append("<parts>");
64: if (mParts != null) {
65: for (int i = 0; i < mParts.size(); i++) {
66: LZSOAPPart part = (LZSOAPPart) mParts.get(i);
67: part.toXML(sb);
68: }
69: }
70: sb.append("</parts>");
71: }
72:
73: public void toXML(StringBuffer sb) {
74: sb.append("<message").append(" name=\"").append(mName).append(
75: "\"").append(" mode=\"").append(mMode).append("\"")
76: .append(" use=\"").append(mUse).append("\"").append(
77: " partnames=\"").append(mPartNames)
78: .append("\"").append(">");
79: toPartXML(sb);
80: sb.append("</message>");
81: }
82: }
|