private boolean isFieldDefinition() { GroovySourceAST parentNode = getParentNode(); return parentNode != null && parentNode.getType() == OBJBLOCK; }
private SimpleGroovyClassDoc getCurrentClassDoc() { if (stack.isEmpty()) return null; GroovySourceAST node = getParentNode(); if (isTopLevelConstruct(node)) return foundClasses.get(getIdentFor(node)); GroovySourceAST saved = stack.pop(); SimpleGroovyClassDoc result = getCurrentClassDoc(); stack.push(saved); return result; }
private boolean isFieldDefinition() { GroovySourceAST parentNode = getParentNode(); return parentNode != null && parentNode.getType() == OBJBLOCK; }
private boolean isFieldDefinition() { GroovySourceAST parentNode = getParentNode(); return parentNode != null && parentNode.getType() == OBJBLOCK; }
private boolean isFieldDefinition() { GroovySourceAST parentNode = getParentNode(); return parentNode != null && parentNode.getType() == OBJBLOCK; }
private boolean isFieldDefinition() { GroovySourceAST parentNode = getParentNode(); return parentNode != null && parentNode.getType() == OBJBLOCK; }
private SimpleGroovyClassDoc getCurrentClassDoc() { if (stack.isEmpty()) return null; GroovySourceAST node = getParentNode(); if (isTopLevelConstruct(node) && foundClasses != null) { return foundClasses.get(getIdentFor(node)); } GroovySourceAST saved = stack.pop(); SimpleGroovyClassDoc result = getCurrentClassDoc(); stack.push(saved); return result; }
private SimpleGroovyClassDoc getCurrentClassDoc() { if (stack.isEmpty()) return null; GroovySourceAST node = getParentNode(); if (isTopLevelConstruct(node)) return foundClasses.get(getIdentFor(node)); GroovySourceAST saved = stack.pop(); SimpleGroovyClassDoc result = getCurrentClassDoc(); stack.push(saved); return result; }
private SimpleGroovyClassDoc getCurrentClassDoc() { if (stack.isEmpty()) return null; GroovySourceAST node = getParentNode(); if (isTopLevelConstruct(node)) return foundClasses.get(getIdentFor(node)); GroovySourceAST saved = stack.pop(); SimpleGroovyClassDoc result = getCurrentClassDoc(); stack.push(saved); return result; }
private boolean isNested() { GroovySourceAST gpn = getGrandParentNode(); return getParentNode() != null && gpn != null && (gpn.getType() == CLASS_DEF || gpn.getType() == INTERFACE_DEF); }
private SimpleGroovyClassDoc getCurrentClassDoc() { GroovySourceAST pn = getParentNode(); if (isTopLevelConstruct(pn)) return foundClasses.get(getIdentFor(pn)); GroovySourceAST gpn = getGrandParentNode(); if (isTopLevelConstruct(gpn)) return foundClasses.get(getIdentFor(gpn)); return null; }
public void visitVariableDef(GroovySourceAST t, int visit) { if (visit == OPENING_VISIT) { if (!insideAnonymousInnerClass()) { GroovySourceAST parentNode = getParentNode(); // todo - what about fields in interfaces/enums etc if (parentNode != null && parentNode.getType() == GroovyTokenTypes.OBJBLOCK) { // this should restrict us to just field definitions, and not local variable definitions // field name String fieldName = t.childOfType(GroovyTokenTypes.IDENT).getText(); SimpleGroovyFieldDoc currentFieldDoc = new SimpleGroovyFieldDoc(fieldName); // comments - todo check this is doing the right thing for fields... String commentText = getJavaDocCommentsBeforeNode(t); currentFieldDoc.setRawCommentText(commentText); // modifiers processModifiers(t, currentFieldDoc); // type String typeName = getTypeNodeAsText(t.childOfType(GroovyTokenTypes.TYPE),"def"); SimpleGroovyType type = new SimpleGroovyType(typeName); // todo !!! currentFieldDoc.setType(type); // don't forget to tell the class about this field so carefully constructed. currentClassDoc.add(currentFieldDoc); } } } }