@Override public ASTNode findChildByRole(int role) { LOG.assertTrue(ChildRole.isUnique(role)); switch (role) { default: return null; case ChildRole.DOC_COMMENT_START: return getFirstChildNode(); case ChildRole.DOC_COMMENT_END: if (getLastChildNode().getElementType() == DOC_COMMENT_END) { return getLastChildNode(); } else { return null; } } }
public ASTNode findChildByRole(int role) { LOG.assertTrue(ChildRole.isUnique(role)); switch (role) { default: return null; case ChildRole.PACKAGE_KEYWORD: return findChildByType(JavaTokenType.PACKAGE_KEYWORD); case ChildRole.PACKAGE_REFERENCE: return findChildByType(JavaElementType.JAVA_CODE_REFERENCE); case ChildRole.CLOSING_SEMICOLON: return TreeUtil.findChildBackward(this, JavaTokenType.SEMICOLON); case ChildRole.MODIFIER_LIST: return findChildByType(JavaElementType.MODIFIER_LIST); } }