public SdDeclarationType getType() {
        if (this instanceof SdSchemaFieldDefinition) {
            return SdDeclarationType.SCHEMA_FIELD;
        } else if (this instanceof SdDocumentSummaryDefinition) {
            return SdDeclarationType.DOCUMENT_SUMMARY;
        } else if (this instanceof SdImportFieldDefinition) {
            return SdDeclarationType.IMPORTED_FIELD;
        } else if (this instanceof SdRankProfileDefinition) {
            return SdDeclarationType.RANK_PROFILE;
        } else if (this instanceof SdFunctionDefinition) {
            return SdDeclarationType.FUNCTION;
        } else if (this instanceof SdArgumentDeclaration) {
            return SdDeclarationType.FUNCTION_ARGUMENT;
        } else if (this instanceof SdDocumentDefinition) {
            return SdDeclarationType.DOCUMENT;
        } else if (this instanceof SdDocumentStructDefinition) {
            return SdDeclarationType.STRUCT;
        } else if (this instanceof SdSchemaAnnotationDefinition ||
                   this instanceof SdDocumentAnnotationDefinition) {
            return SdDeclarationType.ANNOTATION;
        } else if (this instanceof SdDocumentStructFieldDefinition) {
            return SdDeclarationType.DOCUMENT_STRUCT_FIELD;
        } else if (this instanceof SdDocumentFieldDefinition) {
            return SdDeclarationType.DOCUMENT_FIELD;
        } else if (this instanceof SdStructFieldDefinition) {
            return SdDeclarationType.STRUCT_FIELD;
        } else if (this instanceof SdAnnotationFieldDefinition) {
            return SdDeclarationType.ANNOTATION_FIELD;
        } else if (this instanceof SdRankFeature) {
            return SdDeclarationType.FEATURE;
        } else {
            return null;
        }
    }
This abstract class is used to wrap a Psi Element with SdNamedElement interface, which enables the element to be a
"name owner" (like an identifier). It allows the element to take a part in references, find usages and more.

@author Shahar Ariel
integration/intellij/src/main/java/ai/vespa/intellij/schema/psi/impl/SdNamedElementImpl.java