1
14
15 package com.liferay.portal.sharepoint;
16
17 import com.liferay.portal.kernel.util.StringBundler;
18 import com.liferay.portal.kernel.util.StringPool;
19
20
25 public class Property implements ResponseElement {
26
27 public static final String OPEN_PARAGRAPH = "<p>";
28
29 public Property(String key, String value) {
30 this(key, value, true);
31 }
32
33 public Property(String key, ResponseElement value) {
34 this(key, StringPool.NEW_LINE + value.parse(), false);
35 }
36
37 public Property(String key, String value, boolean newLine) {
38 _key = key;
39 _value = value;
40 _newLine = newLine;
41 }
42
43 public String parse() {
44 StringBundler sb = new StringBundler(5);
45
46 sb.append(OPEN_PARAGRAPH);
47 sb.append(_key);
48 sb.append(StringPool.EQUAL);
49 sb.append(_value);
50
51 if (_newLine) {
52 sb.append(StringPool.NEW_LINE);
53 }
54
55 return sb.toString();
56 }
57
58 private String _key;
59 private String _value;
60 private boolean _newLine;
61
62 }