Class PropertiesConfigurationLayout.PropertyLayoutData

java.lang.Object
org.apache.commons.configuration2.PropertiesConfigurationLayout.PropertyLayoutData
All Implemented Interfaces:
Cloneable
Enclosing class:
PropertiesConfigurationLayout

static class PropertiesConfigurationLayout.PropertyLayoutData extends Object implements Cloneable
A helper class for storing all layout related information for a configuration property.
  • Field Details

    • comment

      private StringBuffer comment
      Stores the comment for the property.
    • separator

      private 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.
  • Constructor Details

    • PropertyLayoutData

      public PropertyLayoutData()
      Creates a new instance of PropertyLayoutData.
  • Method Details

    • getBlancLines

      @Deprecated public int getBlancLines()
      Deprecated.
      Use {#link getBlankLines()}.
      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
    • setBlancLines

      @Deprecated public void setBlancLines(int blankLines)
      Deprecated.
      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
    • isSingleLine

      public boolean isSingleLine()
      Returns the single line flag.
      Returns:
      the single line flag
    • setSingleLine

      public void setSingleLine(boolean singleLine)
      Sets the single line flag.
      Parameters:
      singleLine - the single line flag
    • addComment

      public void addComment(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
    • setComment

      public void setComment(String s)
      Sets the comment for this property.
      Parameters:
      s - the new comment (can be null)
    • getComment

      public 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 String getSeparator()
      Gets the separator that was used for this property.
      Returns:
      the property separator
    • setSeparator

      public void setSeparator(String separator)
      Sets the separator to be used for the represented property.
      Parameters:
      separator - the property separator
    • clone

      Creates a copy of this object.
      Overrides:
      clone in class Object
      Returns:
      the copy