1 package org.objectweb.celtix.tools.common.model; 2 3 import java.util.ArrayList ; 4 import java.util.Collections ; 5 import java.util.List ; 6 import java.util.logging.Logger ; 7 8 import com.sun.xml.bind.api.TypeReference; 9 10 import org.objectweb.celtix.common.i18n.Message; 11 import org.objectweb.celtix.common.logging.LogUtils; 12 import org.objectweb.celtix.tools.common.ToolException; 13 import org.objectweb.celtix.tools.common.model.JavaType.Style; 14 import org.objectweb.celtix.tools.processors.java2.JavaToWSDLProcessor; 15 public class WSDLParameter { 16 private static final Logger LOG = LogUtils.getL7dLogger(JavaToWSDLProcessor.class); 17 protected String name; 18 protected String type; 19 protected String className; 20 protected String targetNamespace; 21 protected final List <JavaParameter> parts = new ArrayList <JavaParameter>(); 22 private TypeReference typeRef; 23 private Style style; 24 private String pname; 25 26 public WSDLParameter() { 27 28 } 29 30 public WSDLParameter(String paraName, TypeReference ref, Style paraStyle) { 31 pname = paraName; 32 typeRef = ref; 33 style = paraStyle; 34 } 35 36 public void setName(String arg) { 37 this.pname = arg; 38 } 39 40 public void setClassName(String clzName) { 41 this.className = clzName; 42 } 43 44 public String getClassName() { 45 return this.className; 46 } 47 48 public void setTargetNamespace(String tns) { 49 this.targetNamespace = tns; 50 } 51 52 public String getTargetNamespace() { 53 return this.targetNamespace; 54 } 55 56 public Style getStyle() { 57 return this.style; 58 } 59 60 public void setStyle(Style s) { 61 this.style = s; 62 } 63 64 public String getName() { 65 return pname; 66 } 67 68 69 70 public void setTypeReference(TypeReference ref) { 71 this.typeRef = ref; 72 } 73 74 public TypeReference getTypeReference() { 75 return this.typeRef; 76 } 77 78 public boolean isWrapped() { 79 return true; 80 } 81 82 public List <JavaParameter> getChildren() { 83 return Collections.unmodifiableList(parts); 84 } 85 86 public void addChildren(JavaParameter jp) { 87 if (parts.contains(jp)) { 88 Message message = new Message("PART_ALREADY_EXIST", LOG, jp.getName()); 89 throw new ToolException(message); 90 } 91 parts.add(jp); 92 } 93 94 public JavaParameter removeChildren(int index) { 95 return parts.remove(index); 96 } 97 98 public void clear() { 99 parts.clear(); 100 } 101 102 103 } 104 | Popular Tags |