|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Commentable
This interface states the methods for getting, setting and removing comments to and from an object.
This interface supports three types of comments:
A class that implements this interface is allowed to support or omit any of the comment types, and can omit a type by not implementing the set methods and returning null for the get methods of a particular comment type.
Field Summary | |
---|---|
static char |
COMMENT_SYMBOL
This single character defines the symbol used as the beginning of a comment in an ini file. |
Method Summary | |
---|---|
String |
getEndLineComment()
Returns the comment that comes after the object on the same line. |
String |
getPostComment()
Returns the comment that comes after the object. |
String |
getPreComment()
Returns the comment that comes before the object. |
void |
removeEndLineComment()
Removes an end line comment from the object. |
void |
removePostComment()
Removes a post-comment from the object. |
void |
removePreComment()
Removes a pre-comment from the object. |
void |
setEndLineComment(String comment)
Set the comment that comes after the object but on the same line. |
void |
setPostComment(String comment)
Set the comment that comes after the object. |
void |
setPreComment(String comment)
Set the comment that comes before the object. |
Field Detail |
---|
static final char COMMENT_SYMBOL
Method Detail |
---|
String getPreComment()
Returns the comment that comes before the object. If not such comment exists an empty string is returned.
String getEndLineComment()
Returns the comment that comes after the object on the same line. If not such comment exists an empty string is returned.
String getPostComment()
Returns the comment that comes after the object. If not such comment exists an empty string is returned.
void setPreComment(String comment)
Set the comment that comes before the object.
comment
- the text comment, if this value is null, then the comment
is set to an empty string.void setEndLineComment(String comment)
Set the comment that comes after the object but on the same line.
comment
- The text comment, if this value is null, then the comment
is set to an empty string.
IllegalArgumentException
- if the given string contains a new line
character (i.e. "\n").void setPostComment(String comment)
comment
- the text comment, if this value is null, then the comment
is set to an empty string.void removePreComment()
setPreComment("");
void removeEndLineComment()
setEndLineComment("");
void removePostComment()
setPostComment("");
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |