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.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    }