01: /*
02: * MessageImpl.java
03: *
04: * Created on September 24, 2006, 5:34 PM
05: *
06: * To change this template, choose Tools | Template Manager
07: * and open the template in the editor.
08: */
09:
10: package org.netbeans.modules.e2e.wsdl;
11:
12: import java.util.ArrayList;
13: import java.util.Collections;
14: import java.util.HashMap;
15: import java.util.List;
16: import java.util.Map;
17: import org.netbeans.modules.e2e.api.wsdl.Message;
18: import org.netbeans.modules.e2e.api.wsdl.Part;
19:
20: /**
21: *
22: * @author Michal Skvor
23: */
24: public class MessageImpl implements Message {
25:
26: private String name;
27: private Map<String, Part> parts;
28:
29: /** Creates a new instance of MessageImpl */
30: public MessageImpl(String name) {
31: parts = new HashMap();
32: this .name = name;
33: }
34:
35: public void setName(String name) {
36: this .name = name;
37: }
38:
39: public String getName() {
40: return name;
41: }
42:
43: public void addPart(Part part) {
44: parts.put(part.getName(), part);
45: }
46:
47: public Part getPart(String name) {
48: return parts.get(name);
49: }
50:
51: public List<Part> getParts() {
52: return Collections.unmodifiableList(new ArrayList(parts
53: .values()));
54: }
55: }
|