Interface CodeFunction

All Superinterfaces:
CodeItem, CodeItemWithVariables, CodeMutable, CodeMutableItem, CodeNode, CodeNodeItem, CodeWithContext
All Known Subinterfaces:
CodeConstructor, CodeLambdaExpression, CodeMethod, CodeOperation

public interface CodeFunction extends CodeNodeItem, CodeItemWithVariables
CodeNodeItem representing a function such as a CodeMethod or a CodeLambdaExpression.
Since:
1.0.0
Author:
Joerg Hohwiller (hohwille at users.sourceforge.net)
  • Method Details

    • getBody

      CodeBlockBody getBody()
      Returns:
      the CodeBlockBody of this function. May be empty (have no statements) but never null.
    • canHaveBody

      boolean canHaveBody()
      Returns:
      true if this function can and should have a body, false otherwise (e.g. if abstract).
    • setBody

      void setBody(CodeBlockBody body)
      Parameters:
      body - the new value of getBody().
      Throws:
      io.github.mmm.base.exception.ReadOnlyException - if immutable.