Skip to content

Package: EMFFormsLocalizationService

EMFFormsLocalizationService

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2011-2015 EclipseSource Muenchen GmbH and others.
3: *
4: * All rights reserved. This program and the accompanying materials
5: * are made available under the terms of the Eclipse Public License 2.0
6: * which accompanies this distribution, and is available at
7: * https://www.eclipse.org/legal/epl-2.0/
8: *
9: * SPDX-License-Identifier: EPL-2.0
10: *
11: * Contributors:
12: * Eugen Neufeld - initial API and implementation
13: ******************************************************************************/
14: package org.eclipse.emfforms.spi.localization;
15:
16: import org.osgi.framework.Bundle;
17:
18: /**
19: * Service for retrieving translated Strings.
20: *
21: * @author Eugen Neufeld
22: *
23: */
24: public interface EMFFormsLocalizationService {
25:         /**
26:          * Return the String for the provided key.
27:          *
28:          * @param bundle The bundle which provides the translated strings
29:          * @param key The key of the string
30:          * @return The translated key
31:          */
32:         String getString(Bundle bundle, String key);
33:
34:         /**
35:          * Return the String for the provided key.
36:          *
37:          * @param clazz The class which needs a translated string
38:          * @param key The key of the string
39:          * @return The translated key
40:          */
41:         String getString(Class<?> clazz, String key);
42:
43:         /**
44:          * Return whether the key in question is available.
45:          *
46:          * @param bundle The bundle in which to search for the key
47:          * @param key The key to search
48:          * @return true if the key is available in the bundle, false otherwise
49:          */
50:         boolean hasKey(Bundle bundle, String key);
51:
52:         /**
53:          * Return whether the key in question is available.
54:          *
55:          * @param clazz The class in whose bundle to search for the key
56:          * @param key The key to search
57:          * @return true if the key is available in the bundle, false otherwise
58:          */
59:         boolean hasKey(Class<?> clazz, String key);
60: }