use of org.eclipse.xtend.core.macro.declaration.XtendAnnotationReferenceImpl in project xtext-xtend by eclipse.
the class AnnotationReferenceBuildContextImpl method _setValue.
protected void _setValue(final JvmAnnotationAnnotationValue it, final AnnotationReference[] value, final String componentType, final boolean mustBeArray) {
this.checkType(it, componentType, mustBeArray);
for (final AnnotationReference annotationValue : value) {
boolean _matched = false;
if (annotationValue instanceof JvmAnnotationReferenceImpl) {
_matched = true;
it.getValues().add(EcoreUtil2.<JvmAnnotationReference>cloneWithProxies(((JvmAnnotationReferenceImpl) annotationValue).getDelegate()));
}
if (!_matched) {
if (annotationValue instanceof XtendAnnotationReferenceImpl) {
_matched = true;
throw new IllegalArgumentException("Multiple source annotations cannot be set as values. Please the the expression not the value.");
}
}
}
}
use of org.eclipse.xtend.core.macro.declaration.XtendAnnotationReferenceImpl in project xtext-xtend by eclipse.
the class CompilationUnitImpl method toAnnotationReference.
public AnnotationReference toAnnotationReference(final XAnnotation delegate) {
final Function1<XAnnotation, XtendAnnotationReferenceImpl> _function = (XAnnotation it) -> {
XtendAnnotationReferenceImpl _xtendAnnotationReferenceImpl = new XtendAnnotationReferenceImpl();
final Procedure1<XtendAnnotationReferenceImpl> _function_1 = (XtendAnnotationReferenceImpl it_1) -> {
it_1.setDelegate(delegate);
it_1.setCompilationUnit(this);
};
return ObjectExtensions.<XtendAnnotationReferenceImpl>operator_doubleArrow(_xtendAnnotationReferenceImpl, _function_1);
};
return this.<XAnnotation, XtendAnnotationReferenceImpl>getOrCreate(delegate, _function);
}
use of org.eclipse.xtend.core.macro.declaration.XtendAnnotationReferenceImpl 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