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  * Created on 2005
25  *	by Christian Schmidt
26  */
27 package com.sun.star.tooling.converter;
28 
29 import java.util.Map;
30 
31 /**
32  * Helps resolving restype descriptors used outside the tool to
33  * restype descriptors used by this  tool
34  *
35  * @author Christian Schmidt 2005
36  *
37  */
38 public class ResTypeResolver {
39     final static String[] inFields={"Text","QText","HText","Title"};
40     final static String[] outFields={"res","res-quickhelp","res-help","res-title"};
41     final static Map internKeys=new ExtMap(inFields,outFields);
42     final static Map externKeys=new ExtMap(outFields,inFields);
43 
44     /**
45      * Get the intern key depending to the given extern key
46      *
47      * @param externKey the externKey {"res","res-quickhelp","res-help","title"}
48      * @return the depending intern key
49      */
getInternKey(String externKey)50     public static String getInternKey(String externKey){
51         return (String)externKeys.get(externKey);
52     }
53 
54     /**
55      * Get the extern key to the given intern key
56      *
57      * @param internKey the internal key
58      * @return the external key
59      */
getExternKey(String internKey)60     public static String getExternKey(String internKey){
61         return (String)internKeys.get(internKey);
62     }
63 
64 }
65