Class ImplJEnumConstant

All Implemented Interfaces:
JAnnotatable, JClassItem, JCommentable, JDocCommentable, JEnumConstant, JSimpleArgs

class ImplJEnumConstant extends BasicJAnnotatable implements JEnumConstant, JClassItem
  • Field Details

  • Constructor Details

  • Method Details

    • getClassDef

      EnumJClassDef getClassDef()
    • getName

      public String getName()
      Description copied from interface: JClassItem
      Get the name of this element, if there is one.
      Specified by:
      getName in interface JClassItem
      Returns:
      the name, or null if there is none
    • arg

      public JEnumConstant arg(JExpr expr)
      Description copied from interface: JEnumConstant
      Add an argument.
      Specified by:
      arg in interface JEnumConstant
      Specified by:
      arg in interface JSimpleArgs
      Parameters:
      expr - the argument expression
      Returns:
      this program element
    • body

      public JClassDef body()
      Description copied from interface: JEnumConstant
      Add an implementation body to this enum constant.
      Specified by:
      body in interface JEnumConstant
      Returns:
      the implementation class definition
    • arguments

      public JExpr[] arguments()
      Description copied from interface: JSimpleArgs
      Get the arguments defined thus far.
      Specified by:
      arguments in interface JSimpleArgs
      Returns:
      the arguments
    • writeDirect

      void writeDirect(SourceFileWriter writer) throws IOException
      Throws:
      IOException
    • getItemKind

      public JClassItem.Kind getItemKind()
      Description copied from interface: JClassItem
      Get the kind of item.
      Specified by:
      getItemKind in interface JClassItem
      Returns:
      the item kind
    • getModifiers

      public int getModifiers()
      Description copied from interface: JClassItem
      Get the modifiers of this item.
      Specified by:
      getModifiers in interface JClassItem
      Returns:
      the modifiers
      See Also:
    • hasAllModifiers

      public boolean hasAllModifiers(int mods)
      Description copied from interface: JClassItem
      Determine whether this item has all of the modifiers specified by the given bitwise-OR-joined argument.
      Specified by:
      hasAllModifiers in interface JClassItem
      Parameters:
      mods - the modifier(s)
      Returns:
      true if all of the modifiers are present, false otherwise
    • hasAnyModifier

      public boolean hasAnyModifier(int mods)
      Description copied from interface: JClassItem
      Determine whether this item has any of the modifiers specified by the given bitwise-OR-joined argument.
      Specified by:
      hasAnyModifier in interface JClassItem
      Parameters:
      mods - the modifier(s)
      Returns:
      true if any if the modifiers are present, false otherwise