Class ClassModelFactory
java.lang.Object
org.jboss.logging.processor.generator.model.ClassModelFactory
Creates a class model for the message interface.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ClassModel
implementation
(ProcessingEnvironment processingEnv, MessageInterface messageInterface) Creates an implementation code model from the message interface.static ClassModel
translation
(ProcessingEnvironment processingEnv, MessageInterface messageInterface, String translationSuffix, Map<MessageMethod, String> translations) Creates a class model for created translation implementations of the message interface.
-
Constructor Details
-
ClassModelFactory
private ClassModelFactory()Private constructor for the factory.
-
-
Method Details
-
implementation
public static ClassModel implementation(ProcessingEnvironment processingEnv, MessageInterface messageInterface) throws IllegalArgumentException Creates an implementation code model from the message interface.- Parameters:
processingEnv
- the processing environmentmessageInterface
- the message interface to implement- Returns:
- the class model used to implement the interface.
- Throws:
IllegalArgumentException
- if interface is not annotated with@MessageBundle
or@MessageLogger
-
translation
public static ClassModel translation(ProcessingEnvironment processingEnv, MessageInterface messageInterface, String translationSuffix, Map<MessageMethod, String> translations) throws IllegalArgumentExceptionCreates a class model for created translation implementations of the message interface. Note: The implementation class must exist before the translation implementations can be created.- Parameters:
processingEnv
- the processing environmentmessageInterface
- the message interface to implement.translationSuffix
- the translation locale suffix.translations
- a map of the translations for the methods.- Returns:
- the class model used to create translation implementations of the interface.
- Throws:
IllegalArgumentException
- if interface is not annotated with@MessageBundle
or@MessageLogger
-