Example usage for org.eclipse.jdt.core.dom InstanceofExpression InstanceofExpression

List of usage examples for org.eclipse.jdt.core.dom InstanceofExpression InstanceofExpression

Introduction

In this page you can find the example usage for org.eclipse.jdt.core.dom InstanceofExpression InstanceofExpression.

Prototype

InstanceofExpression(AST ast) 

Source Link

Document

Creates a new AST node for an instanceof expression owned by the given AST.

Usage

From source file:org.eclipse.jdt.core.dom.ASTConverter.java

License:Open Source License

public InstanceofExpression convert(org.eclipse.jdt.internal.compiler.ast.InstanceOfExpression expression) {
    InstanceofExpression instanceOfExpression = new InstanceofExpression(this.ast);
    if (this.resolveBindings) {
        recordNodes(instanceOfExpression, expression);
    }/* w w  w. j a  va  2  s.c  o  m*/
    Expression leftExpression = convert(expression.expression);
    instanceOfExpression.setLeftOperand(leftExpression);
    final Type convertType = convertType(expression.type);
    instanceOfExpression.setRightOperand(convertType);
    int startPosition = leftExpression.getStartPosition();
    int sourceEnd = convertType.getStartPosition() + convertType.getLength() - 1;
    instanceOfExpression.setSourceRange(startPosition, sourceEnd - startPosition + 1);
    return instanceOfExpression;
}