component-installation-plugin / com.intershop.gradle.component.installation.filter / FormattedProperties

FormattedProperties

class FormattedProperties : Properties

This class provides a properties class that also take comments into account. E.g. Properties are commented without removing them directly.

Constructors

<init>

FormattedProperties(propertiesFile: File)FormattedProperties()

initialize an empty properties class

Functions

addComment

fun addComment(key: String, comment: Array<String>): Unit

Add a commented property without a value.

fun addComment(key: String, value: String?, comment: Array<String>, changeValue: Boolean): Unit

Add a commented property with a value.

load

fun load(originalReader: Reader): Unit

This method load this properties from the given input stream.

put

fun put(aKey: String, aValue: String): Any?

This method sets a property with a given name to the given value.

fun put(key: Any, value: Any?): Any?

Maps the specified key to the specified value in this hashtable. Neither the key nor the value can be null.

remove

fun remove(key: Any): Any?
fun remove(aKey: Any, comment: Array<String>): Any?

Removes the mapping specified by the given key from the property set.

setProperty

fun setProperty(aKey: String, aValue: String): Any?

This method sets the property with the given key to the given value.

fun setProperty(aKey: String, aValue: String, comments: Array<String>): Any?

This method sets a new property with the given key to the given value with an comment.

store

fun store(outputFile: File): Unit
fun store(originalWriter: Writer, vararg aHeader: String): Unit

This method save this properties to the given output stream.

Companion Object Properties

CHAR_COLON

const val CHAR_COLON: Char

The colon character.

CHAR_EQUAL_SIGN

const val CHAR_EQUAL_SIGN: Char

The equal sign character.