com.togethersoft.sca.ast
Interface AstConstructorInvocation

All Superinterfaces:
AstExpression, AstObject, AstReference

public interface AstConstructorInvocation
extends AstExpression, AstReference

Represents an explicit constructor invocation. For example:

     this();
     super();
 


Fields inherited from interface com.togethersoft.sca.ast.AstObject
ARRAY_CREATION, ARRAY_INITIALIZER, ARRAY_REFERENCE, ASSERT_STATEMENT, ASSIGNMENT_EXPRESSION, BINARY_EXPRESSION, BREAK_STATEMENT, CASE_LABEL, CAST_EXPRESSION, CATCH_CLAUSE, CLASS_FILE, COMMENT, COMPILATION_UNIT, COMPOUND_STATEMENT, CONDITIONAL_EXPRESSION, CONSTRUCTOR_INVOCATION, CONTINUE_STATEMENT, DBC_RESULT, DECLARATION_STATEMENT, DO_STATEMENT, EMPTY_STATEMENT, EXPRESSION_STATEMENT, FIELD_REFERENCE, FINALLY_CLAUSE, FOR_STATEMENT, IF_STATEMENT, IMPORT, INITIALIZER, JAVADOC_TAG, LITERAL, METHOD, METHOD_CALL_EXPRESSION, N_A, OBJECT_CREATION_EXPRESSION, PACKAGE, PARENTHESIZED_EXPRESSION, RETURN_STATEMENT, SIMPLE_REFERENCE, SUPER_EXPRESSION, SWITCH_GROUP, SWITCH_STATEMENT, SYNCHRONIZED_STATEMENT, THIS_EXPRESSION, THROW_SPECIFIER, THROW_STATEMENT, TRY_STATEMENT, TYPE, TYPE_EXPRESSION, UNARY_EXPRESSION, VARIABLE, VARIABLE_DECLARATION, WHILE_STATEMENT
 
Method Summary
 AstExpression[] getArguments()
          Returns arguments for the constructor.
 AstExpression getBase()
          Returns the base expression if this is a qualified constructor invocation, otherwise null.
 AstDeclaration getReferencedElement()
          Returns the declaration of the constructor that is called by this expression.
 AstTypeReference getType()
          Returns a reference to the void type since constructor invocations have no type.
 boolean isSuperCall()
          Returns true if this is a superclass constructor invocation, otherwise false.
 boolean isThisCall()
          Returns true if this is an alternate constructor invocation, otherwise false.
 
Methods inherited from interface com.togethersoft.sca.ast.AstExpression
getOperands, getRuntimeType, isConstant
 
Methods inherited from interface com.togethersoft.sca.ast.AstObject
addComment, getChildren, getComments, getCompilationUnit, getDeclaringMethod, getDeclaringType, getObjectKind, getPackage, getParent, getPosition, isDeleted, remove, replaceWith, replaceWith, setPosition, setPositionAfter, visitExpressions, visitStatements
 

Method Detail

getArguments

public AstExpression[] getArguments()
Returns arguments for the constructor. This returns an empty collection, if the constructor call takes no arguments.
Returns:
the constructor arguments.

getBase

public AstExpression getBase()
Returns the base expression if this is a qualified constructor invocation, otherwise null.
Returns:
the base expression.

getReferencedElement

public AstDeclaration getReferencedElement()
Returns the declaration of the constructor that is called by this expression.
Specified by:
getReferencedElement in interface AstReference
Returns:
the called constructor.
See Also:
AstMethod

getType

public AstTypeReference getType()
Returns a reference to the void type since constructor invocations have no type.
Specified by:
getType in interface AstExpression
Returns:
the void type.

isSuperCall

public boolean isSuperCall()
Returns true if this is a superclass constructor invocation, otherwise false.
Returns:
true is this is a superclass constructor invocation.

isThisCall

public boolean isThisCall()
Returns true if this is an alternate constructor invocation, otherwise false.
Returns:
true is this is an alternate constructor invocation.