Class PropertiesConfigurationLayout.PropertyLayoutData
- java.lang.Object
-
- org.apache.commons.configuration2.PropertiesConfigurationLayout.PropertyLayoutData
-
- All Implemented Interfaces:
java.lang.Cloneable
- Enclosing class:
- PropertiesConfigurationLayout
static class PropertiesConfigurationLayout.PropertyLayoutData extends java.lang.Object implements java.lang.Cloneable
A helper class for storing all layout related information for a configuration property.
-
-
Field Summary
Fields Modifier and Type Field Description private int
blankLines
Stores the number of blank lines before this property.private java.lang.StringBuffer
comment
Stores the comment for the property.private java.lang.String
separator
The separator to be used for this property.private boolean
singleLine
Stores the single line property.
-
Constructor Summary
Constructors Constructor Description PropertyLayoutData()
Creates a new instance ofPropertyLayoutData
.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addComment(java.lang.String s)
Adds a comment for this property.PropertiesConfigurationLayout.PropertyLayoutData
clone()
Creates a copy of this object.int
getBlancLines()
Deprecated.Use {#linkgetBlankLines()
}.int
getBlankLines()
Gets the number of blank lines before this property.java.lang.String
getComment()
Gets the comment for this property.java.lang.String
getSeparator()
Gets the separator that was used for this property.boolean
isSingleLine()
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(java.lang.String s)
Sets the comment for this property.void
setSeparator(java.lang.String separator)
Sets the separator to be used for the represented property.void
setSingleLine(boolean singleLine)
Sets the single line flag.
-
-
-
Field Detail
-
comment
private java.lang.StringBuffer comment
Stores the comment for the property.
-
separator
private java.lang.String separator
The separator to be used for this property.
-
blankLines
private int blankLines
Stores the number of blank lines before this property.
-
singleLine
private boolean singleLine
Stores the single line property.
-
-
Method Detail
-
addComment
public void addComment(java.lang.String s)
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
public PropertiesConfigurationLayout.PropertyLayoutData clone()
Creates a copy of this object.- Overrides:
clone
in classjava.lang.Object
- Returns:
- the copy
-
getBlancLines
@Deprecated public int 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
public java.lang.String 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
public java.lang.String 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 public void setBlancLines(int blankLines)
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
public void setComment(java.lang.String s)
Sets the comment for this property.- Parameters:
s
- the new comment (can be null)
-
setSeparator
public void setSeparator(java.lang.String separator)
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
-
-