@Override public void visitAnnotationFieldDef(GroovySourceAST t, int visit) { if (isGroovy && visit == OPENING_VISIT) { // TODO shouldn't really be treating annotation fields as methods - remove this hack SimpleGroovyClassDoc currentClassDoc = getCurrentClassDoc(); SimpleGroovyMethodDoc currentMethodDoc = createMethod(t, currentClassDoc); String defaultText = getDefaultValue(t); if (defaultText != null) { String orig = currentMethodDoc.getRawCommentText(); currentMethodDoc.setRawCommentText(orig + "\n* @default " + defaultText); } currentClassDoc.add(currentMethodDoc); } else if (visit == OPENING_VISIT) { // if (visit == OPENING_VISIT) { visitVariableDef(t, visit); String defaultText = getDefaultValue(t); if (isGroovy) { currentFieldDoc.setPublic(true); } if (defaultText != null) { currentFieldDoc.setConstantValueExpression(defaultText); String orig = currentFieldDoc.getRawCommentText(); currentFieldDoc.setRawCommentText(orig + "\n* @default " + defaultText); } } }
@Override public void visitAnnotationFieldDef(GroovySourceAST t, int visit) { if (isGroovy && visit == OPENING_VISIT) { // TODO shouldn't really be treating annotation fields as methods - remove this hack SimpleGroovyClassDoc currentClassDoc = getCurrentClassDoc(); SimpleGroovyMethodDoc currentMethodDoc = createMethod(t, currentClassDoc); String defaultText = getDefaultValue(t); if (defaultText != null) { String orig = currentMethodDoc.getRawCommentText(); currentMethodDoc.setRawCommentText(orig + "\n* @default " + defaultText); } currentClassDoc.add(currentMethodDoc); } else if (visit == OPENING_VISIT) { // if (visit == OPENING_VISIT) { visitVariableDef(t, visit); String defaultText = getDefaultValue(t); if (isGroovy) { currentFieldDoc.setPublic(true); } if (defaultText != null) { currentFieldDoc.setConstantValueExpression(defaultText); String orig = currentFieldDoc.getRawCommentText(); currentFieldDoc.setRawCommentText(orig + "\n* @default " + defaultText); } } }
@Override public void visitAnnotationFieldDef(GroovySourceAST t, int visit) { if (isGroovy && visit == OPENING_VISIT) { // TODO shouldn't really be treating annotation fields as methods - remove this hack SimpleGroovyClassDoc currentClassDoc = getCurrentClassDoc(); SimpleGroovyMethodDoc currentMethodDoc = createMethod(t, currentClassDoc); String defaultText = getDefaultValue(t); if (defaultText != null) { String orig = currentMethodDoc.getRawCommentText(); currentMethodDoc.setRawCommentText(orig + "\n* @default " + defaultText); } currentClassDoc.add(currentMethodDoc); } else if (visit == OPENING_VISIT) { // if (visit == OPENING_VISIT) { visitVariableDef(t, visit); String defaultText = getDefaultValue(t); if (isGroovy) { currentFieldDoc.setPublic(true); } if (defaultText != null) { currentFieldDoc.setConstantValueExpression(defaultText); String orig = currentFieldDoc.getRawCommentText(); currentFieldDoc.setRawCommentText(orig + "\n* @default " + defaultText); } } }