Class MethodCallExpression

  • All Implemented Interfaces:
    MethodCall

    public class MethodCallExpression
    extends Expression
    implements MethodCall
    A method call on an object or class
    • Field Detail

      • NO_ARGUMENTS

        public static final Expression NO_ARGUMENTS
    • Method Detail

      • setArguments

        public void setArguments​(Expression arguments)
      • setMethod

        public void setMethod​(Expression method)
      • getMethodAsString

        public String getMethodAsString()
        This method returns the method name as String if it is no dynamic calculated method name, but a constant.
        Specified by:
        getMethodAsString in interface MethodCall
      • setObjectExpression

        public void setObjectExpression​(Expression objectExpression)
      • getObjectExpression

        public Expression getObjectExpression()
      • isSafe

        public boolean isSafe()
        Returns:
        is this a safe method call, i.e. if true then if the source object is null then this method call will return null rather than throwing a null pointer exception
      • setSafe

        public void setSafe​(boolean safe)
      • isSpreadSafe

        public boolean isSpreadSafe()
      • setSpreadSafe

        public void setSpreadSafe​(boolean value)
      • isImplicitThis

        public boolean isImplicitThis()
        Returns:
        true if no object expression was specified otherwise if some expression was specified for the object on which to evaluate the method then return false
      • setImplicitThis

        public void setImplicitThis​(boolean implicitThis)
      • getGenericsTypes

        public GenericsType[] getGenericsTypes()
      • setGenericsTypes

        public void setGenericsTypes​(GenericsType[] genericsTypes)
      • isUsingGenerics

        public boolean isUsingGenerics()
      • setMethodTarget

        public void setMethodTarget​(MethodNode mn)
        Sets a method call target for a direct method call. WARNING: A method call made this way will run outside of the MOP!
        Parameters:
        mn - the target as MethodNode, mn==null means no target
      • getMethodTarget

        public MethodNode getMethodTarget()
        Returns:
        the target as method node if set
      • setSourcePosition

        public void setSourcePosition​(ASTNode node)
        Description copied from class: ASTNode
        Sets the source position using another ASTNode. The sourcePosition consists of a line/column pair for the start and a line/column pair for the end of the expression or statement
        Overrides:
        setSourcePosition in class ASTNode
        Parameters:
        node - - the node used to configure the position information