org.eclipse.jdt.core.dom.ArrayCreation Java Examples

The following examples show how to use org.eclipse.jdt.core.dom.ArrayCreation. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: JavaASTFlattener.java    From xtext-xtend with Eclipse Public License 2.0 6 votes vote down vote up
public StringBuffer handleRightHandSide(final Assignment a, final Type type) {
  StringBuffer _xifexpression = null;
  if ((this._aSTFlattenerUtils.needPrimitiveCast(type) && (!(a.getRightHandSide() instanceof ArrayCreation)))) {
    StringBuffer _xblockexpression = null;
    {
      this.appendToBuffer("(");
      a.getRightHandSide().accept(this);
      StringConcatenation _builder = new StringConcatenation();
      _builder.append(") as ");
      _builder.append(type);
      _xblockexpression = this.appendToBuffer(_builder.toString());
    }
    _xifexpression = _xblockexpression;
  } else {
    a.getRightHandSide().accept(this);
  }
  return _xifexpression;
}
 
Example #2
Source File: ASTNodeMatcher.java    From JDeodorant with MIT License 6 votes vote down vote up
protected boolean isTypeHolder(Object o) {
	if(o.getClass().equals(MethodInvocation.class) || o.getClass().equals(SuperMethodInvocation.class)			
			|| o.getClass().equals(NumberLiteral.class) || o.getClass().equals(StringLiteral.class)
			|| o.getClass().equals(CharacterLiteral.class) || o.getClass().equals(BooleanLiteral.class)
			|| o.getClass().equals(TypeLiteral.class) || o.getClass().equals(NullLiteral.class)
			|| o.getClass().equals(ArrayCreation.class)
			|| o.getClass().equals(ClassInstanceCreation.class)
			|| o.getClass().equals(ArrayAccess.class) || o.getClass().equals(FieldAccess.class)
			|| o.getClass().equals(SuperFieldAccess.class) || o.getClass().equals(ParenthesizedExpression.class)
			|| o.getClass().equals(SimpleName.class) || o.getClass().equals(QualifiedName.class)
			|| o.getClass().equals(CastExpression.class) || o.getClass().equals(InfixExpression.class)
			|| o.getClass().equals(PrefixExpression.class) || o.getClass().equals(InstanceofExpression.class)
			|| o.getClass().equals(ThisExpression.class) || o.getClass().equals(ConditionalExpression.class))
		return true;
	return false;
}
 
Example #3
Source File: StringFormatGenerator.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 6 votes vote down vote up
@Override
protected void complete() throws CoreException {
	super.complete();
	ReturnStatement rStatement= fAst.newReturnStatement();
	String formatClass;
	if (getContext().is50orHigher())
		formatClass= "java.lang.String"; //$NON-NLS-1$
	else
		formatClass= "java.text.MessageFormat"; //$NON-NLS-1$
	MethodInvocation formatInvocation= createMethodInvocation(addImport(formatClass), "format", null); //$NON-NLS-1$ 
	StringLiteral literal= fAst.newStringLiteral();
	literal.setLiteralValue(buffer.toString());
	formatInvocation.arguments().add(literal);
	if (getContext().is50orHigher()) {
		formatInvocation.arguments().addAll(arguments);
	} else {
		ArrayCreation arrayCreation= fAst.newArrayCreation();
		arrayCreation.setType(fAst.newArrayType(fAst.newSimpleType(addImport("java.lang.Object")))); //$NON-NLS-1$
		ArrayInitializer initializer= fAst.newArrayInitializer();
		arrayCreation.setInitializer(initializer);
		initializer.expressions().addAll(arguments);
		formatInvocation.arguments().add(arrayCreation);
	}
	rStatement.setExpression(formatInvocation);
	toStringMethod.getBody().statements().add(rStatement);
}
 
