001    /**
002     * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
014    
015    package com.liferay.portal.parsers.bbcode;
016    
017    import com.liferay.portal.kernel.util.StringUtil;
018    
019    /**
020     * @author Iliyan Peychev
021     */
022    public class BBCodeToken {
023    
024            public BBCodeToken(String endTag) {
025                    _endTag = endTag;
026            }
027    
028            public BBCodeToken(
029                    String startTag, String attribute, String endTag, int start, int end) {
030    
031                    _startTag = StringUtil.lowerCase(startTag);
032                    _attribute = attribute;
033                    _endTag = StringUtil.lowerCase(endTag);
034                    _start = start;
035                    _end = end;
036            }
037    
038            public String getAttribute() {
039                    return _attribute;
040            }
041    
042            public int getEnd() {
043                    return _end;
044            }
045    
046            public String getEndTag() {
047                    return _endTag;
048            }
049    
050            public int getStart() {
051                    return _start;
052            }
053    
054            public String getStartTag() {
055                    return _startTag;
056            }
057    
058            public void setAttribute(String attribute) {
059                    _attribute = attribute;
060            }
061    
062            private String _attribute;
063            private int _end;
064            private String _endTag;
065            private int _start;
066            private String _startTag;
067    
068    }