Search in sources :

Example 6 with IdentifiableElement

use of org.eclipse.n4js.ts.types.IdentifiableElement in project n4js by eclipse.

the class FunctionDeclarationImpl method getExportedName.

/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public String getExportedName() {
    boolean _isExported = this.isExported();
    if (_isExported) {
        EObject _eContainer = this.eContainer();
        final ExportDeclaration exportDecl = ((ExportDeclaration) _eContainer);
        boolean _isDefaultExport = exportDecl.isDefaultExport();
        if (_isDefaultExport) {
            return "default";
        }
        final ExportableElement me = this;
        String _switchResult = null;
        boolean _matched = false;
        if (me instanceof NamedElement) {
            _matched = true;
            _switchResult = ((NamedElement) me).getName();
        }
        if (!_matched) {
            if (me instanceof IdentifiableElement) {
                _matched = true;
                _switchResult = ((IdentifiableElement) me).getName();
            }
        }
        return _switchResult;
    }
    return null;
}
Also used : ExportableElement(org.eclipse.n4js.n4JS.ExportableElement) EObject(org.eclipse.emf.ecore.EObject) InternalEObject(org.eclipse.emf.ecore.InternalEObject) IdentifiableElement(org.eclipse.n4js.ts.types.IdentifiableElement) ExportDeclaration(org.eclipse.n4js.n4JS.ExportDeclaration) NamedElement(org.eclipse.n4js.n4JS.NamedElement)

Example 7 with IdentifiableElement

use of org.eclipse.n4js.ts.types.IdentifiableElement in project n4js by eclipse.

the class ExportedVariableStatementImpl method getExportedName.

/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public String getExportedName() {
    boolean _isExported = this.isExported();
    if (_isExported) {
        EObject _eContainer = this.eContainer();
        final ExportDeclaration exportDecl = ((ExportDeclaration) _eContainer);
        boolean _isDefaultExport = exportDecl.isDefaultExport();
        if (_isDefaultExport) {
            return "default";
        }
        final ExportableElement me = this;
        String _switchResult = null;
        boolean _matched = false;
        if (me instanceof NamedElement) {
            _matched = true;
            _switchResult = ((NamedElement) me).getName();
        }
        if (!_matched) {
            if (me instanceof IdentifiableElement) {
                _matched = true;
                _switchResult = ((IdentifiableElement) me).getName();
            }
        }
        return _switchResult;
    }
    return null;
}
Also used : ExportableElement(org.eclipse.n4js.n4JS.ExportableElement) EObject(org.eclipse.emf.ecore.EObject) InternalEObject(org.eclipse.emf.ecore.InternalEObject) IdentifiableElement(org.eclipse.n4js.ts.types.IdentifiableElement) ExportDeclaration(org.eclipse.n4js.n4JS.ExportDeclaration) NamedElement(org.eclipse.n4js.n4JS.NamedElement)

Example 8 with IdentifiableElement

use of org.eclipse.n4js.ts.types.IdentifiableElement in project n4js by eclipse.

the class JSDoc2ADocSpecProcessor method addMembers.

/**
 * This method iterates through all members of a N4JS type and creates corresponding {@link SpecFile}s from them.
 * During this process, member tests are linked if available.
 */
private void addMembers(SpecInfo specInfo, Map<String, SpecSection> specsByKey, TreeMap<String, SpecFile> specChangeSet) {
    IdentifiableElement element = specInfo.specElementRef.identifiableElement;
    if (element instanceof TN4Classifier) {
        addMembers(specInfo, (TN4Classifier) element, specsByKey, specChangeSet);
        Type pfaElement = specInfo.specElementRef.polyfillAware;
        if (pfaElement instanceof TN4Classifier) {
            addMembers(specInfo, (TN4Classifier) pfaElement, specsByKey, specChangeSet);
        }
    }
}
Also used : Type(org.eclipse.n4js.ts.types.Type) TN4Classifier(org.eclipse.n4js.ts.types.TN4Classifier) IdentifiableElement(org.eclipse.n4js.ts.types.IdentifiableElement)

Example 9 with IdentifiableElement

use of org.eclipse.n4js.ts.types.IdentifiableElement in project n4js by eclipse.

the class AnnotationListImpl method getExportedName.

