PsiElement (ASTNode node) { IElementType type = node.getElementType(); if (type == ARRAY) { return new JsonArrayImpl(node); } else if (type == BOOLEAN_LITERAL) { return new JsonBooleanLiteralImpl(node); } else if (type == NULL_LITERAL) { return new JsonNullLiteralImpl(node); } else if (type == NUMBER_LITERAL) { return new JsonNumberLiteralImpl(node); } else if (type == OBJECT) { return new JsonObjectImpl(node); } else if (type == PROPERTY) { return new JsonPropertyImpl(node); } else if (type == REFERENCE_EXPRESSION) { return new JsonReferenceExpressionImpl(node); } else if (type == STRING_LITERAL) { return new JsonStringLiteralImpl(node); } throw new AssertionError("Unknown element type: " + type); }