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.creole.ast.link.interwiki;
016    
017    import com.liferay.portal.parsers.creole.ast.link.LinkNode;
018    import com.liferay.portal.parsers.creole.visitor.ASTVisitor;
019    
020    /**
021     * @author Miguel Pastor
022     */
023    public abstract class InterwikiLinkNode extends LinkNode {
024    
025            public InterwikiLinkNode() {
026            }
027    
028            public InterwikiLinkNode(int token) {
029                    super(token);
030            }
031    
032            public InterwikiLinkNode(int token, String title) {
033                    this(token);
034    
035                    _title = title;
036            }
037    
038            public InterwikiLinkNode(String title) {
039                    _title = title;
040            }
041    
042            @Override
043            public abstract void accept(ASTVisitor astVisitor);
044    
045            public String getTitle() {
046                    return _title;
047            }
048    
049            public String getURL() {
050                    return getBaseURL() + _title;
051            }
052    
053            public void setTitle(String title) {
054                    _title = title;
055            }
056    
057            protected abstract String getBaseURL();
058    
059            private String _title;
060    
061    }