View Javadoc

1    /****************************************************************************
2    * Copyright (c) 2005, 2006, 2007, 2008, 2009 Imola Informatica.
3    * All rights reserved. This program and the accompanying materials
4    * are made available under the terms of the LGPL License v2.1
5    * which accompanies this distribution, and is available at
6    * http://www.gnu.org/licenses/lgpl.html
7    ****************************************************************************/
8   package it.imolinfo.jbi4corba.webservice.generator;
9   
10  import java.util.ArrayList;
11  import java.util.List;
12  import org.apache.commons.lang.builder.EqualsBuilder;
13  import org.apache.commons.lang.builder.ReflectionToStringBuilder;
14  
15  /**
16   * This class provides the object representation of a CORBA param.
17   * 
18   * If the parameter is an Holder, this object mantains: <br/>
19   * <li> The original holder type (for example <code>org.omg.CORBA.StringHolder</code>)
20   * <li> The holder value type (for example <code>java.lang.String</code>) 
21   * <li> The changed holder type (for example <code>javax.xml.ws.Holder<String></code>) as actual type.
22   * 
23   */
24  public class Param {
25  
26    /**
27     * The name of the method.
28     */
29    private String name = null;
30  
31    /**
32     * The (actual) data type name
33     */
34    private String typeName = null;
35    
36    /**
37     * The (actual) data type 
38     */
39    private Class type = null;
40    
41    /**
42     * True if it's an holder.
43     */
44    boolean isHolder = false;
45    
46    /**
47     * The (original) holder type 
48     */
49    private Class holderType = null;
50    
51    /**
52     * The holder value type
53     */
54    private Class holderValueType = null;
55    
56    /**
57     * True it the parameter is an array
58     */
59    private boolean isArray = false;
60    
61    /**
62     * If an array, the array dimension (NOT THE SIZE!!!!).
63     */
64    private int arrayDimension = 0;
65    
66    /**
67     * True if the parameter is aprimitive type.
68     */
69    private boolean isPrimitive = false;
70    
71  
72    /**
73     * Default constructor.
74     */
75    public Param() {}
76    
77    /**
78     * @return  This object as String.
79     */
80    public String toString() {
81      return ReflectionToStringBuilder.toString(this);
82    }
83  
84    /**
85     * @param   obj   An object.
86     * @return  true, if this object is equal to the obj parameter.
87     */
88    public boolean equals(Object obj) {
89        return EqualsBuilder.reflectionEquals(this, obj);
90    }
91  
92    public String getName() {
93        return name;
94    }
95  
96    public void setName(String paramName) {
97        this.name = paramName;
98    }
99  
100   public String getTypeName() {
101       return typeName;
102   }
103 
104   public void setTypeName(String paramType) {
105       this.typeName = paramType;
106   }
107 
108   public boolean isHolder() {
109       return isHolder;
110   }
111 
112   public void setHolder(boolean isHolder) {
113       this.isHolder = isHolder;
114   }
115 
116   public Class getHolderType() {
117       return holderType;
118   }
119 
120   public void setHolderType(Class holderType) {
121       this.holderType = holderType;
122   }
123 
124   public Class getHolderValueType() {
125       return holderValueType;
126   }
127 
128   public void setHolderValueType(Class holderValueType) {
129       this.holderValueType = holderValueType;
130   }
131 
132   public Class getType() {
133       return type;
134   }
135 
136   public void setType(Class type) {
137       this.type = type;
138   }
139 
140   public boolean isArray() {
141       return isArray;
142   }
143 
144   public void setArray(boolean isArray) {
145       this.isArray = isArray;
146   }
147 
148   public int getArrayDimension() {
149       return arrayDimension;
150   }
151 
152   public void setArrayDimension(int arrayDimension) {
153       this.arrayDimension = arrayDimension;
154   }
155 
156   public boolean isPrimitive() {
157       return isPrimitive;
158   }
159 
160   public void setPrimitive(boolean isPrimitive) {
161       this.isPrimitive = isPrimitive;
162   }  
163 
164 }