public Tree completeTypeArgument(Optional<List<AnnotationTreeImpl>> annotations, TypeTree partial) { completeTypeTreeWithAnnotations(partial, annotations); return partial; }
public Tree completeTypeArgument(Optional<List<AnnotationTreeImpl>> annotations, TypeTree partial) { completeTypeTreeWithAnnotations(partial, annotations); return partial; }
public PrimitiveTypeTreeImpl newBasicType(Optional<List<AnnotationTreeImpl>> annotations, InternalSyntaxToken basicType) { JavaTree.PrimitiveTypeTreeImpl primitiveTypeTree = new JavaTree.PrimitiveTypeTreeImpl(basicType); completeTypeTreeWithAnnotations(primitiveTypeTree, annotations); return primitiveTypeTree; }
public PrimitiveTypeTreeImpl newBasicType(Optional<List<AnnotationTreeImpl>> annotations, InternalSyntaxToken basicType) { JavaTree.PrimitiveTypeTreeImpl primitiveTypeTree = new JavaTree.PrimitiveTypeTreeImpl(basicType); completeTypeTreeWithAnnotations(primitiveTypeTree, annotations); return primitiveTypeTree; }
public PrimitiveTypeTreeImpl newBasicType(Optional<List<AnnotationTreeImpl>> annotations, InternalSyntaxToken basicType) { JavaTree.PrimitiveTypeTreeImpl primitiveTypeTree = new JavaTree.PrimitiveTypeTreeImpl(basicType); completeTypeTreeWithAnnotations(primitiveTypeTree, annotations); return primitiveTypeTree; }
private static void completeTypeTreeWithAnnotations(TypeTree type, Optional<List<AnnotationTreeImpl>> annotations) { if (annotations.isPresent()) { List<AnnotationTree> typeAnnotations = ImmutableList.<AnnotationTree>builder().addAll(annotations.get()).build(); completeTypeTreeWithAnnotations(type, typeAnnotations); } }
public Tree completeTypeArgument(Optional<List<AnnotationTreeImpl>> annotations, Tree partial) { if (partial.is(Tree.Kind.UNBOUNDED_WILDCARD, Tree.Kind.EXTENDS_WILDCARD, Tree.Kind.SUPER_WILDCARD)) { List<AnnotationTree> annotationList = annotations.isPresent() ? ImmutableList.<AnnotationTree>builder().addAll(annotations.get()).build() : ImmutableList.<AnnotationTree>of(); ((WildcardTreeImpl) partial).complete(annotationList); } else { completeTypeTreeWithAnnotations((TypeTree) partial, annotations); } return partial; }
public WildcardTreeImpl newWildcardTypeArguments(InternalSyntaxToken extendsOrSuperToken, Optional<List<AnnotationTreeImpl>> annotations, TypeTree type) { completeTypeTreeWithAnnotations(type, annotations); return new WildcardTreeImpl( JavaKeyword.EXTENDS.getValue().equals(extendsOrSuperToken.text()) ? Kind.EXTENDS_WILDCARD : Kind.SUPER_WILDCARD, extendsOrSuperToken, type); }
public WildcardTreeImpl newWildcardTypeArguments(InternalSyntaxToken extendsOrSuperToken, Optional<List<AnnotationTreeImpl>> annotations, TypeTree type) { completeTypeTreeWithAnnotations(type, annotations); return new WildcardTreeImpl( JavaKeyword.EXTENDS.getValue().equals(extendsOrSuperToken.text()) ? Kind.EXTENDS_WILDCARD : Kind.SUPER_WILDCARD, extendsOrSuperToken, type); }
public WildcardTreeImpl newWildcardTypeArguments(InternalSyntaxToken extendsOrSuperToken, Optional<List<AnnotationTreeImpl>> annotations, TypeTree type) { completeTypeTreeWithAnnotations(type, annotations); return new WildcardTreeImpl( JavaKeyword.EXTENDS.getValue().equals(extendsOrSuperToken.text()) ? Kind.EXTENDS_WILDCARD : Kind.SUPER_WILDCARD, extendsOrSuperToken, type); }
public TypeParameterTreeImpl completeTypeParameter(Optional<List<AnnotationTreeImpl>> annotations, InternalSyntaxToken identifierToken, Optional<TypeParameterTreeImpl> partial) { IdentifierTreeImpl identifier = new IdentifierTreeImpl(identifierToken); completeTypeTreeWithAnnotations(identifier, annotations); return partial.isPresent() ? partial.get().complete(identifier) : new TypeParameterTreeImpl(identifier); }
public TypeParameterTreeImpl completeTypeParameter(Optional<List<AnnotationTreeImpl>> annotations, InternalSyntaxToken identifierToken, Optional<TypeParameterTreeImpl> partial) { IdentifierTreeImpl identifier = new IdentifierTreeImpl(identifierToken); completeTypeTreeWithAnnotations(identifier, annotations); return partial.isPresent() ? partial.get().complete(identifier) : new TypeParameterTreeImpl(identifier); }
public TypeParameterTreeImpl completeTypeParameter(Optional<List<AnnotationTreeImpl>> annotations, InternalSyntaxToken identifierToken, Optional<TypeParameterTreeImpl> partial) { IdentifierTreeImpl identifier = new IdentifierTreeImpl(identifierToken); completeTypeTreeWithAnnotations(identifier, annotations); return partial.isPresent() ? partial.get().complete(identifier) : new TypeParameterTreeImpl(identifier); }
public ExpressionTree newExpression(InternalSyntaxToken newToken, Optional<List<AnnotationTreeImpl>> annotations, ExpressionTree partial) { TypeTree typeTree; if (partial.is(Tree.Kind.NEW_CLASS)) { NewClassTreeImpl newClassTree = (NewClassTreeImpl) partial; newClassTree.completeWithNewKeyword(newToken); typeTree = newClassTree.identifier(); } else { NewArrayTreeImpl newArrayTree = (NewArrayTreeImpl) partial; newArrayTree.completeWithNewKeyword(newToken); typeTree = newArrayTree.type(); } completeTypeTreeWithAnnotations(typeTree, annotations); return partial; }
public ExpressionTree newExpression(InternalSyntaxToken newToken, Optional<List<AnnotationTreeImpl>> annotations, ExpressionTree partial) { TypeTree typeTree; if (partial.is(Tree.Kind.NEW_CLASS)) { NewClassTreeImpl newClassTree = (NewClassTreeImpl) partial; newClassTree.completeWithNewKeyword(newToken); typeTree = newClassTree.identifier(); } else { NewArrayTreeImpl newArrayTree = (NewArrayTreeImpl) partial; newArrayTree.completeWithNewKeyword(newToken); typeTree = newArrayTree.type(); } completeTypeTreeWithAnnotations(typeTree, annotations); return partial; }
public ExpressionTree newExpression(InternalSyntaxToken newToken, Optional<List<AnnotationTreeImpl>> annotations, ExpressionTree partial) { TypeTree typeTree; if (partial.is(Tree.Kind.NEW_CLASS)) { NewClassTreeImpl newClassTree = (NewClassTreeImpl) partial; newClassTree.completeWithNewKeyword(newToken); typeTree = newClassTree.identifier(); } else { NewArrayTreeImpl newArrayTree = (NewArrayTreeImpl) partial; newArrayTree.completeWithNewKeyword(newToken); typeTree = newArrayTree.type(); } completeTypeTreeWithAnnotations(typeTree, annotations); return partial; }