Class AnnotationHelper


  • public class AnnotationHelper
    extends Object
    Author:
    Hylke van der Schaaf
    • Method Detail

      • generateEditorFromAnnotations

        public static final <C,​D> Optional<EditorMap<?>> generateEditorFromAnnotations​(Configurable<C,​D> instance,
                                                                                             C context,
                                                                                             D edtCtx)
        Generate the editor for the given configurable instance. The editor settings will be taken from annotations on the Class of the instance, and its super classes.
        Type Parameters:
        C - The class type that provides context at runtime.
        D - The class type that provides context while editing.
        Parameters:
        instance - The configurable instance to generate an editor for.
        context - The instance that provides context at runtime.
        edtCtx - The instance that provides context while editing.
        Returns:
        an editor for the given Configurable instance.
      • generateEditorFromAnnotations

        public static final <C,​D> Optional<EditorMap<?>> generateEditorFromAnnotations​(Class<?> configurableClass,
                                                                                             C context,
                                                                                             D edtCtx)
        Generate the editor for the given configurable instance. The editor settings will be taken from annotations on the configurable Class, and its super classes.
        Type Parameters:
        C - The class type that provides context at runtime.
        D - The class type that provides context while editing.
        Parameters:
        configurableClass - The configurable class to generate an editor for.
        context - The instance that provides context at runtime.
        edtCtx - The instance that provides context while editing.
        Returns:
        an editor for the given Configurable class, or an empty optional if no Configurable annotations exist.
      • csvToReadOnlySet

        public static Set<String> csvToReadOnlySet​(String csv)
      • hasConfigurableConstructorAnnotation

        public static boolean hasConfigurableConstructorAnnotation​(Class<?> configurableClass)
      • getConfigurableConstructor

        public static Optional<Constructor<?>> getConfigurableConstructor​(Class<?> configurableClass)
      • hasConfigurableConstructorParameter

        public static boolean hasConfigurableConstructorParameter​(Object instance,
                                                                  String jsonField)