public class IniFile
extends java.lang.Object
Constructor and Description |
---|
IniFile()
Create a new IniFile object
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getProperty(java.lang.String section,
java.lang.String property)
Gets a named property from a specific section
|
IniSection |
getSection(java.lang.String name)
Gets the IniSection with the given name
|
java.util.List |
getSections()
Gets the List of IniSection objects contained in this IniFile
|
void |
read(java.io.Reader reader)
Reads from a Reader into the current IniFile instance.
|
void |
removeProperty(java.lang.String section,
java.lang.String property)
Removes a property from a section.
|
void |
removeSection(java.lang.String name)
Removes an entire section from the IniFile
|
void |
setProperty(java.lang.String section,
java.lang.String property,
java.lang.String value)
Sets the value of a property in a given section.
|
void |
setSection(IniSection section)
Sets an IniSection object.
|
void |
write(java.io.Writer writer)
Writes the current iniFile instance to a Writer object for
serialization.
|
public java.util.List getSections()
public IniSection getSection(java.lang.String name)
name
- the name of the sectionpublic void setSection(IniSection section)
section
- The section to set.public void removeSection(java.lang.String name)
name
- The name of the section to removepublic java.lang.String getProperty(java.lang.String section, java.lang.String property)
section
- The name of the sectionproperty
- The name of the propertypublic void setProperty(java.lang.String section, java.lang.String property, java.lang.String value)
section
- The name of the sectionproperty
- The name of the propertyvalue
- The value of the propertypublic void removeProperty(java.lang.String section, java.lang.String property)
section
- The name of the sectionproperty
- The name of the propertypublic void write(java.io.Writer writer) throws java.io.IOException
writer
- The writer to write tojava.io.IOException
public void read(java.io.Reader reader) throws java.io.IOException
reader
- The reader to read from.java.io.IOException