Package generic.theme
Class AbstractThemeReader.Section
java.lang.Object
generic.theme.AbstractThemeReader.Section
- Enclosing class:
AbstractThemeReader
Represents all the value found in a section of the theme properties file. Sections are
defined by a line containing just "[section name]"
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a raw line from the file to this section.getKeys()
Returns a set of all keys in the sectionint
Returns the line number in the file where this section began.int
getLineNumber
(String key) Returns the line number in the original file where the key was parsedgetName()
Returns the name of this sectionReturns the value for the given key.boolean
isEmpty()
Returns true if the section is empty.void
Removes the value with the given key
-
Constructor Details
-
Section
Constructor sectionName the section name- Parameters:
sectionName
- the name of this sectionlineNumber
- the line number in the file where the section started
-
-
Method Details
-
remove
Removes the value with the given key- Parameters:
key
- the key to remove
-
getValue
Returns the value for the given key.- Parameters:
key
- the key to get a value for- Returns:
- the value for the given key
-
getKeys
Returns a set of all keys in the section- Returns:
- a set of all keys in the section
-
getLineNumber
Returns the line number in the original file where the key was parsed- Parameters:
key
- the key to get a line number for- Returns:
- the line number in the original file where the key was parsed
-
isEmpty
public boolean isEmpty()Returns true if the section is empty.- Returns:
- true if the section is empty.
-
getLineNumber
public int getLineNumber()Returns the line number in the file where this section began.- Returns:
- the line number in the file where this section began.
-
getName
Returns the name of this section- Returns:
- the name of this section
-
add
Adds a raw line from the file to this section. The line will be parsed into a a key-value pair.- Parameters:
line
- the line to be added/parsedlineNumber
- the line number in the file for this line
-