protected XAbstractFeatureCall doGetRootTypeLiteral(XMemberFeatureCall featureCall) { boolean staticNotation = featureCall.isExplicitStatic(); XMemberFeatureCall current = featureCall; while(current.eContainingFeature() == XbasePackage.Literals.XMEMBER_FEATURE_CALL__MEMBER_CALL_TARGET) { XMemberFeatureCall container = (XMemberFeatureCall) current.eContainer(); if (container.isExplicitStatic()) { if (staticNotation == false) { return current; } current = container; } else if (staticNotation) { return (XAbstractFeatureCall) current.getMemberCallTarget(); } else { current = container; } } if (current != featureCall && staticNotation) { return (XAbstractFeatureCall) current.getMemberCallTarget(); } return null; }
private XMemberFeatureCall getLongestTypeLiteralCandidate(XMemberFeatureCall current, boolean mustBeStatic) { if (current.eContainingFeature() == XbasePackage.Literals.XMEMBER_FEATURE_CALL__MEMBER_CALL_TARGET) { XMemberFeatureCall container = (XMemberFeatureCall) current.eContainer(); if (canBeTypeLiteral(container)) { if (!mustBeStatic && !container.isExplicitStatic()) { return null; } if (mustBeStatic != container.isExplicitStatic()) { return current; } if (mustBeStatic && container.eContainingFeature() != XbasePackage.Literals.XMEMBER_FEATURE_CALL__MEMBER_CALL_TARGET) { return current; } return getLongestTypeLiteralCandidate(container, mustBeStatic); } } if (mustBeStatic) { return null; } if (!mustBeStatic && !current.isExplicitStatic()) { return null; } return current; }