PsiElement (ASTNode node) { IElementType type = node.getElementType(); if (type == DIRECTIVE_BLOCK) { return new RestDirectiveBlock(node); } if (type == REFERENCE_NAME) { return new RestReference(node); } if (type == REFERENCE_TARGET) { return new RestReferenceTarget(node); } if (type == TITLE) { return new RestTitle(node); } if (type == FIELD) { return new RestRole(node); } if (type == FIELD_LIST) { return new RestFieldList(node); } if (type == INLINE_BLOCK) { return new RestInlineBlock(node); } if (type == LINE_TEXT) { return new RestLine(node); } return new ASTWrapperPsiElement(node); }