ASTNode (int role) { LOG.assertTrue(ChildRole.isUnique(role)); switch (role) { case ChildRole.SWITCH_KEYWORD: return findChildByType(JavaTokenType.SWITCH_KEYWORD); case ChildRole.LPARENTH: return findChildByType(JavaTokenType.LPARENTH); case ChildRole.SWITCH_EXPRESSION: return findChildByType(ElementType.EXPRESSION_BIT_SET); case ChildRole.RPARENTH: return findChildByType(JavaTokenType.RPARENTH); case ChildRole.SWITCH_BODY: return findChildByType(JavaElementType.CODE_BLOCK); default: return null; } }