Package org.ini4j
Class IniPreferences
- java.lang.Object
-
- java.util.prefs.Preferences
-
- java.util.prefs.AbstractPreferences
-
- org.ini4j.IniPreferences
-
public class IniPreferences extends java.util.prefs.AbstractPreferences
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
IniPreferences.SectionPreferences
-
Constructor Summary
Constructors Constructor Description IniPreferences(java.io.InputStream input)
Constructs a new preferences node based on newly loadedIni
instance.IniPreferences(java.io.Reader input)
Constructs a new preferences node based on newly loadedIni
instance.IniPreferences(java.net.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 java.lang.String[]
childrenNamesSpi()
Implements thechildrenNamesSpi
method as per the specification inAbstractPreferences.childrenNamesSpi()
.protected IniPreferences.SectionPreferences
childSpi(java.lang.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 java.lang.String
getSpi(java.lang.String key)
Implements thegetSpi
method as per the specification inAbstractPreferences.getSpi(String)
.protected java.lang.String[]
keysSpi()
Implements thekeysSpi
method as per the specification inAbstractPreferences.keysSpi()
.protected void
putSpi(java.lang.String key, java.lang.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(java.lang.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(java.io.Reader input) throws java.io.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:
java.io.IOException
- if an I/O error occuredInvalidFileFormatException
- ifIni
parsing error occured
-
IniPreferences
public IniPreferences(java.io.InputStream input) throws java.io.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:
java.io.IOException
- if an I/O error occuredInvalidFileFormatException
- ifIni
parsing error occured
-
IniPreferences
public IniPreferences(java.net.URL input) throws java.io.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:
java.io.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 java.lang.String getSpi(java.lang.String key) throws java.lang.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 classjava.util.prefs.AbstractPreferences
- 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:
java.lang.UnsupportedOperationException
- this implementation allways throws this exception
-
childrenNamesSpi
protected java.lang.String[] childrenNamesSpi() throws java.util.prefs.BackingStoreException
Implements thechildrenNamesSpi
method as per the specification inAbstractPreferences.childrenNamesSpi()
.- Specified by:
childrenNamesSpi
in classjava.util.prefs.AbstractPreferences
- Returns:
- an array containing the names of the children of this preference node.
- Throws:
java.util.prefs.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(java.lang.String name)
Implements thechildSpi
method as per the specification inAbstractPreferences.childSpi(String)
.- Specified by:
childSpi
in classjava.util.prefs.AbstractPreferences
- Parameters:
name
- child name- Returns:
- child node
-
flushSpi
protected void flushSpi() throws java.util.prefs.BackingStoreException
Implements theflushSpi
method as per the specification inAbstractPreferences.flushSpi()
. This implementation does nothing.- Specified by:
flushSpi
in classjava.util.prefs.AbstractPreferences
- Throws:
java.util.prefs.BackingStoreException
- if this operation cannot be completed due to a failure in the backing store, or inability to communicate with it.
-
keysSpi
protected java.lang.String[] keysSpi() throws java.util.prefs.BackingStoreException
Implements thekeysSpi
method as per the specification inAbstractPreferences.keysSpi()
. This implementation allways return an empty array.- Specified by:
keysSpi
in classjava.util.prefs.AbstractPreferences
- Returns:
- an empty array.
- Throws:
java.util.prefs.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(java.lang.String key, java.lang.String value) throws java.lang.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 classjava.util.prefs.AbstractPreferences
- Parameters:
key
- key to set value forvalue
- new value for key- Throws:
java.lang.UnsupportedOperationException
- this implementation allways throws this exception
-
removeNodeSpi
protected void removeNodeSpi() throws java.util.prefs.BackingStoreException, java.lang.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 classjava.util.prefs.AbstractPreferences
- Throws:
java.lang.UnsupportedOperationException
- this implementation allways throws this exceptionjava.util.prefs.BackingStoreException
- this implementation never throws this exception
-
removeSpi
protected void removeSpi(java.lang.String key) throws java.lang.UnsupportedOperationException
Implements theremoveSpi
method as per the specification inAbstractPreferences.removeSpi(String)
.- Specified by:
removeSpi
in classjava.util.prefs.AbstractPreferences
- Parameters:
key
- key to remove- Throws:
java.lang.UnsupportedOperationException
- this implementation allways throws this exception
-
syncSpi
protected void syncSpi() throws java.util.prefs.BackingStoreException
Implements thesyncSpi
method as per the specification inAbstractPreferences.syncSpi()
. This implementation does nothing.- Specified by:
syncSpi
in classjava.util.prefs.AbstractPreferences
- Throws:
java.util.prefs.BackingStoreException
- if this operation cannot be completed due to a failure in the backing store, or inability to communicate with it.
-
-