1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 package com.sun.star.lib.uno.typedesc;
25 
26 import com.sun.star.uno.IMethodDescription;
27 import com.sun.star.uno.ITypeDescription;
28 import java.lang.reflect.Method;
29 
30 public final class MethodDescription implements IMethodDescription {
MethodDescription( String name, int index, boolean oneway, ITypeDescription[] inSignature, ITypeDescription[] outSignature, ITypeDescription returnSignature, Method method)31     MethodDescription(
32         String name, int index, boolean oneway, ITypeDescription[] inSignature,
33         ITypeDescription[] outSignature, ITypeDescription returnSignature,
34         Method method)
35     {
36         this.name = name;
37         this.index = index;
38         this.oneway = oneway;
39         this.inSignature = inSignature;
40         this.outSignature = outSignature;
41         this.returnSignature = returnSignature;
42         this.method = method;
43     }
44 
MethodDescription(IMethodDescription other, int index)45     MethodDescription(IMethodDescription other, int index) {
46         this(
47             other.getName(), index, other.isOneway(), other.getInSignature(),
48             other.getOutSignature(), other.getReturnSignature(),
49             other.getMethod());
50     }
51 
getName()52     public String getName() {
53         return name;
54     }
55 
isUnsigned()56     public boolean isUnsigned() {
57         return MemberDescriptionHelper.isUnsigned(returnSignature);
58     }
59 
isAny()60     public boolean isAny() {
61         return MemberDescriptionHelper.isAny(returnSignature);
62     }
63 
isInterface()64     public boolean isInterface() {
65         return MemberDescriptionHelper.isInterface(returnSignature);
66     }
67 
getIndex()68     public int getIndex() {
69         return index;
70     }
71 
isOneway()72     public boolean isOneway() {
73         return oneway;
74     }
75 
isConst()76     public boolean isConst() {
77         return false;
78     }
79 
getInSignature()80     public ITypeDescription[] getInSignature() {
81         return inSignature;
82     }
83 
getOutSignature()84     public ITypeDescription[] getOutSignature() {
85         return outSignature;
86     }
87 
getReturnSignature()88     public ITypeDescription getReturnSignature() {
89         return returnSignature;
90     }
91 
getMethod()92     public Method getMethod() {
93         return method;
94     }
95 
96     public static final int ID_QUERY_INTERFACE = 0;
97     public static final int ID_ACQUIRE = 1;
98     public static final int ID_RELEASE = 2;
99 
100     private final String name;
101     private final int index;
102     private final boolean oneway;
103     private final ITypeDescription[] inSignature;
104     private final ITypeDescription[] outSignature;
105     private final ITypeDescription returnSignature;
106     private final Method method;
107 }
108