001    /**
002     * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.tools.propertiesdoc;
016    
017    import com.liferay.portal.kernel.util.Validator;
018    
019    import java.util.Collections;
020    import java.util.List;
021    
022    /**
023     * @author Jesse Rao
024     * @author James Hinkey
025     */
026    public class PropertiesSection {
027    
028            public PropertiesSection(String text) {
029                    _text = text;
030            }
031    
032            public List<String> getComments() {
033                    return _comments;
034            }
035    
036            public String getDefaultProperties() {
037                    return _defaultProperties;
038            }
039    
040            public String getExampleProperties() {
041                    return _exampleProperties;
042            }
043    
044            public List<PropertyComment> getPropertyComments() {
045                    return _propertyComments;
046            }
047    
048            public String getText() {
049                    return _text;
050            }
051    
052            public String getTitle() {
053                    return _title;
054            }
055    
056            public boolean hasComments() {
057                    return !_comments.isEmpty();
058            }
059    
060            public boolean hasDefaultProperties() {
061                    return Validator.isNotNull(_defaultProperties);
062            }
063    
064            public boolean hasExampleProperties() {
065                    return Validator.isNotNull(_exampleProperties);
066            }
067    
068            public boolean hasPropertyComments() {
069                    return !_propertyComments.isEmpty();
070            }
071    
072            public boolean hasTitle() {
073                    return Validator.isNotNull(_title);
074            }
075    
076            public void setComments(List<String> comments) {
077                    _comments = comments;
078            }
079    
080            public void setDefaultProperties(String defaultProperties) {
081                    _defaultProperties = defaultProperties;
082            }
083    
084            public void setExampleProperties(String exampleProperties) {
085                    _exampleProperties = exampleProperties;
086            }
087    
088            public void setPropertyComments(List<PropertyComment> propertyComments) {
089                    _propertyComments = propertyComments;
090            }
091    
092            public void setTitle(String title) {
093                    _title = title;
094            }
095    
096            private List<String> _comments = Collections.emptyList();
097            private String _defaultProperties;
098            private String _exampleProperties;
099            private List<PropertyComment> _propertyComments = Collections.emptyList();
100            private final String _text;
101            private String _title;
102    
103    }