com.thoughtworks.paranamer
Class JavadocParanamer

java.lang.Object
  extended by com.thoughtworks.paranamer.JavadocParanamer
All Implemented Interfaces:
Paranamer

public class JavadocParanamer
extends Object
implements Paranamer

Accesses Javadocs to extract parameter names. Supports:-

Author:
Samuel Halliday

Nested Class Summary
protected static class JavadocParanamer.DirJavadocProvider
           
protected static interface JavadocParanamer.JavadocProvider
           
protected static class JavadocParanamer.UrlJavadocProvider
           
protected static class JavadocParanamer.ZipJavadocProvider
           
 
Field Summary
 
Fields inherited from interface com.thoughtworks.paranamer.Paranamer
EMPTY_NAMES
 
Constructor Summary
JavadocParanamer(File archiveOrDirectory)
           
JavadocParanamer(URL url)
           
 
Method Summary
protected static String getCanonicalName(Class<?> klass)
           
protected static String getJavadocFilename(Member member)
           
 String[] lookupParameterNames(AccessibleObject accessible)
          Lookup the parameter names of a given method.
 String[] lookupParameterNames(AccessibleObject accessible, boolean throwExceptionIfMissing)
          Lookup the parameter names of a given method.
protected static String streamToString(InputStream input)
           
protected static InputStream urlToStream(URL url)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JavadocParanamer

public JavadocParanamer(File archiveOrDirectory)
                 throws IOException
Parameters:
archiveOrDirectory - either a zip archive or base directory of Javadocs.
Throws:
FileNotFoundException - if the parameter or package-list cannot be found.
IOException

JavadocParanamer

public JavadocParanamer(URL url)
                 throws IOException
Parameters:
url - base URL of the JavaDocs
Throws:
FileNotFoundException - if the url does not have a /package-list
IOException
Method Detail

lookupParameterNames

public String[] lookupParameterNames(AccessibleObject accessible)
Description copied from interface: Paranamer
Lookup the parameter names of a given method.

Specified by:
lookupParameterNames in interface Paranamer
Parameters:
accessible - the Method or Constructor for which the parameter names are looked up.
Returns:
A list of the parameter names.

lookupParameterNames

public String[] lookupParameterNames(AccessibleObject accessible,
                                     boolean throwExceptionIfMissing)
Description copied from interface: Paranamer
Lookup the parameter names of a given method.

Specified by:
lookupParameterNames in interface Paranamer
Parameters:
accessible - the Method or Constructor for which the parameter names are looked up.
throwExceptionIfMissing - whether to throw an exception if no Paranamer data found (versus return null).
Returns:
A list of the parameter names.

getJavadocFilename

protected static String getJavadocFilename(Member member)

getCanonicalName

protected static String getCanonicalName(Class<?> klass)

streamToString

protected static String streamToString(InputStream input)
                                throws IOException
Throws:
IOException

urlToStream

protected static InputStream urlToStream(URL url)
                                  throws IOException
Throws:
IOException


Copyright © 2007-2013. All Rights Reserved.