Package rife.bld.extension.propertyfile
Class PropertyFileOperation
java.lang.Object
rife.bld.operations.AbstractOperation<PropertyFileOperation>
rife.bld.extension.propertyfile.PropertyFileOperation
Creates or applies edits to a
Properties file.- Since:
- 1.0
- Author:
- Erik C. Thauvin
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclear()Marks the operation to clear all existing entries in the target properties file before applying further modifications.clear(boolean clear) Sets whether all existing entries in the target properties file should be cleared before applying further modifications.Sets the comment to be inserted at the top of thePropertiesfile.entries()Retrieves an unmodifiable view of the configured entries.Adds anentryto specify modifications to thepropertiesfile.voidexecute()Performs the modification(s) to thepropertiesfile.failOnWarning(boolean failOnWarning) Sets theexecutionto return a failure on any warnings.file()Retrieves the location of thePropertiesfile to be edited.Sets the location of thePropertiesfile to be edited.Sets the location of thePropertiesfile to be edited.Sets the location of thePropertiesfile to be edited.fromProject(BaseProject project) Creates a new operation.booleanisClear()Indicates whether all existing entries will be cleared before modifications are applied.booleanIndicates whether theexecutionwill return a failure on any warnings.Methods inherited from class rife.bld.operations.AbstractOperation
executeOnce, executeOnce, silent, silent, verbose, verbose
-
Constructor Details
-
PropertyFileOperation
public PropertyFileOperation()
-
-
Method Details
-
execute
Performs the modification(s) to thepropertiesfile.- Specified by:
executein classAbstractOperation<PropertyFileOperation>- Throws:
Exception
-
clear
Marks the operation to clear all existing entries in the target properties file before applying further modifications.- Returns:
- this instance
- See Also:
-
clear
Sets whether all existing entries in the target properties file should be cleared before applying further modifications. -
comment
Sets the comment to be inserted at the top of thePropertiesfile.- Parameters:
comment- the header comment; must not benull- Returns:
- this instance
- Throws:
NullPointerException- ifcommentisnull
-
entries
Retrieves an unmodifiable view of the configured entries.- Returns:
- the list of entries
-
entry
Adds anentryto specify modifications to thepropertiesfile.- Parameters:
entry- theentry- Returns:
- this instance
- Throws:
NullPointerException- ifentryisnull
-
failOnWarning
Sets theexecutionto return a failure on any warnings.- Parameters:
failOnWarning- if set totrue, the execution will fail on any warnings.- Returns:
- this instance
- See Also:
-
file
Sets the location of thePropertiesfile to be edited.- Parameters:
file- the file to be edited- Returns:
- this instance
- Throws:
NullPointerException- iffileisnull
-
file
Sets the location of thePropertiesfile to be edited.- Parameters:
file- the file to be edited- Returns:
- this instance
- Throws:
NullPointerException- iffileisnullIllegalArgumentException- iffileis empty
-
file
Retrieves the location of thePropertiesfile to be edited.- Returns:
- the properties file or
nullif not set
-
file
Sets the location of thePropertiesfile to be edited.- Parameters:
file- the file to be edited- Returns:
- this instance
- Throws:
NullPointerException- iffileisnull
-
fromProject
Creates a new operation.- Parameters:
project- the project- Returns:
- this instance
- Throws:
NullPointerException- ifprojectisnull
-
isClear
public boolean isClear()Indicates whether all existing entries will be cleared before modifications are applied.- Returns:
trueif existing entries will be cleared;falseotherwise- See Also:
-
isFailOnWarning
public boolean isFailOnWarning()Indicates whether theexecutionwill return a failure on any warnings.- Returns:
trueif the execution will fail on warnings;falseotherwise- See Also:
-