Search in sources :

Example 6 with MemberAccessModifier

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

the class TMethodImpl method setDeclaredMemberAccessModifier.

/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public void setDeclaredMemberAccessModifier(MemberAccessModifier newDeclaredMemberAccessModifier) {
    MemberAccessModifier oldDeclaredMemberAccessModifier = declaredMemberAccessModifier;
    declaredMemberAccessModifier = newDeclaredMemberAccessModifier == null ? DECLARED_MEMBER_ACCESS_MODIFIER_EDEFAULT : newDeclaredMemberAccessModifier;
    if (eNotificationRequired())
        eNotify(new ENotificationImpl(this, Notification.SET, TypesPackage.TMETHOD__DECLARED_MEMBER_ACCESS_MODIFIER, oldDeclaredMemberAccessModifier, declaredMemberAccessModifier));
}
Also used : ENotificationImpl(org.eclipse.emf.ecore.impl.ENotificationImpl) MemberAccessModifier(org.eclipse.n4js.ts.types.MemberAccessModifier)

Example 7 with MemberAccessModifier

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

the class TMemberWithAccessModifierImpl method setDeclaredMemberAccessModifier.

/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public void setDeclaredMemberAccessModifier(MemberAccessModifier newDeclaredMemberAccessModifier) {
    MemberAccessModifier oldDeclaredMemberAccessModifier = declaredMemberAccessModifier;
    declaredMemberAccessModifier = newDeclaredMemberAccessModifier == null ? DECLARED_MEMBER_ACCESS_MODIFIER_EDEFAULT : newDeclaredMemberAccessModifier;
    if (eNotificationRequired())
        eNotify(new ENotificationImpl(this, Notification.SET, TypesPackage.TMEMBER_WITH_ACCESS_MODIFIER__DECLARED_MEMBER_ACCESS_MODIFIER, oldDeclaredMemberAccessModifier, declaredMemberAccessModifier));
}
Also used : ENotificationImpl(org.eclipse.emf.ecore.impl.ENotificationImpl) MemberAccessModifier(org.eclipse.n4js.ts.types.MemberAccessModifier)

Example 8 with MemberAccessModifier

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

the class TMemberWithAccessModifierImpl method getMemberAccessModifier.

/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public MemberAccessModifier getMemberAccessModifier() {
    MemberAccessModifier _declaredMemberAccessModifier = this.getDeclaredMemberAccessModifier();
    boolean _tripleEquals = (_declaredMemberAccessModifier == MemberAccessModifier.UNDEFINED);
    if (_tripleEquals) {
        final EObject parent = this.eContainer();
        if ((parent instanceof TInterface)) {
            final MemberAccessModifier modifierDerivedFromType = AccessModifiers.toMemberModifier(((Type) parent).getTypeAccessModifier());
            if ((modifierDerivedFromType != MemberAccessModifier.PRIVATE)) {
                return modifierDerivedFromType;
            }
        }
        return MemberAccessModifier.PROJECT;
    }
    return this.getDeclaredMemberAccessModifier();
}
Also used : TInterface(org.eclipse.n4js.ts.types.TInterface) EObject(org.eclipse.emf.ecore.EObject) MemberAccessModifier(org.eclipse.n4js.ts.types.MemberAccessModifier)

Example 9 with MemberAccessModifier

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

the class AccessModifiers method checkedLess.

/**
 * Similar to {@link #less(TMember, TMember)}, but the access modifiers of both members are "checked" (and
 * {@link #fixed(TMember)} if necessary) before comparison. This is done to avoid strange error messages (or
 * strangely omitted error messages) due to wrong accessors.
 */
public static boolean checkedLess(TMember left, TMember right) {
    MemberAccessModifier fixedLeft = fixed(left);
    MemberAccessModifier fixedRight = fixed(right);
    return less(fixedLeft, fixedRight);
}
Also used : MemberAccessModifier(org.eclipse.n4js.ts.types.MemberAccessModifier)

Aggregations

MemberAccessModifier (org.eclipse.n4js.ts.types.MemberAccessModifier)9 TInterface (org.eclipse.n4js.ts.types.TInterface)4 EObject (org.eclipse.emf.ecore.EObject)3 ENotificationImpl (org.eclipse.emf.ecore.impl.ENotificationImpl)2 TField (org.eclipse.n4js.ts.types.TField)2 Type (org.eclipse.n4js.ts.types.Type)2 TypeRef (org.eclipse.n4js.ts.typeRefs.TypeRef)1 ContainerType (org.eclipse.n4js.ts.types.ContainerType)1 TClassifier (org.eclipse.n4js.ts.types.TClassifier)1 TMember (org.eclipse.n4js.ts.types.TMember)1 TSetter (org.eclipse.n4js.ts.types.TSetter)1 TypeVariable (org.eclipse.n4js.ts.types.TypeVariable)1 RuleEnvironment (org.eclipse.xsemantics.runtime.RuleEnvironment)1