public abstract class AbstractNamesTranslator extends java.lang.Object implements NamesTranslator, Persistent
Modifier and Type | Class and Description |
---|---|
protected static class |
AbstractNamesTranslator.SimpleList |
protected static class |
AbstractNamesTranslator.SimpleMap |
Modifier and Type | Field and Description |
---|---|
protected AbstractNamesTranslator.SimpleList |
sourceNames |
Modifier | Constructor and Description |
---|---|
protected |
AbstractNamesTranslator() |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
build() |
NamesTranslator |
clone()
Creates a copy of the object.
|
java.lang.String |
getSource(int index)
Returns the source name corresponding to the translation indicated
in the "index" parameter.
|
java.util.List<java.lang.String> |
getSourceNames()
Return the list of source names.
|
java.lang.String[] |
getTranslatedNamesAsArray()
Return the list of translated names as a String array.
|
boolean |
isValid(java.lang.String name)
Returns true if the name passed as a parameter does not collide
with any of the existing translations.
|
void |
loadFromState(PersistentState state)
Set the state of the object from the state passed as parameter.
|
static void |
registerPersistence() |
void |
saveToState(PersistentState state)
Saves the internal state of the object on the provided
PersistentState object.
|
void |
setSourceNames(java.lang.Iterable<java.lang.String> names)
Assign the list of source names and generate the list of translations from them.
|
void |
setSourceNames(java.lang.Iterable objs,
java.util.function.Function<java.lang.Object,java.lang.String> name_getter)
Assign the list of source names and generate the list of translations from them.
|
void |
setSourceNames(java.lang.String[] names)
Assign the list of source names and generate the list of translations from them.
|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addSource, clear, createBaseTranslator, createDummyTranslator, createTrimTranslator, getAllTranslations, getSource, getSuggestion, getTranslatedNames, getTranslation, getTranslation, hasDuplicateSources, rebuild, setTranslation, setTranslation, updateSourceNames, updateSourceNames, updateSourceNames
cloneQuietly, cloneQuietly
protected AbstractNamesTranslator.SimpleList sourceNames
public NamesTranslator clone() throws java.lang.CloneNotSupportedException
Cloneable
clone
in interface NamesTranslator
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
- if the instance of the object cannot
be cloned. As this is extending Cloneable
so its sure
it implements it, so this exception may be used for problems on specific
object instances.Object#clone()}.
public java.util.List<java.lang.String> getSourceNames()
NamesTranslator
getSourceNames
in interface NamesTranslator
public void setSourceNames(java.lang.Iterable<java.lang.String> names)
NamesTranslator
setSourceNames
in interface NamesTranslator
public void setSourceNames(java.lang.String[] names)
NamesTranslator
setSourceNames
in interface NamesTranslator
public void setSourceNames(java.lang.Iterable objs, java.util.function.Function<java.lang.Object,java.lang.String> name_getter)
NamesTranslator
setSourceNames
in interface NamesTranslator
public java.lang.String[] getTranslatedNamesAsArray()
NamesTranslator
getTranslatedNamesAsArray
in interface NamesTranslator
public java.lang.String getSource(int index)
NamesTranslator
getSource
in interface NamesTranslator
public boolean isValid(java.lang.String name)
NamesTranslator
isValid
in interface NamesTranslator
protected abstract void build()
public static void registerPersistence()
public void saveToState(PersistentState state) throws PersistenceException
Persistent
saveToState
in interface Persistent
PersistenceException
public void loadFromState(PersistentState state) throws PersistenceException
Persistent
loadFromState
in interface Persistent
PersistenceException