com.codepulsar.nils.api.adapter.Adapter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of nils-core Show documentation
Show all versions of nils-core Show documentation
The core NILS library - A Java NLS library (aka national language support, localisation, internationalisation, i18n, l10n).
The newest version!
package com.codepulsar.nils.api.adapter;
import java.util.Optional;
import com.codepulsar.nils.adapter.rb.ResourceBundleAdapter;
import com.codepulsar.nils.api.NilsConfig;
/**
* An Adapter provides an implementation for a specific kind to access localization
* information (i. e. from ResourceBundles).
*
* An adapter can have further configuration provided by an implementation of the {@link
* NilsConfig} interface.
*
*
NILS can so easily extended by implementing an own Adapter for an own purpose.
*
*
A default implementation is the {@link ResourceBundleAdapter} using Java's
* ResourceBundle
to resolve a translation.
*
* @see NilsConfig
* @see ResourceBundleAdapter
*/
public interface Adapter {
/**
* Resolve the translation value from the adapter implementation.
*
* @param key The translation key
* @return The value or an empty Optional
*/
Optional getTranslation(String key);
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy