Class JavaDocExtractor
- java.lang.Object
-
- org.codehaus.mojo.jaxb2.schemageneration.postprocessing.javadoc.JavaDocExtractor
-
public class JavaDocExtractor extends Object
The schemagen tool operates on compiled bytecode, where JavaDoc comments are not present. However, the javadoc documentation present in java source files is required within the generated XSD to increase usability and produce an XSD which does not loose out on important usage information.
The JavaDocExtractor is used as a post processor after creating the XSDs within the compilation unit, and injects XSD annotations into the appropriate XSD elements or types.
- Since:
- 2.0
- Author:
- Lennart Jörelid, jGuru Europe AB
-
-
Constructor Summary
Constructors Constructor Description JavaDocExtractor(org.apache.maven.plugin.logging.Log log)
Creates a JavaDocExtractor wrapping the supplied Maven Log.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JavaDocExtractor
addSourceFiles(List<File> sourceCodeFiles)
Adds the supplied sourceCodeFiles for processing by this JavaDocExtractor.JavaDocExtractor
addSourceURLs(List<URL> sourceCodeURLs)
Adds the supplied sourceCodeFiles for processing by this JavaDocExtractor.SearchableDocumentation
process()
Processes all supplied Java source Files and URLs to extract JavaDocData for all ClassLocations from which JavaDoc has been collected.void
setEncoding(String encoding)
Assigns the encoding of the underlyingJavaProjectBuilder
.
-
-
-
Method Detail
-
setEncoding
public void setEncoding(String encoding)
Assigns the encoding of the underlyingJavaProjectBuilder
.- Parameters:
encoding
- The non-empty encoding to be set into the underlyingJavaProjectBuilder
.
-
addSourceFiles
public JavaDocExtractor addSourceFiles(List<File> sourceCodeFiles) throws IllegalArgumentException
Adds the supplied sourceCodeFiles for processing by this JavaDocExtractor.- Parameters:
sourceCodeFiles
- The non-null List of source code files to add.- Returns:
- This JavaDocExtractor, for call chaining.
- Throws:
IllegalArgumentException
- If any of the given sourceCodeFiles could not be read properly.
-
addSourceURLs
public JavaDocExtractor addSourceURLs(List<URL> sourceCodeURLs) throws IllegalArgumentException
Adds the supplied sourceCodeFiles for processing by this JavaDocExtractor.- Parameters:
sourceCodeURLs
- The non-null List of source code URLs to add.- Returns:
- This JavaDocExtractor, for call chaining.
- Throws:
IllegalArgumentException
- If any of the given sourceCodeURLs could not be read properly.
-
process
public SearchableDocumentation process()
Processes all supplied Java source Files and URLs to extract JavaDocData for all ClassLocations from which JavaDoc has been collected.- Returns:
- A SearchableDocumentation relating SortableLocations and their paths to harvested JavaDocData.
-
-