Package org.jboss.logging.processor.apt
Class ReportFileGenerator
- java.lang.Object
-
- org.jboss.logging.processor.apt.AbstractGenerator
-
- org.jboss.logging.processor.apt.ReportFileGenerator
-
@SupportedOptions({"org.jboss.logging.tools.report.type","org.jboss.logging.tools.report.path","org.jboss.logging.tools.report.title"}) public class ReportFileGenerator extends AbstractGenerator
Generates reports for logging interfaces and message bundles.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
ReportFileGenerator.MessageMethodSortComparator
-
Field Summary
Fields Modifier and Type Field Description (package private) static java.lang.String
REPORT_PATH
(package private) static java.lang.String
REPORT_TITLE
(package private) static java.lang.String
REPORT_TYPE
private java.lang.String
reportPath
private java.lang.String
reportTitle
private ReportType
reportType
-
Fields inherited from class org.jboss.logging.processor.apt.AbstractGenerator
processingEnv
-
-
Constructor Summary
Constructors Constructor Description ReportFileGenerator(javax.annotation.processing.ProcessingEnvironment processingEnv)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.io.BufferedWriter
createWriter(java.lang.String packageName, java.lang.String fileName)
private static java.util.Collection<MessageMethod>
getSortedMessageMethods(MessageInterface messageInterface)
Returns a sorted collection of the message methods on the interface.void
processTypeElement(javax.lang.model.element.TypeElement annotation, javax.lang.model.element.TypeElement element, MessageInterface messageInterface)
Processes a type element.-
Methods inherited from class org.jboss.logging.processor.apt.AbstractGenerator
getName, getSupportedOptions, logger
-
-
-
-
Field Detail
-
REPORT_TYPE
static final java.lang.String REPORT_TYPE
- See Also:
- Constant Field Values
-
REPORT_PATH
static final java.lang.String REPORT_PATH
- See Also:
- Constant Field Values
-
REPORT_TITLE
static final java.lang.String REPORT_TITLE
- See Also:
- Constant Field Values
-
reportType
private final ReportType reportType
-
reportPath
private final java.lang.String reportPath
-
reportTitle
private final java.lang.String reportTitle
-
-
Method Detail
-
processTypeElement
public void processTypeElement(javax.lang.model.element.TypeElement annotation, javax.lang.model.element.TypeElement element, MessageInterface messageInterface)
Description copied from class:AbstractGenerator
Processes a type element.- Specified by:
processTypeElement
in classAbstractGenerator
- Parameters:
annotation
- the annotation who trigger the processingelement
- the element that contains the methods.messageInterface
- the message interface to implement.
-
createWriter
private java.io.BufferedWriter createWriter(java.lang.String packageName, java.lang.String fileName) throws java.io.IOException
- Throws:
java.io.IOException
-
getSortedMessageMethods
private static java.util.Collection<MessageMethod> getSortedMessageMethods(MessageInterface messageInterface)
Returns a sorted collection of the message methods on the interface. The methods are sorted by the message id.- Parameters:
messageInterface
- the message interface to get the methods for- Returns:
- a sorted collection of message methods
-
-