Class TableLocaleSource
java.lang.Object
org.javarosa.core.services.locale.TableLocaleSource
- All Implemented Interfaces:
LocaleDataSource,Externalizable
public class TableLocaleSource extends Object implements LocaleDataSource
- Author:
- Clayton Sims
-
Constructor Summary
Constructors Constructor Description TableLocaleSource()TableLocaleSource(OrderedMap<String,String> localeData) -
Method Summary
Modifier and Type Method Description booleanequals(Object o)OrderedMap<String,String>getLocalizedText()booleanhasMapping(String textID)Determine whether a locale has a mapping for a given text handle.voidreadExternal(DataInputStream in, PrototypeFactory pf)voidsetLocaleMapping(String textID, String text)Set a text mapping for a single text handle for a given locale.voidwriteExternal(DataOutputStream out)
-
Constructor Details
-
TableLocaleSource
public TableLocaleSource() -
TableLocaleSource
-
-
Method Details
-
setLocaleMapping
Set a text mapping for a single text handle for a given locale.- Parameters:
textID- Text handle. Must not be null. Need not be previously defined for this locale.text- Localized text for this text handle and locale. Will overwrite any previous mapping, if one existed. If null, will remove any previous mapping for this text handle, if one existed.- Throws:
UnregisteredLocaleException- If locale is not defined or null.NullPointerException- if textID is null
-
hasMapping
Determine whether a locale has a mapping for a given text handle. Only tests the specified locale and form; does not fallback to any default locale or text form.- Parameters:
textID- Text handle.- Returns:
- True if a mapping exists for the text handle in the given locale.
- Throws:
UnregisteredLocaleException- If locale is not defined.
-
equals
-
getLocalizedText
- Specified by:
getLocalizedTextin interfaceLocaleDataSource
-
readExternal
public void readExternal(DataInputStream in, PrototypeFactory pf) throws IOException, DeserializationException- Specified by:
readExternalin interfaceExternalizable- Throws:
IOExceptionDeserializationException
-
writeExternal
- Specified by:
writeExternalin interfaceExternalizable- Throws:
IOException
-