public InvocationExpression invoke(final String methodName, final Iterable<AstType> typeArguments, final Iterable<Expression> arguments) { return new TypeReferenceExpression(Expression.MYSTERY_OFFSET, this).invoke(methodName, typeArguments, arguments); }
public TypeReferenceExpression( int offset, final AstType type) { super( offset); addChild(VerifyArgument.notNull(type, "type"), Roles.TYPE); }
public final AstType getType() { return getChildByRole(Roles.TYPE); }
public MemberReferenceExpression member(final String memberName) { return new TypeReferenceExpression(Expression.MYSTERY_OFFSET, this).member(memberName); } }
public TypeReferenceExpression makeReference() { final TypeReferenceExpression t = new TypeReferenceExpression(Expression.MYSTERY_OFFSET, this); final TypeReference r = getUserData(Keys.TYPE_REFERENCE); if (r != null) { t.putUserData(Keys.TYPE_REFERENCE, r); } return t; }
thisReference.setTarget(new TypeReferenceExpression(node.getOffset(), outerType)); node.replaceWith(thisReference);
public InvocationExpression invoke(final String methodName, final Expression... arguments) { return makeReference().invoke(methodName, arguments); }
public final void setType(final AstType type) { setChildByRole(Roles.TYPE, type); }
private static ConditionalExpression createPattern() { final Expression target = new TypeReferenceExpression(new AnyNode().toType()).makeOptional().toExpression(); final MemberReferenceExpression access = new MemberReferenceExpression(target, Pattern.ANY_STRING); @SuppressWarnings("UnnecessaryLocalVariable") final ConditionalExpression pattern = new ConditionalExpression( new BinaryOperatorExpression( access.withName("fieldAccess").toExpression(), BinaryOperatorType.EQUALITY, new NullReferenceExpression() ), new AssignmentExpression( new BackReference("fieldAccess").toExpression(), AssignmentOperatorType.ASSIGN, target.clone() .invoke(Pattern.ANY_STRING, new TypedLiteralNode("class", String.class).toExpression()) .withName("methodCall") .toExpression() ), new BackReference("fieldAccess").toExpression() ); return pattern; }
public MemberReferenceExpression member(final String memberName) { return makeReference().member(memberName); }
public MemberReferenceExpression member(final String memberName) { return new TypeReferenceExpression(Expression.MYSTERY_OFFSET, this).member(memberName); } }
thisReference.setTarget(new TypeReferenceExpression(node.getOffset(), outerType)); node.replaceWith(thisReference);
public InvocationExpression invoke(final String methodName, final Iterable<Expression> arguments) { return makeReference().invoke(methodName, arguments); }
public final void setType(final AstType type) { setChildByRole(Roles.TYPE, type); }
public InvocationExpression invoke(final String methodName, final Expression... arguments) { return new TypeReferenceExpression(Expression.MYSTERY_OFFSET, this).invoke(methodName, arguments); }
new NamedNode( "valuesField", new TypeReferenceExpression( Expression.MYSTERY_OFFSET, astBuilder.convertType(definition) ).member(Pattern.ANY_STRING) ).toExpression(), "clone" new NamedNode( "valuesField", new TypeReferenceExpression( Expression.MYSTERY_OFFSET, astBuilder.convertType(definition) ).member(Pattern.ANY_STRING) ).toExpression(), "clone"
thisReference.setTarget(new TypeReferenceExpression(node.getOffset(), outerType)); node.replaceWith(thisReference);