- java.lang.Object
-
- de.codecamp.messages.shared.bundle.BundleFile<F>
-
- Type Parameters:
F- the file reference
- All Implemented Interfaces:
Comparable<BundleFile<F>>
public class BundleFile<F> extends Object implements Comparable<BundleFile<F>>
Represents one file (i.e. one locale) of a message bundle.
-
-
Constructor Summary
Constructors Constructor Description BundleFile(FileSystemAdapter<?,F> fileSystem, F file, Charset encoding, MessageBundleManager.BundleFileCoordinates coordinates, String displayPath)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(BundleFile<F> o)voiddelete()protected voidensureLoaded()booleanexists()IntegerfindLineNumberOfKey(String messageKey)Map<String,Integer>findLineNumberOfKeys(Collection<String> messageKeys)StringgetBundleName()StringgetComment(String messageKey)StringgetDisplayPath()Set<String>getKeys()LocalegetLocale()FgetLocation()StringgetMessage(String messageKey)booleanhasMessage(String messageKey)booleanhasMessageKey(String messageKey)booleanisEmpty()booleanisMessageEmpty(String messageKey)booleanisReadOnly()booleanneedsSaving()booleanneedsSorting()StringremoveMessage(String messageKey)booleansave()booleansave(boolean force)voidsetComment(String messageKey, String comment)voidsetMessage(String messageKey, String message)
-
-
-
Constructor Detail
-
BundleFile
public BundleFile(FileSystemAdapter<?,F> fileSystem, F file, Charset encoding, MessageBundleManager.BundleFileCoordinates coordinates, String displayPath)
-
-
Method Detail
-
getLocation
public F getLocation()
-
getDisplayPath
public String getDisplayPath()
-
getBundleName
public String getBundleName()
-
getLocale
public Locale getLocale()
-
isReadOnly
public boolean isReadOnly()
-
isEmpty
public boolean isEmpty()
-
hasMessageKey
public boolean hasMessageKey(String messageKey)
-
isMessageEmpty
public boolean isMessageEmpty(String messageKey)
-
hasMessage
public boolean hasMessage(String messageKey)
-
findLineNumberOfKey
public Integer findLineNumberOfKey(String messageKey) throws BundleException
- Throws:
BundleException
-
findLineNumberOfKeys
public Map<String,Integer> findLineNumberOfKeys(Collection<String> messageKeys) throws BundleException
- Throws:
BundleException
-
exists
public boolean exists()
-
needsSaving
public boolean needsSaving()
-
needsSorting
public boolean needsSorting()
-
save
public boolean save() throws BundleException- Throws:
BundleException
-
save
public boolean save(boolean force) throws BundleException- Throws:
BundleException
-
ensureLoaded
protected void ensureLoaded() throws BundleException- Throws:
BundleException
-
delete
public void delete() throws BundleException- Throws:
BundleException
-
compareTo
public int compareTo(BundleFile<F> o)
- Specified by:
compareToin interfaceComparable<F>
-
-