Example #4
Source File: CodeBlock.java    From SimFix with GNU General Public License v2.0 6 votes vote down vote up
private ArrayCreate visit(ArrayCreation node) {
	int startLine = _cunit.getLineNumber(node.getStartPosition());
	int endLine = _cunit.getLineNumber(node.getStartPosition() + node.getLength());
	ArrayCreate arrayCreate = new ArrayCreate(startLine, endLine, node);
	
	arrayCreate.setArrayType(node.getType());
	arrayCreate.setType(node.getType());
	
	List<Expr> dimension = new ArrayList<>();
	for(Object object : node.dimensions()){
		Expr dim = (Expr) process((ASTNode) object);
		dim.setParent(arrayCreate);
		dimension.add(dim);
	}
	arrayCreate.setDimension(dimension);
	
	if(node.getInitializer() != null){
		ArrayInitial arrayInitializer = (ArrayInitial) process(node.getInitializer());
		arrayInitializer.setParent(arrayCreate);
		arrayCreate.setInitializer(arrayInitializer);
	}
	
	return arrayCreate;
}
 
Example #5
Source File: ASTNodes.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
private static ITypeBinding getTargetTypeForArrayInitializer(ArrayInitializer arrayInitializer) {
	ASTNode initializerParent= arrayInitializer.getParent();
	while (initializerParent instanceof ArrayInitializer) {
		initializerParent= initializerParent.getParent();
	}
	if (initializerParent instanceof ArrayCreation) {
		return ((ArrayCreation) initializerParent).getType().getElementType().resolveBinding();
	} else if (initializerParent instanceof VariableDeclaration) {
		ITypeBinding typeBinding= ((VariableDeclaration) initializerParent).getName().resolveTypeBinding();
		if (typeBinding != null) {
			return typeBinding.getElementType();
		}
	}
	return null;
}
 
Example #6
Source File: ArrayCreationWriter.java    From juniversal with MIT License 5 votes vote down vote up
@Override
public void write(ArrayCreation arrayCreation) {
	matchAndWrite("new");

	List<?> dimensions = arrayCreation.dimensions();
	// TODO: Support multidimensional arrays
	if (dimensions.size() > 1)
		throw new JUniversalException("Multidimensional arrays not currently supported");

	// TODO: Support array initializers
	if (arrayCreation.getInitializer() != null)
		throw new JUniversalException("Array initializers not currently supported");

	Expression dimensionSizeExpression = (Expression) dimensions.get(0);

	setPosition(dimensionSizeExpression.getStartPosition());

	write("(");
       writeNode(dimensionSizeExpression);
	copySpaceAndComments();
	write(") ");

	ArrayType arrayType = arrayCreation.getType();
	setPosition(arrayType.getStartPosition());

	write("Array<");
       writeNode(arrayType.getElementType());
	skipSpaceAndComments();
	write(">");

	setPosition(ASTUtil.getEndPosition(dimensionSizeExpression));
	skipSpaceAndComments();
	match("]");
}
 
Example #7
Source File: ArrayCreationWriter.java    From juniversal with MIT License 5 votes vote down vote up
@Override
public void write(ArrayCreation arrayCreation) {
    // TODO: C# doesn't support an exact equivalent to Integer[], with boxed integers (or other primitive types).
    // Consider disallowing arrays of that type to be created, instead forcing the dev to either create an
    // Object[] if they want boxed types or an int[] if they want primitive types

    List<?> dimensions = arrayCreation.dimensions();
    // TODO: Support multidimensional arrays
    if (dimensions.size() > 1)
        throw new JUniversalException("Multidimensional arrays not currently supported");

    matchAndWrite("new");

    copySpaceAndComments();
    writeNode(arrayCreation.getType().getElementType());

    copySpaceAndComments();
    matchAndWrite("[");

    writeNodes(arrayCreation.dimensions());

    copySpaceAndComments();
    matchAndWrite("]");

    // TODO: Check all syntax combinations here
    @Nullable ArrayInitializer arrayInitializer = arrayCreation.getInitializer();
    if (arrayInitializer != null) {
        copySpaceAndComments();
        writeNode(arrayInitializer);
    }
}
 
