Package org.ini4j
Class IniPreferences
- Object
-
- Preferences
-
- AbstractPreferences
-
- IniPreferences
-
public class IniPreferences extends AbstractPreferences
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
IniPreferences.SectionPreferences
-
Constructor Summary
Constructors Constructor Description IniPreferences(InputStream input)
Constructs a new preferences node based on newly loadedIni
instance.IniPreferences(Reader input)
Constructs a new preferences node based on newly loadedIni
instance.IniPreferences(URL input)
Constructs a new preferences node based on newly loadedIni
instance.IniPreferences(Ini ini)
Constructs a new preferences node on top ofIni
instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String[]
childrenNamesSpi()
Implements thechildrenNamesSpi
method as per the specification inAbstractPreferences.childrenNamesSpi()
.protected IniPreferences.SectionPreferences
childSpi(String name)
Implements thechildSpi
method as per the specification inAbstractPreferences.childSpi(String)
.protected void
flushSpi()
Implements theflushSpi
method as per the specification inAbstractPreferences.flushSpi()
.protected Ini
getIni()
Provide access to underlayingIni
implementation.protected String
getSpi(String key)
Implements thegetSpi
method as per the specification inAbstractPreferences.getSpi(String)
.protected String[]
keysSpi()
Implements thekeysSpi
method as per the specification inAbstractPreferences.keysSpi()
.protected void
putSpi(String key, String value)
Implements theputSpi
method as per the specification inAbstractPreferences.putSpi(String,String)
.protected void
removeNodeSpi()
Implements theremoveNodeSpi
method as per the specification inAbstractPreferences.removeNodeSpi()
.protected void
removeSpi(String key)
Implements theremoveSpi
method as per the specification inAbstractPreferences.removeSpi(String)
.protected void
syncSpi()
Implements thesyncSpi
method as per the specification inAbstractPreferences.syncSpi()
.-
Methods inherited from class java.util.prefs.AbstractPreferences
absolutePath, addNodeChangeListener, addPreferenceChangeListener, cachedChildren, childrenNames, clear, exportNode, exportSubtree, flush, get, getBoolean, getByteArray, getChild, getDouble, getFloat, getInt, getLong, isRemoved, isUserNode, keys, name, node, nodeExists, parent, put, putBoolean, putByteArray, putDouble, putFloat, putInt, putLong, remove, removeNode, removeNodeChangeListener, removePreferenceChangeListener, sync, toString
-
-
-
-
Constructor Detail
-
IniPreferences
public IniPreferences(Ini ini)
Constructs a new preferences node on top ofIni
instance.- Parameters:
ini
- underlayingIni
instance
-
IniPreferences
public IniPreferences(Reader input) throws IOException, InvalidFileFormatException
Constructs a new preferences node based on newly loadedIni
instance. This is just a helper constructor, to make simpler constructingIniPreferences
directly fromReader
.- Parameters:
input
- theReader
containingIni
data- Throws:
IOException
- if an I/O error occuredInvalidFileFormatException
- ifIni
parsing error occured
-
IniPreferences
public IniPreferences(InputStream input) throws IOException, InvalidFileFormatException
Constructs a new preferences node based on newly loadedIni
instance. This is just a helper constructor, to make simpler constructingIniPreferences
directly fromInputStream
.- Parameters:
input
- theInputStream
containingIni
data- Throws:
IOException
- if an I/O error occuredInvalidFileFormatException
- ifIni
parsing error occured
-
IniPreferences
public IniPreferences(URL input) throws IOException, InvalidFileFormatException
Constructs a new preferences node based on newly loadedIni
instance. This is just a helper constructor, to make simpler constructingIniPreferences
directly fromURL
.- Parameters:
input
- theURL
containingIni
data- Throws:
IOException
- if an I/O error occuredInvalidFileFormatException
- ifIni
parsing error occured
-
-
Method Detail
-
getIni
protected Ini getIni()
Provide access to underlayingIni
implementation.- Returns:
Ini
implementation
-
getSpi
protected String getSpi(String key) throws UnsupportedOperationException
Implements thegetSpi
method as per the specification inAbstractPreferences.getSpi(String)
. This implementation doesn't support this operation, so allways throws UnsupportedOperationException.- Specified by:
getSpi
in classAbstractPreferences
- Parameters:
key
- key to getvalue for- Returns:
- if the value associated with the specified key at this preference node, or null if there is no association for this key, or the association cannot be determined at this time.
- Throws:
UnsupportedOperationException
- this implementation allways throws this exception
-
childrenNamesSpi
protected String[] childrenNamesSpi() throws BackingStoreException
Implements thechildrenNamesSpi
method as per the specification inAbstractPreferences.childrenNamesSpi()
.- Specified by:
childrenNamesSpi
in classAbstractPreferences
- Returns:
- an array containing the names of the children of this preference node.
- Throws:
BackingStoreException
- if this operation cannot be completed due to a failure in the backing store, or inability to communicate with it.
-
childSpi
protected IniPreferences.SectionPreferences childSpi(String name)
Implements thechildSpi
method as per the specification inAbstractPreferences.childSpi(String)
.- Specified by:
childSpi
in classAbstractPreferences
- Parameters:
name
- child name- Returns:
- child node
-
flushSpi
protected void flushSpi() throws BackingStoreException
Implements theflushSpi
method as per the specification inAbstractPreferences.flushSpi()
. This implementation does nothing.- Specified by:
flushSpi
in classAbstractPreferences
- Throws:
BackingStoreException
- if this operation cannot be completed due to a failure in the backing store, or inability to communicate with it.
-
keysSpi
protected String[] keysSpi() throws BackingStoreException
Implements thekeysSpi
method as per the specification inAbstractPreferences.keysSpi()
. This implementation allways return an empty array.- Specified by:
keysSpi
in classAbstractPreferences
- Returns:
- an empty array.
- Throws:
BackingStoreException
- if this operation cannot be completed due to a failure in the backing store, or inability to communicate with it.
-
putSpi
protected void putSpi(String key, String value) throws UnsupportedOperationException
Implements theputSpi
method as per the specification inAbstractPreferences.putSpi(String,String)
. This implementation doesn;t support this operation, so allways throws UnsupportedOperationException.- Specified by:
putSpi
in classAbstractPreferences
- Parameters:
key
- key to set value forvalue
- new value for key- Throws:
UnsupportedOperationException
- this implementation allways throws this exception
-
removeNodeSpi
protected void removeNodeSpi() throws BackingStoreException, UnsupportedOperationException
Implements theremoveNodeSpi
method as per the specification inAbstractPreferences.removeNodeSpi()
. This implementation doesn;t support this operation, so allways throws UnsupportedOperationException.- Specified by:
removeNodeSpi
in classAbstractPreferences
- Throws:
UnsupportedOperationException
- this implementation allways throws this exceptionBackingStoreException
- this implementation never throws this exception
-
removeSpi
protected void removeSpi(String key) throws UnsupportedOperationException
Implements theremoveSpi
method as per the specification inAbstractPreferences.removeSpi(String)
.- Specified by:
removeSpi
in classAbstractPreferences
- Parameters:
key
- key to remove- Throws:
UnsupportedOperationException
- this implementation allways throws this exception
-
syncSpi
protected void syncSpi() throws BackingStoreException
Implements thesyncSpi
method as per the specification inAbstractPreferences.syncSpi()
. This implementation does nothing.- Specified by:
syncSpi
in classAbstractPreferences
- Throws:
BackingStoreException
- if this operation cannot be completed due to a failure in the backing store, or inability to communicate with it.
-
-