Class JEnumConstant

    • Field Detail

      • name

        private final java.lang.String name
        The constant.
      • jdoc

        private JDocComment jdoc
        javadoc comments, if any.
      • annotations

        private java.util.List<JAnnotationUse> annotations
        Annotations on this variable. Lazily created.
      • args

        private java.util.List<JExpression> args
        List of the constructor argument expressions. Lazily constructed.
    • Constructor Detail

      • JEnumConstant

        JEnumConstant​(JDefinedClass type,
                      java.lang.String name)
    • Method Detail

      • arg

        public JEnumConstant arg​(JExpression arg)
        Add an expression to this constructor's argument list
        Parameters:
        arg - Argument to add to argument list
      • getName

        public java.lang.String getName()
        Returns the name of this constant.
        Returns:
        never null.
      • javadoc

        public JDocComment javadoc()
        Creates, if necessary, and returns the enum constant javadoc.
        Specified by:
        javadoc in interface JDocCommentable
        Returns:
        JDocComment containing javadocs for this constant.
      • annotate

        public JAnnotationUse annotate​(JClass clazz)
        Adds an annotation to this variable.
        Specified by:
        annotate in interface JAnnotatable
        Parameters:
        clazz - The annotation class to annotate the field with
      • annotate

        public JAnnotationUse annotate​(java.lang.Class<? extends java.lang.annotation.Annotation> clazz)
        Adds an annotation to this variable.
        Specified by:
        annotate in interface JAnnotatable
        Parameters:
        clazz - The annotation class to annotate the field with
      • annotate2

        public <W extends JAnnotationWriter> W annotate2​(java.lang.Class<W> clazz)
        Description copied from interface: JAnnotatable
        Adds an annotation to this program element and returns a type-safe writer to fill in the values of such annotations.
        Specified by:
        annotate2 in interface JAnnotatable