001: /*
002: * DefinitionImpl.java
003: *
004: * Created on September 24, 2006, 6:07 PM
005: *
006: * To change this template, choose Tools | Template Manager
007: * and open the template in the editor.
008: */
009:
010: package org.netbeans.modules.e2e.wsdl;
011:
012: import java.util.Collections;
013: import java.util.HashMap;
014: import java.util.Map;
015: import org.netbeans.modules.e2e.api.schema.SchemaHolder;
016: import org.netbeans.modules.e2e.api.wsdl.Binding;
017: import org.netbeans.modules.e2e.api.wsdl.Definition;
018: import org.netbeans.modules.e2e.api.wsdl.Message;
019: import org.netbeans.modules.e2e.api.wsdl.PortType;
020: import org.netbeans.modules.e2e.api.wsdl.Service;
021:
022: /**
023: *
024: * @author Michal Skvor
025: */
026: public class DefinitionImpl implements Definition {
027:
028: private SchemaHolder schemaHolder;
029:
030: private Map<String, Binding> bindings = new HashMap<String, Binding>();
031: private Map<String, Message> messages = new HashMap<String, Message>();
032: private Map<String, Service> services = new HashMap<String, Service>();
033: private Map<String, PortType> portTypes = new HashMap<String, PortType>();
034:
035: private String documentation;
036:
037: private String targetNamespace;
038:
039: /** Creates a new instance of DefinitionImpl */
040: public DefinitionImpl() {
041: }
042:
043: public void setSchemaHolder(SchemaHolder schemaHolder) {
044: this .schemaHolder = schemaHolder;
045: }
046:
047: public SchemaHolder getSchemaHolder() {
048: return schemaHolder;
049: }
050:
051: public void addBinding(Binding binding) {
052: bindings.put(binding.getName(), binding);
053: }
054:
055: public Binding getBinding(String name) {
056: return bindings.get(name);
057: }
058:
059: public Map<String, Binding> getBindings() {
060: return Collections.unmodifiableMap(bindings);
061: }
062:
063: public void addMessage(Message message) {
064: messages.put(message.getName(), message);
065: }
066:
067: public Message getMessage(String name) {
068: return messages.get(name);
069: }
070:
071: public Map<String, Message> getMessages() {
072: return Collections.unmodifiableMap(messages);
073: }
074:
075: public void addService(Service service) {
076: services.put(service.getName(), service);
077: }
078:
079: public Service getService(String name) {
080: return services.get(name);
081: }
082:
083: public Map<String, Service> getServices() {
084: return Collections.unmodifiableMap(services);
085: }
086:
087: public void addPortType(PortType portType) {
088: portTypes.put(portType.getName(), portType);
089: }
090:
091: public PortType getPortType(String name) {
092: return portTypes.get(name);
093: }
094:
095: public Map<String, PortType> getPortTypes() {
096: return Collections.unmodifiableMap(portTypes);
097: }
098:
099: public void setDocumentation(String documentation) {
100: this .documentation = documentation;
101: }
102:
103: public String getDocumentation() {
104: return documentation;
105: }
106:
107: public void setTargetNamespace(String targetNamespace) {
108: this .targetNamespace = targetNamespace;
109: }
110:
111: public String getTargetNamespace() {
112: return targetNamespace;
113: }
114: }
|