01: /*
02: * JBoss, Home of Professional Open Source.
03: * Copyright 2006, Red Hat Middleware LLC, and individual contributors
04: * as indicated by the @author tags. See the copyright.txt file in the
05: * distribution for a full listing of individual contributors.
06: *
07: * This is free software; you can redistribute it and/or modify it
08: * under the terms of the GNU Lesser General Public License as
09: * published by the Free Software Foundation; either version 2.1 of
10: * the License, or (at your option) any later version.
11: *
12: * This software is distributed in the hope that it will be useful,
13: * but WITHOUT ANY WARRANTY; without even the implied warranty of
14: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15: * Lesser General Public License for more details.
16: *
17: * You should have received a copy of the GNU Lesser General Public
18: * License along with this software; if not, write to the Free
19: * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20: * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21: */
22: package org.jboss.iiop.rmi;
23:
24: import org.omg.CORBA.ParameterMode;
25:
26: /**
27: * Parameter analysis.
28: *
29: * Routines here are conforming to the "Java(TM) Language to IDL Mapping
30: * Specification", version 1.1 (01-06-07).
31: *
32: * @author <a href="mailto:osh@sparre.dk">Ole Husgaard</a>
33: * @version $Revision: 57194 $
34: */
35: public class ParameterAnalysis extends AbstractAnalysis {
36: // Constants -----------------------------------------------------
37:
38: // Attributes ----------------------------------------------------
39:
40: private static final org.jboss.logging.Logger logger = org.jboss.logging.Logger
41: .getLogger(ParameterAnalysis.class);
42:
43: // Static --------------------------------------------------------
44:
45: // Constructors --------------------------------------------------
46:
47: ParameterAnalysis(String javaName, Class cls)
48: throws RMIIIOPViolationException {
49: super (javaName);
50:
51: this .cls = cls;
52:
53: typeIDLName = Util.getTypeIDLName(cls);
54: logger.debug("ParameterAnalysis(): cls=[" + cls.getName()
55: + "] typeIDLName=[" + typeIDLName + "].");
56: }
57:
58: // Public --------------------------------------------------------
59:
60: /**
61: * Return my attribute mode.
62: */
63: public ParameterMode getMode() {
64: // 1.3.4.4 says we always map to IDL "in" parameters.
65: return ParameterMode.PARAM_IN;
66: }
67:
68: /**
69: * Return my Java type.
70: */
71: public Class getCls() {
72: return cls;
73: }
74:
75: /**
76: * Return the IDL type name of my parameter type.
77: */
78: public String getTypeIDLName() {
79: logger.debug("ParameterAnalysis.getTypeIDLName(): cls=["
80: + cls.getName() + "] typeIDLName=[" + typeIDLName
81: + "].");
82: return typeIDLName;
83: }
84:
85: // Protected -----------------------------------------------------
86:
87: // Private -------------------------------------------------------
88:
89: /**
90: * Java type of parameter.
91: */
92: private Class cls;
93:
94: /**
95: * IDL type name of parameter type.
96: */
97: private String typeIDLName;
98:
99: }
|