File tree Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -97,11 +97,27 @@ Retrieving values is simple:
9797``` java
9898p. get(" port" ); // Returns "8080"
9999p. getProperty(" port" ); // Also returns "8080"
100- p. getComment(" port" ) // Returns ["Port number to", "use for the server"]
100+ p. getComment(" port" ) // Returns ["# Port number to", "# use for the server"]
101101```
102102
103103### Comments
104104
105+ Just like with the original ` Properties ` implementation, lines starting with a
106+ ` # ` or a ` ! ` are considered comments. Consecutive comments lines that start
107+ with the same comment character and have no other lines in between (not even
108+ empty lines) are considered a single multi-line comment.
109+
110+ ``` properties
111+ # A single comment line
112+
113+ ! A multi-line comment
114+ ! spanning two lines
115+
116+ # This is actually a single comment line
117+ ! And this is a single comment line too
118+ two =Second value
119+ ```
120+
105121Comments are considered either "free" or "attached", which you could see as either being
106122just part of the file or attached to a property. For example:
107123
@@ -110,7 +126,7 @@ just part of the file or attached to a property. For example:
110126
111127one =First value (that has no comment)
112128
113- # Another free comment
129+ ! Another free comment
114130
115131# An attached comment
116132two =Second value
You can’t perform that action at this time.
0 commit comments