Package org.apache.juneau.config.event
Class ConfigEvent
java.lang.Object
org.apache.juneau.config.event.ConfigEvent
Represents a change to a config.
-
Method Summary
Modifier and TypeMethodDescriptionReturns the entry comment.Returns the configuration name.getKey()Returns the entry name.Returns the modifiers on this entry.Returns the section or entry lines.Returns the section name.getType()Returns the event type.getValue()Returns the entry value.static ConfigEventremoveEntry(String config, String section, String key) Removes a value from a configuration.static ConfigEventremoveSection(String config, String section) Removes a section from the config.static ConfigEventsetEntry(String config, String section, String key, String value, String modifiers, String comment, List<String> prelines) Sets or replaces a value in a configuration.static ConfigEventsetSection(String config, String section, List<String> prelines) Adds a new empty section to the config.toString()
-
Method Details
-
setEntry
public static ConfigEvent setEntry(String config, String section, String key, String value, String modifiers, String comment, List<String> prelines) Sets or replaces a value in a configuration.- Parameters:
config- The configuration name.section- The section name.
Must not benull .key- The entry name.
Must not benull .value- The entry value.
Can benull to remove an entry.comment- Optional comment string to add on the same line as the entry.modifiers- Optional entry modifiers.prelines- Comment lines that occur before this entry.
Must not benull .- Returns:
- A new
ConfigEventobject.
-
removeEntry
Removes a value from a configuration.- Parameters:
config- The configuration name.section- The section name.
Must not benull .key- The entry name.
Must not benull .- Returns:
- A new
ConfigEventobject.
-
setSection
Adds a new empty section to the config.- Parameters:
config- The configuration name.section- The section name.prelines- Comment lines that occur before this section.
Must not benull .- Returns:
- A new
ConfigEventobject.
-
removeSection
Removes a section from the config.- Parameters:
config- The configuration name.section- The section name.- Returns:
- A new
ConfigEventobject.
-
getType
Returns the event type.- Returns:
- The event type.
-
getConfig
Returns the configuration name.- Returns:
- The configuration name.
-
getSection
Returns the section name.- Returns:
- The section name.
-
getKey
Returns the entry name.- Returns:
- The entry name.
-
getValue
Returns the entry value.- Returns:
- The entry value.
-
getComment
Returns the entry comment.- Returns:
- The entry comment.
-
getPreLines
Returns the section or entry lines.- Returns:
- The section or entry lines.
-
getModifiers
Returns the modifiers on this entry.- Returns:
- The modifier characters.
Nevernull .
-
toString
-