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.kernel.javadoc;
016    
017    import java.lang.reflect.Method;
018    
019    /**
020     * @author Igor Spasic
021     */
022    public class JavadocMethod extends BaseJavadoc {
023    
024            public JavadocMethod(Method method) {
025                    this(method, null);
026            }
027    
028            public JavadocMethod(Method method, String comment) {
029                    _method = method;
030    
031                    setComment(comment);
032            }
033    
034            public Method getMethod() {
035                    return _method;
036            }
037    
038            public String getParameterComment(int index) {
039                    if (_parameterComments == null) {
040                            return null;
041                    }
042    
043                    return _parameterComments[index];
044            }
045    
046            public String[] getParameterComments() {
047                    return _parameterComments;
048            }
049    
050            public String getReturnComment() {
051                    return _returnComment;
052            }
053    
054            public String getThrowsComment(int index) {
055                    if (_throwsComments == null) {
056                            return null;
057                    }
058    
059                    return _throwsComments[index];
060            }
061    
062            public String[] getThrowsComments() {
063                    return _throwsComments;
064            }
065    
066            public void setMethod(Method method) {
067                    _method = method;
068            }
069    
070            public void setParameterComments(String[] parameterComments) {
071                    _parameterComments = parameterComments;
072            }
073    
074            public void setReturnComment(String returnComment) {
075                    _returnComment = returnComment;
076            }
077    
078            public void setThrowsComments(String[] throwsComments) {
079                    _throwsComments = throwsComments;
080            }
081    
082            private Method _method;
083            private String[] _parameterComments;
084            private String _returnComment;
085            private String[] _throwsComments;
086    
087    }