use of org.eclipse.n4js.ts.types.TMember in project n4js by eclipse.
the class ProjectComparisonEntry method isInherited.
public boolean isInherited() {
final EObject implParent = parent != null ? parent.getElementAPI() : null;
final EObject impl = getElementAPI();
if (implParent instanceof ContainerType<?> && impl instanceof TMember) {
return impl.eContainer() != implParent;
}
return false;
}
use of org.eclipse.n4js.ts.types.TMember in project n4js by eclipse.
the class PropertyMethodDeclarationImpl method getDefinedTypeElement.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public TMember getDefinedTypeElement() {
TMember _xifexpression = null;
Type _definedType = this.getDefinedType();
boolean _tripleEquals = (_definedType == null);
if (_tripleEquals) {
_xifexpression = null;
} else {
TMember _xifexpression_1 = null;
Type _definedType_1 = this.getDefinedType();
if ((_definedType_1 instanceof TMember)) {
Type _definedType_2 = this.getDefinedType();
_xifexpression_1 = ((TMember) _definedType_2);
} else {
throw new IllegalArgumentException("");
}
_xifexpression = _xifexpression_1;
}
return _xifexpression;
}
use of org.eclipse.n4js.ts.types.TMember in project n4js by eclipse.
the class N4MethodDeclarationImpl method getDefinedTypeElement.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public TMember getDefinedTypeElement() {
TMember _xifexpression = null;
Type _definedType = this.getDefinedType();
boolean _tripleEquals = (_definedType == null);
if (_tripleEquals) {
_xifexpression = null;
} else {
TMember _xifexpression_1 = null;
Type _definedType_1 = this.getDefinedType();
if ((_definedType_1 instanceof TMember)) {
Type _definedType_2 = this.getDefinedType();
_xifexpression_1 = ((TMember) _definedType_2);
} else {
throw new IllegalArgumentException("");
}
_xifexpression = _xifexpression_1;
}
return _xifexpression;
}
use of org.eclipse.n4js.ts.types.TMember in project n4js by eclipse.
the class N4JSASTUtils method getOwnOrSuperCtor.
private static TMember getOwnOrSuperCtor(final ContainerType<?> ownerOfField) {
TClass klass = (TClass) (ownerOfField instanceof TClass ? ownerOfField : null);
while (null != klass) {
final TMember ctor = klass.findOwnedMember(CONSTRUCTOR);
if (null != ctor) {
return ctor;
}
final ParameterizedTypeRef superClassRef = klass.getSuperClassRef();
if (null == superClassRef) {
klass = null;
} else {
final Type declaredType = superClassRef.getDeclaredType();
klass = (TClass) (declaredType instanceof TClass ? declaredType : null);
}
}
return null;
}
use of org.eclipse.n4js.ts.types.TMember in project n4js by eclipse.
the class N4JSResourceDescription method getCrossRefTypeAcceptor.
private IAcceptor<EObject> getCrossRefTypeAcceptor(final Set<EObject> crossRefTypesAddHere) {
IAcceptor<EObject> acceptor = new IAcceptor<EObject>() {
@Override
public void accept(EObject to) {
if (to instanceof Type || to instanceof TVariable || to instanceof TEnumLiteral) {
crossRefTypesAddHere.add(to);
}
// Add declared type of a field to cross ref types
if (to instanceof TFunction) {
TypeRef returnTypeRef = ((TFunction) to).getReturnTypeRef();
crossRefTypesAddHere.add(returnTypeRef.getDeclaredType());
}
if (to instanceof TField) {
TypeRef typeRef = ((TField) to).getTypeRef();
crossRefTypesAddHere.add(typeRef.getDeclaredType());
}
// In case of TMember, add the containing type as well
if (to instanceof TMember) {
TMember casted = (TMember) to;
ContainerType<?> declaringType = casted.getContainingType();
crossRefTypesAddHere.add(declaringType);
}
}
};
return acceptor;
}
Aggregations