xref: /AOO41X/main/odk/examples/DevelopersGuide/Components/JavaComponent/TestComponentA.java (revision 34dd1e2512dbacb6a9a7e4c7f17b9296daa8eff3) !
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 import com.sun.star.lang.XMultiServiceFactory;
24 import com.sun.star.lib.uno.helper.WeakBase;
25 import com.sun.star.lang.XServiceInfo;
26 import com.sun.star.test.XSomethingA;
27 import com.sun.star.uno.Type;
28 
29 // TestComponentA use the implementation helper WeakBase
30 public class TestComponentA extends WeakBase implements XServiceInfo, XSomethingA {
31     static final String __serviceName= "com.sun.star.test.SomethingA";
32 
33     static byte[] _implementationId;
34 
TestComponentA()35     public TestComponentA() {
36     }
37 
38     // XSomethingA
methodOne(String val)39     public String methodOne(String val) {
40         return val;
41     }
42 
43     //XServiceInfo
getImplementationName( )44     public String getImplementationName(  ) {
45         return getClass().getName();
46     }
47     // XServiceInfo
supportsService( String serviceName )48     public boolean supportsService( /*IN*/String serviceName ) {
49         if ( serviceName.equals( __serviceName))
50             return true;
51         return false;
52     }
53     //XServiceInfo
getSupportedServiceNames( )54     public String[] getSupportedServiceNames(  ) {
55         String[] retValue= new String[0];
56         retValue[0]= __serviceName;
57         return retValue;
58     }
59 
60 }
61