Class SourceCodeProcessor
- java.lang.Object
-
- ch.sahits.game.openpatrician.app.documentation.SourceCodeProcessor
-
public class SourceCodeProcessor extends java.lang.Object
Utitlity class that allows to add a TreePathScanner into the compilation process to extract information from the abstract syntax tree.- Author:
- Andi Hotz, (c) Sahits GmbH, 2018 Created on Apr 07, 2018
-
-
Constructor Summary
Constructors Constructor Description SourceCodeProcessor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getSourcePath(java.lang.Class<?> clazz)
Calculate the the source path of the java file based on the class file.boolean
processSourceFile(java.lang.Class<?> clazz, com.sun.source.util.TreePathScanner scanner)
Process the class with the supplied scanner.boolean
processSourceFile(java.lang.String path, javax.annotation.processing.AbstractProcessor processor)
Process a java source file with the processor.private java.lang.String
toSourceFilePath(java.lang.Class<?> clazz)
-
-
-
Method Detail
-
processSourceFile
public boolean processSourceFile(java.lang.String path, javax.annotation.processing.AbstractProcessor processor)
Process a java source file with the processor.- Parameters:
path
- of the java source fileprocessor
- to be used- Returns:
- true when the processing failed
-
processSourceFile
public boolean processSourceFile(java.lang.Class<?> clazz, com.sun.source.util.TreePathScanner scanner)
Process the class with the supplied scanner.- Parameters:
clazz
- class to be processed.scanner
- used for the processing- Returns:
- true if the processing failed.
-
getSourcePath
public java.lang.String getSourcePath(java.lang.Class<?> clazz)
Calculate the the source path of the java file based on the class file.- Parameters:
clazz
- for which to calculate the path of the source file- Returns:
- path to the java source file or null, if the file does not exist or an error occurred.
-
toSourceFilePath
private java.lang.String toSourceFilePath(java.lang.Class<?> clazz)
-
-