Search in sources :

Example 1 with FunctionOrFieldAccessor

use of org.eclipse.n4js.n4JS.FunctionOrFieldAccessor in project n4js by eclipse.

the class MissingReturnOrThrowValidator method internalCheckMissingReturnDisallowed.

private void internalCheckMissingReturnDisallowed(N4JSFlowgraphValidator fVali) {
    Collection<FunctionOrFieldAccessor> mrtFunctions = mrta.getMRTFunctions();
    for (FunctionOrFieldAccessor fofa : mrtFunctions) {
        EStructuralFeature highlightFeature = getMarkedElement(fofa);
        String msg = IssueCodes.getMessageForFUN_MISSING_RETURN_OR_THROW_STATEMENT();
        fVali.addIssue(msg, fofa, highlightFeature, IssueCodes.FUN_MISSING_RETURN_OR_THROW_STATEMENT);
    }
}
Also used : FunctionOrFieldAccessor(org.eclipse.n4js.n4JS.FunctionOrFieldAccessor) EStructuralFeature(org.eclipse.emf.ecore.EStructuralFeature)

Example 2 with FunctionOrFieldAccessor

use of org.eclipse.n4js.n4JS.FunctionOrFieldAccessor in project n4js by eclipse.

the class N4MethodDeclarationImpl method getDefinedFunctionOrAccessor.

/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public IdentifiableElement getDefinedFunctionOrAccessor() {
    final FunctionOrFieldAccessor _this = this;
    EObject _switchResult = null;
    boolean _matched = false;
    if (_this instanceof FunctionDefinition) {
        _matched = true;
        _switchResult = ((FunctionDefinition) _this).getDefinedType();
    }
    if (!_matched) {
        if (_this instanceof FieldAccessor) {
            _matched = true;
            _switchResult = ((FieldAccessor) _this).getDefinedAccessor();
        }
    }
    return ((IdentifiableElement) _switchResult);
}
Also used : FunctionOrFieldAccessor(org.eclipse.n4js.n4JS.FunctionOrFieldAccessor) EObject(org.eclipse.emf.ecore.EObject) InternalEObject(org.eclipse.emf.ecore.InternalEObject) FunctionDefinition(org.eclipse.n4js.n4JS.FunctionDefinition) FunctionOrFieldAccessor(org.eclipse.n4js.n4JS.FunctionOrFieldAccessor) FieldAccessor(org.eclipse.n4js.n4JS.FieldAccessor)

Example 3 with FunctionOrFieldAccessor

use of org.eclipse.n4js.n4JS.FunctionOrFieldAccessor in project n4js by eclipse.

the class N4FieldAccessorImpl method getDefinedFunctionOrAccessor.

/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public IdentifiableElement getDefinedFunctionOrAccessor() {
    final FunctionOrFieldAccessor _this = this;
    EObject _switchResult = null;
    boolean _matched = false;
    if (_this instanceof FunctionDefinition) {
        _matched = true;
        _switchResult = ((FunctionDefinition) _this).getDefinedType();
    }
    if (!_matched) {
        if (_this instanceof org.eclipse.n4js.n4JS.FieldAccessor) {
            _matched = true;
            _switchResult = ((org.eclipse.n4js.n4JS.FieldAccessor) _this).getDefinedAccessor();
        }
    }
    return ((IdentifiableElement) _switchResult);
}
Also used : FunctionOrFieldAccessor(org.eclipse.n4js.n4JS.FunctionOrFieldAccessor) EObject(org.eclipse.emf.ecore.EObject) InternalEObject(org.eclipse.emf.ecore.InternalEObject) FunctionDefinition(org.eclipse.n4js.n4JS.FunctionDefinition) FunctionOrFieldAccessor(org.eclipse.n4js.n4JS.FunctionOrFieldAccessor) FieldAccessor(org.eclipse.n4js.ts.types.FieldAccessor) N4FieldAccessor(org.eclipse.n4js.n4JS.N4FieldAccessor)

Example 4 with FunctionOrFieldAccessor

use of org.eclipse.n4js.n4JS.FunctionOrFieldAccessor in project n4js by eclipse.

the class FunctionDeclarationImpl method getDefinedFunctionOrAccessor.