Example #8
Source File: StyledStringVisitor.java    From JDeodorant with MIT License 5 votes vote down vote up
public boolean visit(ArrayCreation expr) {
	/*
	 	new PrimitiveType [ Expression ] { [ Expression ] } { [ ] }
   		new TypeName [ < Type { , Type } > ] [ Expression ] { [ Expression ] } { [ ] }
   		new PrimitiveType [ ] { [ ] } ArrayInitializer
   		new TypeName [ < Type { , Type } > ] [ ] { [ ] } ArrayInitializer
	 */
	activateDiffStyle(expr);
	styledString.append("new", determineDiffStyle(expr, new StyledStringStyler(keywordStyle)));
	appendSpace();
	if(expr.dimensions().isEmpty()) {
		handleType(expr.getType());
	}
	else {
		handleType(expr.getType().getElementType());
	}
	for (int i = 0; i < expr.dimensions().size(); i++) {
		appendOpenBracket();
		handleExpression((Expression) expr.dimensions().get(i));
		appendClosedBracket();
	}
	if(expr.getInitializer() != null) {
		appendSpace();
		visit(expr.getInitializer());
	}
	deactivateDiffStyle(expr);
	return false;
}
 
Example #9
Source File: BindingSignatureVisitor.java    From JDeodorant with MIT License 5 votes vote down vote up
public boolean visit(ArrayCreation expr) {
	handleType(expr.getType());
	List dimensions = expr.dimensions();
	for (int i = 0; i < dimensions.size(); i++) {
		handleExpression((Expression) dimensions.get(i));
	}
	if(expr.getInitializer() != null) {
		visit(expr.getInitializer());
	}
	return false;
}
 
Example #10
Source File: AbstractMethodFragment.java    From JDeodorant with MIT License 5 votes vote down vote up
protected void processArrayCreations(List<Expression> arrayCreations) {
	for(Expression arrayCreationExpression : arrayCreations) {
		ArrayCreation arrayCreation = (ArrayCreation)arrayCreationExpression;
		Type type = arrayCreation.getType();
		ITypeBinding typeBinding = type.resolveBinding();
		String qualifiedTypeName = typeBinding.getQualifiedName();
		TypeObject typeObject = TypeObject.extractTypeObject(qualifiedTypeName);
		ArrayCreationObject creationObject = new ArrayCreationObject(typeObject);
		creationObject.setArrayCreation(arrayCreation);
		addCreation(creationObject);
	}
}
 
Example #11
Source File: FlowAnalyzer.java    From eclipse.jdt.ls with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public void endVisit(ArrayCreation node) {
	if (skipNode(node)) {
		return;
	}
	GenericSequentialFlowInfo info = processSequential(node, node.getType());
	process(info, node.dimensions());
	process(info, node.getInitializer());
}
 
Example #12
Source File: PromoteTempToFieldRefactoring.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
private Expression getTempInitializerCopy(ASTRewrite rewrite) {
	final Expression initializer= (Expression) rewrite.createCopyTarget(getTempInitializer());
	if (initializer instanceof ArrayInitializer && ASTNodes.getDimensions(fTempDeclarationNode) > 0) {
		ArrayCreation arrayCreation= rewrite.getAST().newArrayCreation();
		arrayCreation.setType((ArrayType) ASTNodeFactory.newType(rewrite.getAST(), fTempDeclarationNode));
		arrayCreation.setInitializer((ArrayInitializer) initializer);
		return arrayCreation;
	}
	return initializer;
}
 
Example #13
Source File: ObjectCreation.java    From RefactoringMiner with MIT License 5 votes vote down vote up
public ObjectCreation(CompilationUnit cu, String filePath, ArrayCreation creation) {
	this.locationInfo = new LocationInfo(cu, filePath, creation, CodeElementType.ARRAY_CREATION);
	this.isArray = true;
	this.type = UMLType.extractTypeObject(cu, filePath, creation.getType(), 0);
	this.typeArguments = creation.dimensions().size();
	this.arguments = new ArrayList<String>();
	List<Expression> args = creation.dimensions();
	for(Expression argument : args) {
		this.arguments.add(argument.toString());
	}
	if(creation.getInitializer() != null) {
		this.anonymousClassDeclaration = creation.getInitializer().toString();
	}
}
 
Example #14
Source File: InferTypeArgumentsConstraintCreator.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public void endVisit(ArrayCreation node) {
	ArrayType arrayType= node.getType();
	TypeVariable2 arrayTypeCv= (TypeVariable2) getConstraintVariable(arrayType);
	if (arrayTypeCv == null)
		return;
	setConstraintVariable(node, arrayTypeCv);
	//TODO: constraints for array initializer?
}
 
Example #15
Source File: TreedBuilder.java    From compiler with Apache License 2.0 5 votes vote down vote up
@Override
public boolean visit(ArrayCreation node) {
	if (node.dimensions().size() > 10) {
		node.getType().accept(this);
		return false;
	}
	return super.visit(node);
}
 