/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public String getExportedName() {
    boolean _isExported = this.isExported();
    if (_isExported) {
        EObject _eContainer = this.eContainer();
        final ExportDeclaration exportDecl = ((ExportDeclaration) _eContainer);
        boolean _isDefaultExport = exportDecl.isDefaultExport();
        if (_isDefaultExport) {
            return "default";
        }
        final ExportableElement me = this;
        String _switchResult = null;
        boolean _matched = false;
        if (me instanceof NamedElement) {
            _matched = true;
            _switchResult = ((NamedElement) me).getName();
        }
        if (!_matched) {
            if (me instanceof IdentifiableElement) {
                _matched = true;
                _switchResult = ((IdentifiableElement) me).getName();
            }
        }
        return _switchResult;
    }
    return null;
}
Also used : ExportableElement(org.eclipse.n4js.n4JS.ExportableElement) EObject(org.eclipse.emf.ecore.EObject) IdentifiableElement(org.eclipse.n4js.ts.types.IdentifiableElement) ExportDeclaration(org.eclipse.n4js.n4JS.ExportDeclaration) NamedElement(org.eclipse.n4js.n4JS.NamedElement)

Example 10 with IdentifiableElement

use of org.eclipse.n4js.ts.types.IdentifiableElement in project n4js by eclipse.

the class ExportableElementImpl method getExportedName.

/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public String getExportedName() {
    boolean _isExported = this.isExported();
    if (_isExported) {
        EObject _eContainer = this.eContainer();
        final ExportDeclaration exportDecl = ((ExportDeclaration) _eContainer);
        boolean _isDefaultExport = exportDecl.isDefaultExport();
        if (_isDefaultExport) {
            return "default";
        }
        final ExportableElement me = this;
        String _switchResult = null;
        boolean _matched = false;
        if (me instanceof NamedElement) {
            _matched = true;
            _switchResult = ((NamedElement) me).getName();
        }
        if (!_matched) {
            if (me instanceof IdentifiableElement) {
                _matched = true;
                _switchResult = ((IdentifiableElement) me).getName();
            }
        }
        return _switchResult;
    }
    return null;
}
Also used : ExportableElement(org.eclipse.n4js.n4JS.ExportableElement) EObject(org.eclipse.emf.ecore.EObject) IdentifiableElement(org.eclipse.n4js.ts.types.IdentifiableElement) ExportDeclaration(org.eclipse.n4js.n4JS.ExportDeclaration) NamedElement(org.eclipse.n4js.n4JS.NamedElement)

Aggregations

IdentifiableElement (org.eclipse.n4js.ts.types.IdentifiableElement)27 EObject (org.eclipse.emf.ecore.EObject)12 ExportDeclaration (org.eclipse.n4js.n4JS.ExportDeclaration)7 ExportableElement (org.eclipse.n4js.n4JS.ExportableElement)6 ParameterizedTypeRef (org.eclipse.n4js.ts.typeRefs.ParameterizedTypeRef)6 NamedElement (org.eclipse.n4js.n4JS.NamedElement)5 ParameterizedPropertyAccessExpression (org.eclipse.n4js.n4JS.ParameterizedPropertyAccessExpression)5 BaseTypeRef (org.eclipse.n4js.ts.typeRefs.BaseTypeRef)5 BoundThisTypeRef (org.eclipse.n4js.ts.typeRefs.BoundThisTypeRef)5 ComposedTypeRef (org.eclipse.n4js.ts.typeRefs.ComposedTypeRef)5 ExistentialTypeRef (org.eclipse.n4js.ts.typeRefs.ExistentialTypeRef)5 FunctionTypeRef (org.eclipse.n4js.ts.typeRefs.FunctionTypeRef)5 StaticBaseTypeRef (org.eclipse.n4js.ts.typeRefs.StaticBaseTypeRef)5 StructuralTypeRef (org.eclipse.n4js.ts.typeRefs.StructuralTypeRef)5 ThisTypeRef (org.eclipse.n4js.ts.typeRefs.ThisTypeRef)5 TypeRef (org.eclipse.n4js.ts.typeRefs.TypeRef)5 TypeTypeRef (org.eclipse.n4js.ts.typeRefs.TypeTypeRef)5 UnknownTypeRef (org.eclipse.n4js.ts.typeRefs.UnknownTypeRef)5 StructuralTypingResult (org.eclipse.n4js.typesystem.StructuralTypingResult)5 Result (org.eclipse.xsemantics.runtime.Result)5