UNPKG

@sap/odata-v4

Version:

OData V4.0 server library

42 lines (35 loc) 1.15 kB
'use strict'; const EdmType = require('./EdmType'); const EdmPrimitiveType = require('./EdmPrimitiveType'); const FullQualifiedName = require('../FullQualifiedName'); /** * Represents a type that can only be used for vocabulary terms. * @extends EdmType * @hideconstructor */ class EdmVocabularyTermType extends EdmType { /** * Constructor * @param {string} name */ constructor(name) { super(new FullQualifiedName(EdmPrimitiveType.EDM_NAMESPACE, name), EdmType.TypeKind.VOCABULARY_TERM); } /** * @param {string} name name * @returns {undefined|EdmVocabularyTermType} */ static fromName(name) { return EdmVocabularyTermType[name]; } /** * @returns {string} */ toString() { return EdmPrimitiveType.EDM_NAMESPACE + '.' + this.getName(); } } EdmVocabularyTermType.AnnotationPath = new EdmVocabularyTermType('AnnotationPath'); EdmVocabularyTermType.PropertyPath = new EdmVocabularyTermType('PropertyPath'); EdmVocabularyTermType.NavigationPropertyPath = new EdmVocabularyTermType('NavigationPropertyPath'); module.exports = EdmVocabularyTermType;