Example #16
Source File: FlowAnalyzer.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public void endVisit(ArrayCreation node) {
	if (skipNode(node))
		return;
	GenericSequentialFlowInfo info= processSequential(node, node.getType());
	process(info, node.dimensions());
	process(info, node.getInitializer());
}
 
Example #17
Source File: SuperTypeConstraintsCreator.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public final void endVisit(final ArrayCreation node) {
	final ConstraintVariable2 ancestor= (ConstraintVariable2) node.getType().getProperty(PROPERTY_CONSTRAINT_VARIABLE);
	node.setProperty(PROPERTY_CONSTRAINT_VARIABLE, ancestor);
	final ArrayInitializer initializer= node.getInitializer();
	if (initializer != null) {
		final ConstraintVariable2 descendant= (ConstraintVariable2) initializer.getProperty(PROPERTY_CONSTRAINT_VARIABLE);
		if (descendant != null)
			fModel.createSubtypeConstraint(descendant, ancestor);
	}
}
 
Example #18
Source File: ArrayCreationObject.java    From JDeodorant with MIT License 4 votes vote down vote up
public void setArrayCreation(ArrayCreation creation) {
	this.creation = ASTInformationGenerator.generateASTInformation(creation);
}
 
Example #19
Source File: JavaASTFlattener.java    From xtext-xtend with Eclipse Public License 2.0 4 votes vote down vote up
@Override
public boolean visit(final ArrayCreation node) {
  ArrayType at = node.getType();
  int dims = at.getDimensions();
  if ((dims > 1)) {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("/* FIXME Only one dimensional arrays are supported. ");
    _builder.append(node);
    _builder.append("*/");
    this.appendToBuffer(_builder.toString());
    this.addProblem(node, "Only one dimension arrays are supported.");
    return false;
  }
  ArrayInitializer _initializer = node.getInitializer();
  boolean _tripleNotEquals = (_initializer != null);
  if (_tripleNotEquals) {
    if (this.fallBackStrategy) {
      this.appendToBuffer("(");
    }
    node.getInitializer().accept(this);
    if (this.fallBackStrategy) {
      this.appendToBuffer(" as ");
      at.accept(this);
      this.appendToBuffer(")");
    }
  } else {
    StringConcatenation _builder_1 = new StringConcatenation();
    _builder_1.append("new");
    String _xifexpression = null;
    boolean _isPrimitiveType = node.getType().getElementType().isPrimitiveType();
    if (_isPrimitiveType) {
      Type _elementType = node.getType().getElementType();
      _xifexpression = StringExtensions.toFirstUpper(((PrimitiveType) _elementType).getPrimitiveTypeCode().toString());
    }
    _builder_1.append(_xifexpression);
    _builder_1.append("ArrayOfSize(");
    this.appendToBuffer(_builder_1.toString());
    List _dimensions = node.dimensions();
    (((Expression[])Conversions.unwrapArray(((Iterable<Expression>) _dimensions), Expression.class))[0]).accept(this);
    this.appendToBuffer(")");
  }
  return false;
}
 
