Java Code Examples for org.eclipse.xtend.lib.macro.declaration.TypeReference#isAssignableFrom()

The following examples show how to use org.eclipse.xtend.lib.macro.declaration.TypeReference#isAssignableFrom() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PrimitiveTypeImpl.java    From xtext-xtend with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public boolean isAssignableFrom(final Type otherType) {
  if ((otherType == null)) {
    return false;
  }
  final TypeReference thisTypeRef = this.getCompilationUnit().getTypeReferenceProvider().newTypeReference(this);
  final TypeReference thatTypeRef = this.getCompilationUnit().getTypeReferenceProvider().newTypeReference(otherType);
  return thisTypeRef.isAssignableFrom(thatTypeRef);
}
 
Example 2
Source File: JvmTypeDeclarationImpl.java    From xtext-xtend with Eclipse Public License 2.0 5 votes vote down vote up
public boolean isAssignableFrom(final Type otherType) {
  if ((otherType == null)) {
    return false;
  }
  final TypeReference thisTypeRef = this.getCompilationUnit().getTypeReferenceProvider().newTypeReference(((Type) this));
  final TypeReference thatTypeRef = this.getCompilationUnit().getTypeReferenceProvider().newTypeReference(otherType);
  return thisTypeRef.isAssignableFrom(thatTypeRef);
}
 
Example 3
Source File: TypeParameterDeclarationImpl.java    From xtext-xtend with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public boolean isAssignableFrom(final Type otherType) {
  if ((otherType == null)) {
    return false;
  }
  final TypeReference thisTypeRef = this.getCompilationUnit().getTypeReferenceProvider().newTypeReference(this);
  final TypeReference thatTypeRef = this.getCompilationUnit().getTypeReferenceProvider().newTypeReference(otherType);
  return thisTypeRef.isAssignableFrom(thatTypeRef);
}
 
Example 4
Source File: XtendTypeParameterDeclarationImpl.java    From xtext-xtend with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public boolean isAssignableFrom(final Type otherType) {
  if ((otherType == null)) {
    return false;
  }
  final TypeReference thisTypeRef = this.getCompilationUnit().getTypeReferenceProvider().newTypeReference(this);
  final TypeReference thatTypeRef = this.getCompilationUnit().getTypeReferenceProvider().newTypeReference(otherType);
  return thisTypeRef.isAssignableFrom(thatTypeRef);
}
 
Example 5
Source File: XtendTypeDeclarationImpl.java    From xtext-xtend with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public boolean isAssignableFrom(final Type otherType) {
  if ((otherType == null)) {
    return false;
  }
  final TypeReference thisTypeRef = this.getCompilationUnit().getTypeReferenceProvider().newTypeReference(this);
  final TypeReference thatTypeRef = this.getCompilationUnit().getTypeReferenceProvider().newTypeReference(otherType);
  return thisTypeRef.isAssignableFrom(thatTypeRef);
}
 
Example 6
Source File: VoidTypeImpl.java    From xtext-xtend with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public boolean isAssignableFrom(final Type otherType) {
  if ((otherType == null)) {
    return false;
  }
  final TypeReference thisTypeRef = this.getCompilationUnit().getTypeReferenceProvider().newTypeReference(this);
  final TypeReference thatTypeRef = this.getCompilationUnit().getTypeReferenceProvider().newTypeReference(otherType);
  return thisTypeRef.isAssignableFrom(thatTypeRef);
}
 
Example 7
Source File: JvmTypeParameterDeclarationImpl.java    From xtext-xtend with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public boolean isAssignableFrom(final Type otherType) {
  if ((otherType == null)) {
    return false;
  }
  final TypeReference thisTypeRef = this.getCompilationUnit().getTypeReferenceProvider().newTypeReference(this);
  final TypeReference thatTypeRef = this.getCompilationUnit().getTypeReferenceProvider().newTypeReference(otherType);
  return thisTypeRef.isAssignableFrom(thatTypeRef);
}
 
Example 8
Source File: TypeReferenceAssignabilityTest.java    From xtext-xtend with Eclipse Public License 2.0 4 votes vote down vote up
public boolean doIsAssignable(final TypeReference lhs, final TypeReference rhs) {
  return lhs.isAssignableFrom(rhs);
}