Class PropertiesConfigurationLayout.PropertyLayoutData
java.lang.Object
org.apache.commons.configuration2.PropertiesConfigurationLayout.PropertyLayoutData
- All Implemented Interfaces:
Cloneable
- Enclosing class:
PropertiesConfigurationLayout
A helper class for storing all layout related information for a configuration property.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate int
Stores the number of blank lines before this property.private StringBuffer
Stores the comment for the property.private String
The separator to be used for this property.private boolean
Stores the single line property. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addComment
(String s) Adds a comment for this property.clone()
Creates a copy of this object.int
Deprecated.int
Gets the number of blank lines before this property.Gets the comment for this property.Gets the separator that was used for this property.boolean
Returns the single line flag.void
setBlancLines
(int blankLines) Deprecated.UsesetBlankLines(int)
.void
setBlankLines
(int blankLines) Sets the number of properties before this property.void
setComment
(String s) Sets the comment for this property.void
setSeparator
(String separator) Sets the separator to be used for the represented property.void
setSingleLine
(boolean singleLine) Sets the single line flag.
-
Field Details
-
comment
Stores the comment for the property. -
separator
The separator to be used for this property. -
blankLines
private int blankLinesStores the number of blank lines before this property. -
singleLine
private boolean singleLineStores the single line property.
-
-
Constructor Details
-
PropertyLayoutData
public PropertyLayoutData()Creates a new instance ofPropertyLayoutData
.
-
-
Method Details
-
addComment
Adds a comment for this property. If already a comment exists, the new comment is added (separated by a newline).- Parameters:
s
- the comment to add
-
clone
Creates a copy of this object. -
getBlancLines
Deprecated.Use {#linkgetBlankLines()
}.Gets the number of blank lines before this property.- Returns:
- the number of blank lines before this property
-
getBlankLines
public int getBlankLines()Gets the number of blank lines before this property.- Returns:
- the number of blank lines before this property
- Since:
- 2.8.0
-
getComment
Gets the comment for this property. The comment is returned as it is, without processing of comment characters.- Returns:
- the comment (can be null)
-
getSeparator
Gets the separator that was used for this property.- Returns:
- the property separator
-
isSingleLine
public boolean isSingleLine()Returns the single line flag.- Returns:
- the single line flag
-
setBlancLines
Deprecated.UsesetBlankLines(int)
.Sets the number of properties before this property.- Parameters:
blankLines
- the number of properties before this property
-
setBlankLines
public void setBlankLines(int blankLines) Sets the number of properties before this property.- Parameters:
blankLines
- the number of properties before this property- Since:
- 2.8.0
-
setComment
Sets the comment for this property.- Parameters:
s
- the new comment (can be null)
-
setSeparator
Sets the separator to be used for the represented property.- Parameters:
separator
- the property separator
-
setSingleLine
public void setSingleLine(boolean singleLine) Sets the single line flag.- Parameters:
singleLine
- the single line flag
-
getBlankLines()
}.