Example #20
Source File: StyledStringVisitor.java    From JDeodorant with MIT License 4 votes vote down vote up
private void handleExpression(Expression expression) {
	if (expression instanceof ArrayAccess) {
		visit((ArrayAccess) expression);
	} else if (expression instanceof ArrayCreation) {
		visit((ArrayCreation) expression);
	} else if (expression instanceof ArrayInitializer) {
		visit((ArrayInitializer) expression);
	} else if (expression instanceof Assignment) {
		visit((Assignment) expression);
	} else if (expression instanceof BooleanLiteral) {
		visit((BooleanLiteral) expression);
	} else if (expression instanceof CastExpression) {
		visit((CastExpression) expression);
	} else if (expression instanceof CharacterLiteral) {
		visit((CharacterLiteral) expression);
	} else if (expression instanceof ClassInstanceCreation) {
		visit((ClassInstanceCreation) expression);
	} else if (expression instanceof ConditionalExpression) {
		visit((ConditionalExpression) expression);
	} else if (expression instanceof FieldAccess) {
		visit((FieldAccess) expression);
	} else if (expression instanceof InfixExpression) {
		visit((InfixExpression) expression);
	} else if (expression instanceof InstanceofExpression) {
		visit((InstanceofExpression) expression);
	} else if (expression instanceof MethodInvocation) {
		visit((MethodInvocation) expression);
	} else if (expression instanceof NullLiteral) {
		visit((NullLiteral) expression);
	} else if (expression instanceof NumberLiteral) {
		visit((NumberLiteral) expression);
	} else if (expression instanceof ParenthesizedExpression) {
		visit((ParenthesizedExpression) expression);
	} else if (expression instanceof PostfixExpression) {
		visit((PostfixExpression) expression);
	} else if (expression instanceof PrefixExpression) {
		visit((PrefixExpression) expression);
	} else if ((expression instanceof QualifiedName)) {
		visit((QualifiedName) expression);
	} else if (expression instanceof SimpleName) {
		visit((SimpleName) expression);
	} else if (expression instanceof StringLiteral) {
		visit((StringLiteral) expression);
	} else if (expression instanceof SuperFieldAccess) {
		visit((SuperFieldAccess) expression);
	} else if (expression instanceof SuperMethodInvocation) {
		visit((SuperMethodInvocation) expression);
	} else if (expression instanceof ThisExpression) {
		visit((ThisExpression) expression);
	} else if (expression instanceof TypeLiteral) {
		visit((TypeLiteral) expression);
	} else if (expression instanceof VariableDeclarationExpression) {
		visit((VariableDeclarationExpression) expression);
	}
}
 
Example #21
Source File: BindingSignatureVisitor.java    From JDeodorant with MIT License 4 votes vote down vote up
private void handleExpression(Expression expression) {
	if (expression instanceof ArrayAccess) {
		visit((ArrayAccess) expression);
	} else if (expression instanceof ArrayCreation) {
		visit((ArrayCreation) expression);
	} else if (expression instanceof ArrayInitializer) {
		visit((ArrayInitializer) expression);
	} else if (expression instanceof Assignment) {
		visit((Assignment) expression);
	} else if (expression instanceof BooleanLiteral) {
		visit((BooleanLiteral) expression);
	} else if (expression instanceof CastExpression) {
		visit((CastExpression) expression);
	} else if (expression instanceof CharacterLiteral) {
		visit((CharacterLiteral) expression);
	} else if (expression instanceof ClassInstanceCreation) {
		visit((ClassInstanceCreation) expression);
	} else if (expression instanceof ConditionalExpression) {
		visit((ConditionalExpression) expression);
	} else if (expression instanceof FieldAccess) {
		visit((FieldAccess) expression);
	} else if (expression instanceof InfixExpression) {
		visit((InfixExpression) expression);
	} else if (expression instanceof InstanceofExpression) {
		visit((InstanceofExpression) expression);
	} else if (expression instanceof MethodInvocation) {
		visit((MethodInvocation) expression);
	} else if (expression instanceof NullLiteral) {
		visit((NullLiteral) expression);
	} else if (expression instanceof NumberLiteral) {
		visit((NumberLiteral) expression);
	} else if (expression instanceof ParenthesizedExpression) {
		visit((ParenthesizedExpression) expression);
	} else if (expression instanceof PostfixExpression) {
		visit((PostfixExpression) expression);
	} else if (expression instanceof PrefixExpression) {
		visit((PrefixExpression) expression);
	} else if ((expression instanceof QualifiedName)) {
		visit((QualifiedName) expression);
	} else if (expression instanceof SimpleName) {
		visit((SimpleName) expression);
	} else if (expression instanceof StringLiteral) {
		visit((StringLiteral) expression);
	} else if (expression instanceof SuperFieldAccess) {
		visit((SuperFieldAccess) expression);
	} else if (expression instanceof SuperMethodInvocation) {
		visit((SuperMethodInvocation) expression);
	} else if (expression instanceof ThisExpression) {
		visit((ThisExpression) expression);
	} else if (expression instanceof TypeLiteral) {
		visit((TypeLiteral) expression);
	} else if (expression instanceof VariableDeclarationExpression) {
		visit((VariableDeclarationExpression) expression);
	}
}
 
