@Override public String toString() { return annotation.toString(); }
@Override public String toString() { return annotation.toString(); }
private void insertAnnotationsOnDimension(ArrayType replacingType, int index, int pos, TextEditGroup editGroup, boolean astLevelGTE8) { if (astLevelGTE8) { Dimension dim = (Dimension) replacingType.dimensions().get(index); List annotations = dim.annotations(); if (annotations != null) { int size = annotations.size(); if (size > 0) { doTextInsert(pos, " ", editGroup); //$NON-NLS-1$ for (int j = 0; j < size; j++) { Annotation annotation = (Annotation) annotations.get(j); doTextInsert(pos, annotation.toString() + " ", editGroup); //$NON-NLS-1$ } } } } }
/** * Gets the sibling where the given {@link Annotation} should be added to the given {@link BodyDeclaration}. The * {@link Annotation} must be added before the returned node. * * @param owner * The owner of the {@link Annotation}. * @param newAnnotation * The new {@link Annotation} that should be added. * @return The */ public static ASTNode getAnnotationSibling(BodyDeclaration owner, Annotation newAnnotation) { Deque<Annotation> annotations = getAnnotations(owner); if (!annotations.isEmpty()) { int newAnnotLen = newAnnotation.toString().length(); Iterator<Annotation> iterator = annotations.descendingIterator(); while (iterator.hasNext()) { Annotation existingAnnotation = iterator.next(); int len = existingAnnotation.getLength(); if (len > 0 && len >= newAnnotLen) { return existingAnnotation; } } } for (Object o : owner.modifiers()) { if (o instanceof Modifier) { return (Modifier) o; } } return null; }
private void insertAnnotationsOnDimension(ArrayType replacingType, int index, int pos, TextEditGroup editGroup, boolean astLevelGTE8) { if (astLevelGTE8) { Dimension dim = (Dimension) replacingType.dimensions().get(index); List annotations = dim.annotations(); if (annotations != null) { int size = annotations.size(); if (size > 0) { doTextInsert(pos, " ", editGroup); //$NON-NLS-1$ for (int j = 0; j < size; j++) { Annotation annotation = (Annotation) annotations.get(j); doTextInsert(pos, annotation.toString() + " ", editGroup); //$NON-NLS-1$ } } } } }
private void insertAnnotationsOnDimension(ArrayType replacingType, int index, int pos, TextEditGroup editGroup, boolean astLevelGTE8) { if (astLevelGTE8) { Dimension dim = (Dimension) replacingType.dimensions().get(index); List annotations = dim.annotations(); if (annotations != null) { int size = annotations.size(); if (size > 0) { doTextInsert(pos, " ", editGroup); //$NON-NLS-1$ for (int j = 0; j < size; j++) { Annotation annotation = (Annotation) annotations.get(j); doTextInsert(pos, annotation.toString() + " ", editGroup); //$NON-NLS-1$ } } } } }
private void insertAnnotationsOnDimension(ArrayType replacingType, int index, int pos, TextEditGroup editGroup, boolean astLevelGTE8) { if (astLevelGTE8) { Dimension dim = (Dimension) replacingType.dimensions().get(index); List annotations = dim.annotations(); if (annotations != null) { int size = annotations.size(); if (size > 0) { doTextInsert(pos, " ", editGroup); //$NON-NLS-1$ for (int j = 0; j < size; j++) { Annotation annotation = (Annotation) annotations.get(j); doTextInsert(pos, annotation.toString() + " ", editGroup); //$NON-NLS-1$ } } } } }
private void insertAnnotationsOnDimension(ArrayType replacingType, int index, int pos, TextEditGroup editGroup, boolean astLevelGTE8) { if (astLevelGTE8) { Dimension dim = (Dimension) replacingType.dimensions().get(index); List annotations = dim.annotations(); if (annotations != null) { int size = annotations.size(); if (size > 0) { doTextInsert(pos, " ", editGroup); //$NON-NLS-1$ for (int j = 0; j < size; j++) { Annotation annotation = (Annotation) annotations.get(j); doTextInsert(pos, annotation.toString() + " ", editGroup); //$NON-NLS-1$ } } } } }
compilationUnit.getColumnNumber(node.getStartPosition()), node.getLength(), node.toString());