PsiElement (final ASTNode node) { final IElementType type = node.getElementType(); if (type == YAMLElementTypes.DOCUMENT){ return new YAMLDocumentImpl(node); } if (type == YAMLElementTypes.KEY_VALUE_PAIR) { return new YAMLKeyValueImpl(node); } if (type == YAMLElementTypes.COMPOUND_VALUE) { return new YAMLCompoundValueImpl(node); } if (type == YAMLElementTypes.SEQUENCE) { return new YAMLBlockSequenceImpl(node); } if (type == YAMLElementTypes.MAPPING) { return new YAMLBlockMappingImpl(node); } if (type == YAMLElementTypes.SEQUENCE_ITEM) { return new YAMLSequenceItemImpl(node); } if (type == YAMLElementTypes.HASH) { return new YAMLHashImpl(node); } if (type == YAMLElementTypes.ARRAY) { return new YAMLArrayImpl(node); } if (type == YAMLElementTypes.SCALAR_LIST_VALUE) { return new YAMLScalarListImpl(node); } if (type == YAMLElementTypes.SCALAR_TEXT_VALUE) { return new YAMLScalarTextImpl(node); } if (type == YAMLElementTypes.SCALAR_PLAIN_VALUE) { return new YAMLPlainTextImpl(node); } if (type == YAMLElementTypes.SCALAR_QUOTED_STRING) { return new YAMLQuotedTextImpl(node); } if (type == YAMLElementTypes.ANCHOR_NODE) { return new YAMLAnchorImpl(node); } if (type == YAMLElementTypes.ALIAS_NODE) { return new YAMLAliasImpl(node); } return new YAMLPsiElementImpl(node); }