use of org.eclipse.xtend.core.macro.declaration.TypeReferenceImpl in project xtext-xtend by eclipse.
the class CompilationUnitImpl method toJvmTypeReference.
public JvmTypeReference toJvmTypeReference(final TypeReference typeRef) {
this.checkCanceled();
JvmTypeReference _switchResult = null;
boolean _matched = false;
if (typeRef instanceof TypeReferenceImpl) {
_matched = true;
_switchResult = ((TypeReferenceImpl) typeRef).getLightweightTypeReference().toJavaCompliantTypeReference();
}
if (!_matched) {
if (typeRef instanceof InferredTypeReferenceImpl) {
_matched = true;
_switchResult = EcoreUtil.<XComputedTypeReferenceImplCustom>copy(((InferredTypeReferenceImpl) typeRef).getDelegate());
}
}
return _switchResult;
}
use of org.eclipse.xtend.core.macro.declaration.TypeReferenceImpl in project xtext-xtend by eclipse.
the class AssociatorImpl method setPrimarySourceElement.
@Override
public void setPrimarySourceElement(final MutableElement javaElement, final Element sourceElement) {
final Element primarySourceElement = this.unit.getTracability().getPrimarySourceElement(sourceElement);
EObject _switchResult = null;
boolean _matched = false;
if (primarySourceElement instanceof TypeReferenceImpl) {
_matched = true;
_switchResult = ((TypeReferenceImpl) primarySourceElement).getSource();
}
if (!_matched) {
if (primarySourceElement instanceof AbstractElementImpl) {
_matched = true;
_switchResult = ((AbstractElementImpl<?>) primarySourceElement).getDelegate();
}
}
final EObject delegate = _switchResult;
this.unit.getJvmModelAssociator().associate(delegate, ((AbstractElementImpl<?>) javaElement).getDelegate());
}
use of org.eclipse.xtend.core.macro.declaration.TypeReferenceImpl in project xtext-xtend by eclipse.
the class CompilationUnitImpl method toTypeReference.
public TypeReference toTypeReference(final LightweightTypeReference delegate, final JvmTypeReference source) {
TypeReferenceImpl _xblockexpression = null;
{
this.checkCanceled();
if ((delegate == null)) {
return null;
}
TypeReferenceImpl _typeReferenceImpl = new TypeReferenceImpl();
final Procedure1<TypeReferenceImpl> _function = (TypeReferenceImpl it) -> {
it.setDelegate(delegate);
it.setCompilationUnit(this);
it.setSource(source);
};
_xblockexpression = ObjectExtensions.<TypeReferenceImpl>operator_doubleArrow(_typeReferenceImpl, _function);
}
return _xblockexpression;
}
use of org.eclipse.xtend.core.macro.declaration.TypeReferenceImpl in project xtext-xtend by eclipse.
the class CompilationUnitImpl method toLightweightTypeReference.
public LightweightTypeReference toLightweightTypeReference(final TypeReference typeRef) {
this.checkCanceled();
LightweightTypeReference _switchResult = null;
boolean _matched = false;
if (typeRef instanceof TypeReferenceImpl) {
_matched = true;
_switchResult = ((TypeReferenceImpl) typeRef).getLightweightTypeReference();
}
if (!_matched) {
if (typeRef instanceof InferredTypeReferenceImpl) {
_matched = true;
_switchResult = ((InferredTypeReferenceImpl) typeRef).getLightweightTypeReference();
}
}
return _switchResult;
}
use of org.eclipse.xtend.core.macro.declaration.TypeReferenceImpl in project xtext-xtend by eclipse.
the class TracabilityImpl method isSource.
@Override
public boolean isSource(final Element element) {
boolean _switchResult = false;
boolean _matched = false;
if (element instanceof XtendNamedElementImpl) {
_matched = true;
_switchResult = true;
}
if (!_matched) {
if (element instanceof XtendAnnotationReferenceImpl) {
_matched = true;
_switchResult = true;
}
}
if (!_matched) {
if (element instanceof Expression) {
_matched = true;
_switchResult = true;
}
}
if (!_matched) {
if (element instanceof TypeReferenceImpl) {
JvmTypeReference _source = ((TypeReferenceImpl) element).getSource();
boolean _tripleNotEquals = (_source != null);
if (_tripleNotEquals) {
_matched = true;
_switchResult = true;
}
}
}
if (!_matched) {
_switchResult = false;
}
return _switchResult;
}
Aggregations