Package generic.theme

Class AbstractThemeReader.Section

java.lang.Object
generic.theme.AbstractThemeReader.Section
Enclosing class:
AbstractThemeReader

protected class AbstractThemeReader.Section extends Object
Represents all the value found in a section of the theme properties file. Sections are defined by a line containing just "[section name]"
  • Constructor Details

    • Section

      public Section(String sectionName, int lineNumber)
      Constructor sectionName the section name
      Parameters:
      sectionName - the name of this section
      lineNumber - the line number in the file where the section started
  • Method Details

    • remove

      public void remove(String key)
      Removes the value with the given key
      Parameters:
      key - the key to remove
    • getValue

      public String getValue(String key)
      Returns the value for the given key.
      Parameters:
      key - the key to get a value for
      Returns:
      the value for the given key
    • getKeys

      public Set<String> getKeys()
      Returns a set of all keys in the section
      Returns:
      a set of all keys in the section
    • getLineNumber

      public int getLineNumber(String key)
      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

      public String getName()
      Returns the name of this section
      Returns:
      the name of this section
    • add

      public void add(String line, int lineNumber)
      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/parsed
      lineNumber - the line number in the file for this line