001
014
015 package com.liferay.portal.sharepoint;
016
017 import com.liferay.portal.kernel.util.StringBundler;
018 import com.liferay.portal.kernel.util.StringPool;
019
020
023 public class Property implements ResponseElement {
024
025 public static final String OPEN_PARAGRAPH = "<p>";
026
027 public Property(String key, ResponseElement value) {
028 this(key, StringPool.NEW_LINE + value.parse(), false);
029 }
030
031 public Property(String key, String value) {
032 this(key, value, true);
033 }
034
035 public Property(String key, String value, boolean newLine) {
036 _key = key;
037 _value = value;
038 _newLine = newLine;
039 }
040
041 @Override
042 public String parse() {
043 StringBundler sb = new StringBundler(5);
044
045 sb.append(OPEN_PARAGRAPH);
046 sb.append(_key);
047 sb.append(StringPool.EQUAL);
048 sb.append(_value);
049
050 if (_newLine) {
051 sb.append(StringPool.NEW_LINE);
052 }
053
054 return sb.toString();
055 }
056
057 private String _key;
058 private boolean _newLine;
059 private String _value;
060
061 }