net.sf.antcontrib.inifile

Class IniSection

Implemented Interfaces:
IniPart

public class IniSection
extends java.lang.Object
implements IniPart

A section within an IniFile.
Author:
Matthew Inger

Constructor Summary

IniSection()
Default contructor, constructs an IniSectino with no name
IniSection(String name)
Constructs an IniSection with the given name

Method Summary

String
getName()
Gets the name of the section
List
getProperties()
Gets a list of all properties in this section
IniProperty
getProperty(String name)
Gets the property with the given name
void
removeProperty(String name)
Removes a property from this ection
void
setName(String name)
Sets the name of the section
void
setProperty(IniProperty property)
Sets a property, replacing the old value, if necessary.
void
write(Writer writer)
Write this part of the IniFile to a writer

Constructor Details

IniSection

public IniSection()
Default contructor, constructs an IniSectino with no name

IniSection

public IniSection(String name)
Constructs an IniSection with the given name
Parameters:
name - The name of the section

Method Details

getName

public String getName()
Gets the name of the section

getProperties

public List getProperties()
Gets a list of all properties in this section
Returns:
A List of IniProperty objects

getProperty

public IniProperty getProperty(String name)
Gets the property with the given name
Parameters:
name - The name of the property

removeProperty

public void removeProperty(String name)
Removes a property from this ection
Parameters:
name - The name of the property to remove

setName

public void setName(String name)
Sets the name of the section
Parameters:
name - The name of the section

setProperty

public void setProperty(IniProperty property)
Sets a property, replacing the old value, if necessary.
Parameters:
property - The property to set

write

public void write(Writer writer)
            throws IOException
Write this part of the IniFile to a writer
Specified by:
write in interface IniPart
Parameters:
writer - The writer to write to