Class BaseMethodInvocation

All Implemented Interfaces:
io.github.mmm.code.api.expression.CodeExpression, io.github.mmm.code.api.expression.CodeMemberReference, io.github.mmm.code.api.expression.CodeMethodInvocation, io.github.mmm.code.api.expression.CodeOperationInvocation, io.github.mmm.code.api.item.CodeItem

public class BaseMethodInvocation extends BaseMemberReference implements io.github.mmm.code.api.expression.CodeMethodInvocation
Base implementation of CodeMethodInvocation.
Since:
1.0.0
Author:
Joerg Hohwiller (hohwille at users.sourceforge.net)
  • Field Summary

    Fields inherited from interface io.github.mmm.code.api.item.CodeItem

    DEFAULT_INDENT, DEFAULT_NEWLINE
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
     
    The constructor.
     
    BaseMethodInvocation(BaseMethod method, List<? extends io.github.mmm.code.api.expression.CodeExpression> arguments)
    The constructor.
     
    BaseMethodInvocation(BaseMethod method, List<? extends io.github.mmm.code.api.expression.CodeExpression> arguments, io.github.mmm.code.api.expression.CodeExpression expression)
    The constructor.
    protected
    BaseMethodInvocation(BaseMethod method, List<? extends io.github.mmm.code.api.expression.CodeExpression> arguments, io.github.mmm.code.api.expression.CodeExpression expression, io.github.mmm.code.api.type.CodeGenericType type, List<? extends io.github.mmm.code.api.type.CodeGenericType> typeParameters)
    The constructor.
     
    BaseMethodInvocation(BaseMethod method, List<? extends io.github.mmm.code.api.expression.CodeExpression> arguments, io.github.mmm.code.api.expression.CodeExpression expression, List<? extends io.github.mmm.code.api.type.CodeGenericType> typeParameters)
    The constructor.
     
    BaseMethodInvocation(BaseMethod method, List<? extends io.github.mmm.code.api.expression.CodeExpression> arguments, io.github.mmm.code.api.type.CodeGenericType type)
    The constructor.
     
    BaseMethodInvocation(BaseMethod method, List<? extends io.github.mmm.code.api.expression.CodeExpression> arguments, io.github.mmm.code.api.type.CodeGenericType type, List<? extends io.github.mmm.code.api.type.CodeGenericType> typeParameters)
    The constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    doWrite(Appendable sink, String newline, String defaultIndent, String currentIndent, io.github.mmm.code.api.language.CodeLanguage language)
     
    io.github.mmm.code.api.expression.CodeConstant
     
    List<? extends io.github.mmm.code.api.expression.CodeExpression>
     
     
    List<? extends io.github.mmm.code.api.type.CodeGenericType>
     

    Methods inherited from class BaseMemberReference

    getExpression, getType

    Methods inherited from class BaseItem

    getOwningType, getSourceCode, getSpaces, toString, write

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface io.github.mmm.code.api.item.CodeItem

    getLanguage, getSourceCode, write, write, write, write, write, write

    Methods inherited from interface io.github.mmm.code.api.expression.CodeMemberReference

    getExpression, getType
  • Constructor Details

    • BaseMethodInvocation

      public BaseMethodInvocation(BaseMethod method)
      The constructor.
      Parameters:
      method - the method to invoke.
    • BaseMethodInvocation

      public BaseMethodInvocation(BaseMethod method, List<? extends io.github.mmm.code.api.expression.CodeExpression> arguments)
      The constructor.
      Parameters:
      method - the method to invoke.
      arguments - the arguments for the method invocation.
    • BaseMethodInvocation

      public BaseMethodInvocation(BaseMethod method, List<? extends io.github.mmm.code.api.expression.CodeExpression> arguments, io.github.mmm.code.api.type.CodeGenericType type)
      The constructor.
      Parameters:
      method - the method to invoke.
      arguments - the arguments for the method invocation.
      type - the optional type.
    • BaseMethodInvocation

      public BaseMethodInvocation(BaseMethod method, List<? extends io.github.mmm.code.api.expression.CodeExpression> arguments, io.github.mmm.code.api.type.CodeGenericType type, List<? extends io.github.mmm.code.api.type.CodeGenericType> typeParameters)
      The constructor.
      Parameters:
      method - the method to invoke.
      arguments - the arguments for the method invocation.
      type - the optional type.
      typeParameters - the optional type parameters.
    • BaseMethodInvocation

      public BaseMethodInvocation(BaseMethod method, List<? extends io.github.mmm.code.api.expression.CodeExpression> arguments, io.github.mmm.code.api.expression.CodeExpression expression)
      The constructor.
      Parameters:
      method - the method to invoke.
      arguments - the arguments for the method invocation.
      expression - the optional expression.
    • BaseMethodInvocation

      public BaseMethodInvocation(BaseMethod method, List<? extends io.github.mmm.code.api.expression.CodeExpression> arguments, io.github.mmm.code.api.expression.CodeExpression expression, List<? extends io.github.mmm.code.api.type.CodeGenericType> typeParameters)
      The constructor.
      Parameters:
      method - the method to invoke.
      arguments - the arguments for the method invocation.
      expression - the optional expression.
      typeParameters - the optional type parameters.
    • BaseMethodInvocation

      protected BaseMethodInvocation(BaseMethod method, List<? extends io.github.mmm.code.api.expression.CodeExpression> arguments, io.github.mmm.code.api.expression.CodeExpression expression, io.github.mmm.code.api.type.CodeGenericType type, List<? extends io.github.mmm.code.api.type.CodeGenericType> typeParameters)
      The constructor.
      Parameters:
      method - the method to invoke.
      arguments - the arguments for the method invocation.
      expression - the optional expression.
      type - the optional type.
      typeParameters - the optional type parameters.
  • Method Details

    • evaluate

      public io.github.mmm.code.api.expression.CodeConstant evaluate()
      Specified by:
      evaluate in interface io.github.mmm.code.api.expression.CodeExpression
    • getArguments

      public List<? extends io.github.mmm.code.api.expression.CodeExpression> getArguments()
      Specified by:
      getArguments in interface io.github.mmm.code.api.expression.CodeOperationInvocation
    • getTypeParameters

      public List<? extends io.github.mmm.code.api.type.CodeGenericType> getTypeParameters()
      Specified by:
      getTypeParameters in interface io.github.mmm.code.api.expression.CodeOperationInvocation
    • getMember

      public BaseMethod getMember()
      Specified by:
      getMember in interface io.github.mmm.code.api.expression.CodeMemberReference
      Specified by:
      getMember in interface io.github.mmm.code.api.expression.CodeMethodInvocation
      Specified by:
      getMember in interface io.github.mmm.code.api.expression.CodeOperationInvocation
      Specified by:
      getMember in class BaseMemberReference
    • doWrite

      protected void doWrite(Appendable sink, String newline, String defaultIndent, String currentIndent, io.github.mmm.code.api.language.CodeLanguage language) throws IOException
      Overrides:
      doWrite in class BaseMemberReference
      Parameters:
      sink - the Appendable where to append the code from this CodeItem.
      newline - the newline String.
      defaultIndent - the String used for indentation (e.g. a number of spaces to insert per indent level).
      currentIndent - the current indent (number of spaces). Initially the empty string (""). Before a recursion the defaultIndent will be appended.
      language - the CodeLanguage to use.
      Throws:
      IOException - if thrown by Appendable.
      See Also:
      • CodeItem.write(Appendable, String, String)