Example #22
Source File: ExtractClassRefactoring.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 4 votes vote down vote up
private FieldDeclaration createParameterObjectField(ParameterObjectFactory pof, TypeDeclaration typeNode, int modifier) {
	AST ast= fBaseCURewrite.getAST();
	ClassInstanceCreation creation= ast.newClassInstanceCreation();
	creation.setType(pof.createType(fDescriptor.isCreateTopLevel(), fBaseCURewrite, typeNode.getStartPosition()));
	ListRewrite listRewrite= fBaseCURewrite.getASTRewrite().getListRewrite(creation, ClassInstanceCreation.ARGUMENTS_PROPERTY);
	for (Iterator<FieldInfo> iter= fVariables.values().iterator(); iter.hasNext();) {
		FieldInfo fi= iter.next();
		if (isCreateField(fi)) {
			Expression expression= fi.initializer;
			if (expression != null && !fi.hasFieldReference()) {
				importNodeTypes(expression, fBaseCURewrite);
				ASTNode createMoveTarget= fBaseCURewrite.getASTRewrite().createMoveTarget(expression);
				if (expression instanceof ArrayInitializer) {
					ArrayInitializer ai= (ArrayInitializer) expression;
					ITypeBinding type= ai.resolveTypeBinding();
					Type addImport= fBaseCURewrite.getImportRewrite().addImport(type, ast);
					fBaseCURewrite.getImportRemover().registerAddedImports(addImport);
					ArrayCreation arrayCreation= ast.newArrayCreation();
					arrayCreation.setType((ArrayType) addImport);
					arrayCreation.setInitializer((ArrayInitializer) createMoveTarget);
					listRewrite.insertLast(arrayCreation, null);
				} else {
					listRewrite.insertLast(createMoveTarget, null);
				}
			}
		}
	}

	VariableDeclarationFragment fragment= ast.newVariableDeclarationFragment();
	fragment.setName(ast.newSimpleName(fDescriptor.getFieldName()));
	fragment.setInitializer(creation);

	ModifierKeyword acc= null;
	if (Modifier.isPublic(modifier)) {
		acc= ModifierKeyword.PUBLIC_KEYWORD;
	} else if (Modifier.isProtected(modifier)) {
		acc= ModifierKeyword.PROTECTED_KEYWORD;
	} else if (Modifier.isPrivate(modifier)) {
		acc= ModifierKeyword.PRIVATE_KEYWORD;
	}

	FieldDeclaration fieldDeclaration= ast.newFieldDeclaration(fragment);
	fieldDeclaration.setType(pof.createType(fDescriptor.isCreateTopLevel(), fBaseCURewrite, typeNode.getStartPosition()));
	if (acc != null)
		fieldDeclaration.modifiers().add(ast.newModifier(acc));
	return fieldDeclaration;
}
 
Example #23
Source File: InstanceOfArrayCreation.java    From JDeodorant with MIT License 4 votes vote down vote up
public boolean instanceOf(Expression expression) {
	if(expression instanceof ArrayCreation)
		return true;
	else
		return false;
}
 
Example #24
Source File: ArrayCreationObject.java    From JDeodorant with MIT License 4 votes vote down vote up
public ArrayCreation getArrayCreation() {
	return (ArrayCreation)this.creation.recoverASTNode();
}
 
Example #25
Source File: GenericVisitor.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 4 votes vote down vote up
@Override
public boolean visit(ArrayCreation node) {
	return visitNode(node);
}
 
Example #26
Source File: GenericVisitor.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 4 votes vote down vote up
@Override
public void endVisit(ArrayCreation node) {
	endVisitNode(node);
}
 
Example #27
Source File: ConstraintCollector.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 4 votes vote down vote up
@Override
public boolean visit(ArrayCreation node) {
	add(fCreator.create(node));
	return true;
}
 
Example #28
Source File: AstMatchingNodeFinder.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 4 votes vote down vote up
@Override
public boolean visit(ArrayCreation node) {
	if (node.subtreeMatch(fMatcher, fNodeToMatch))
		return matches(node);
	return super.visit(node);
}
 
Example #29
Source File: ConstraintCreator.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 2 votes vote down vote up
/**
 * @param node the AST node
 * @return array of type constraints, may be empty
 * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.ArrayCreation)
 */
public ITypeConstraint[] create(ArrayCreation node) {
	return EMPTY_ARRAY;
}