Class ClassModelFactory


  • public class ClassModelFactory
    extends java.lang.Object
    Creates a class model for the message interface.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private ClassModelFactory()
      Private constructor for the factory.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static ClassModel implementation​(javax.annotation.processing.ProcessingEnvironment processingEnv, MessageInterface messageInterface)
      Creates an implementation code model from the message interface.
      static ClassModel translation​(javax.annotation.processing.ProcessingEnvironment processingEnv, MessageInterface messageInterface, java.lang.String translationSuffix, java.util.Map<MessageMethod,​java.lang.String> translations)
      Creates a class model for created translation implementations of the message interface.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ClassModelFactory

        private ClassModelFactory()
        Private constructor for the factory.
    • Method Detail

      • implementation

        public static ClassModel implementation​(javax.annotation.processing.ProcessingEnvironment processingEnv,
                                                MessageInterface messageInterface)
                                         throws java.lang.IllegalArgumentException
        Creates an implementation code model from the message interface.
        Parameters:
        processingEnv - the processing environment
        messageInterface - the message interface to implement
        Returns:
        the class model used to implement the interface.
        Throws:
        java.lang.IllegalArgumentException - if interface is not annotated with @MessageBundle or @MessageLogger
      • translation

        public static ClassModel translation​(javax.annotation.processing.ProcessingEnvironment processingEnv,
                                             MessageInterface messageInterface,
                                             java.lang.String translationSuffix,
                                             java.util.Map<MessageMethod,​java.lang.String> translations)
                                      throws java.lang.IllegalArgumentException
        Creates 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 environment
        messageInterface - 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:
        java.lang.IllegalArgumentException - if interface is not annotated with @MessageBundle or @MessageLogger