/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public IdentifiableElement getDefinedFunctionOrAccessor() {
    final FunctionOrFieldAccessor _this = this;
    EObject _switchResult = null;
    boolean _matched = false;
    if (_this instanceof FunctionDefinition) {
        _matched = true;
        _switchResult = ((FunctionDefinition) _this).getDefinedType();
    }
    if (!_matched) {
        if (_this instanceof FieldAccessor) {
            _matched = true;
            _switchResult = ((FieldAccessor) _this).getDefinedAccessor();
        }
    }
    return ((IdentifiableElement) _switchResult);
}
Also used : FunctionOrFieldAccessor(org.eclipse.n4js.n4JS.FunctionOrFieldAccessor) EObject(org.eclipse.emf.ecore.EObject) InternalEObject(org.eclipse.emf.ecore.InternalEObject) FunctionDefinition(org.eclipse.n4js.n4JS.FunctionDefinition) FunctionOrFieldAccessor(org.eclipse.n4js.n4JS.FunctionOrFieldAccessor) FieldAccessor(org.eclipse.n4js.n4JS.FieldAccessor)

Example 5 with FunctionOrFieldAccessor

use of org.eclipse.n4js.n4JS.FunctionOrFieldAccessor in project n4js by eclipse.

the class FunctionOrFieldAccessorImpl method getDefinedFunctionOrAccessor.

/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public IdentifiableElement getDefinedFunctionOrAccessor() {
    final FunctionOrFieldAccessor _this = this;
    EObject _switchResult = null;
    boolean _matched = false;
    if (_this instanceof FunctionDefinition) {
        _matched = true;
        _switchResult = ((FunctionDefinition) _this).getDefinedType();
    }
    if (!_matched) {
        if (_this instanceof FieldAccessor) {
            _matched = true;
            _switchResult = ((FieldAccessor) _this).getDefinedAccessor();
        }
    }
    return ((IdentifiableElement) _switchResult);
}
Also used : FunctionOrFieldAccessor(org.eclipse.n4js.n4JS.FunctionOrFieldAccessor) EObject(org.eclipse.emf.ecore.EObject) InternalEObject(org.eclipse.emf.ecore.InternalEObject) FunctionDefinition(org.eclipse.n4js.n4JS.FunctionDefinition) FunctionOrFieldAccessor(org.eclipse.n4js.n4JS.FunctionOrFieldAccessor) FieldAccessor(org.eclipse.n4js.n4JS.FieldAccessor)

Aggregations

FunctionOrFieldAccessor (org.eclipse.n4js.n4JS.FunctionOrFieldAccessor)9 EObject (org.eclipse.emf.ecore.EObject)6 FunctionDefinition (org.eclipse.n4js.n4JS.FunctionDefinition)6 InternalEObject (org.eclipse.emf.ecore.InternalEObject)5 FieldAccessor (org.eclipse.n4js.n4JS.FieldAccessor)4 N4ClassifierDefinition (org.eclipse.n4js.n4JS.N4ClassifierDefinition)2 ThisTypeRef (org.eclipse.n4js.ts.typeRefs.ThisTypeRef)2 TypeTypeRef (org.eclipse.n4js.ts.typeRefs.TypeTypeRef)2 ContainerType (org.eclipse.n4js.ts.types.ContainerType)2 Type (org.eclipse.n4js.ts.types.Type)2 LinkedList (java.util.LinkedList)1 EStructuralFeature (org.eclipse.emf.ecore.EStructuralFeature)1 ArrowFunction (org.eclipse.n4js.n4JS.ArrowFunction)1 N4ClassDeclaration (org.eclipse.n4js.n4JS.N4ClassDeclaration)1 N4FieldAccessor (org.eclipse.n4js.n4JS.N4FieldAccessor)1 N4FieldDeclaration (org.eclipse.n4js.n4JS.N4FieldDeclaration)1 N4GetterDeclaration (org.eclipse.n4js.n4JS.N4GetterDeclaration)1 N4MemberDeclaration (org.eclipse.n4js.n4JS.N4MemberDeclaration)1 N4MethodDeclaration (org.eclipse.n4js.n4JS.N4MethodDeclaration)1 N4SetterDeclaration (org.eclipse.n4js.n4JS.N4SetterDeclaration)1