001    /**
002     * Copyright (c) 2000-present 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 JavadocMethodImpl extends JavadocMethod {
023    
024            public JavadocMethodImpl(
025                    String servletContextName, String comment, Method method,
026                    String[] parameterComments, String returnComment,
027                    String[] throwsComments) {
028    
029                    super(servletContextName, comment);
030    
031                    _method = method;
032                    _parameterComments = parameterComments;
033                    _returnComment = returnComment;
034                    _throwsComments = throwsComments;
035            }
036    
037            @Override
038            public Method getMethod() {
039                    return _method;
040            }
041    
042            @Override
043            public String getParameterComment(int index) {
044                    if (_parameterComments == null) {
045                            return null;
046                    }
047    
048                    return _parameterComments[index];
049            }
050    
051            @Override
052            public String getReturnComment() {
053                    return _returnComment;
054            }
055    
056            @Override
057            public String getThrowsComment(int index) {
058                    if (_throwsComments == null) {
059                            return null;
060                    }
061    
062                    return _throwsComments[index];
063            }
064    
065            private final Method _method;
066            private final String[] _parameterComments;
067            private final String _returnComment;
068            private final String[] _throwsComments;
069    
070    }