Search in sources :

Example 1 with JvmTypeParameterDeclarationImpl

use of org.eclipse.xtend.core.macro.declaration.JvmTypeParameterDeclarationImpl in project xtext-xtend by eclipse.

the class CompilationUnitImpl method toTypeParameterDeclaration.

public TypeParameterDeclaration toTypeParameterDeclaration(final JvmTypeParameter delegate) {
    final Function1<JvmTypeParameter, JvmTypeParameterDeclarationImpl> _function = (JvmTypeParameter it) -> {
        JvmTypeParameterDeclarationImpl _xifexpression = null;
        boolean _isBelongedToCompilationUnit = this.isBelongedToCompilationUnit(delegate);
        if (_isBelongedToCompilationUnit) {
            MutableJvmTypeParameterDeclarationImpl _mutableJvmTypeParameterDeclarationImpl = new MutableJvmTypeParameterDeclarationImpl();
            final Procedure1<MutableJvmTypeParameterDeclarationImpl> _function_1 = (MutableJvmTypeParameterDeclarationImpl it_1) -> {
                it_1.setDelegate(delegate);
                it_1.setCompilationUnit(this);
            };
            _xifexpression = ObjectExtensions.<MutableJvmTypeParameterDeclarationImpl>operator_doubleArrow(_mutableJvmTypeParameterDeclarationImpl, _function_1);
        } else {
            JvmTypeParameterDeclarationImpl _jvmTypeParameterDeclarationImpl = new JvmTypeParameterDeclarationImpl();
            final Procedure1<JvmTypeParameterDeclarationImpl> _function_2 = (JvmTypeParameterDeclarationImpl it_1) -> {
                it_1.setDelegate(delegate);
                it_1.setCompilationUnit(this);
            };
            _xifexpression = ObjectExtensions.<JvmTypeParameterDeclarationImpl>operator_doubleArrow(_jvmTypeParameterDeclarationImpl, _function_2);
        }
        return _xifexpression;
    };
    return this.<JvmTypeParameter, JvmTypeParameterDeclarationImpl>getOrCreate(delegate, _function);
}
Also used : MutableJvmTypeParameterDeclarationImpl(org.eclipse.xtend.core.macro.declaration.MutableJvmTypeParameterDeclarationImpl) JvmTypeParameterDeclarationImpl(org.eclipse.xtend.core.macro.declaration.JvmTypeParameterDeclarationImpl) JvmTypeParameter(org.eclipse.xtext.common.types.JvmTypeParameter) Procedure1(org.eclipse.xtext.xbase.lib.Procedures.Procedure1) MutableJvmTypeParameterDeclarationImpl(org.eclipse.xtend.core.macro.declaration.MutableJvmTypeParameterDeclarationImpl)

Example 2 with JvmTypeParameterDeclarationImpl

use of org.eclipse.xtend.core.macro.declaration.JvmTypeParameterDeclarationImpl in project xtext-xtend by eclipse.

the class TracabilityImpl method isGenerated.

@Override
public boolean isGenerated(final Element element) {
    boolean _switchResult = false;
    boolean _matched = false;
    if (element instanceof JvmElementImpl) {
        _matched = true;
        Resource _eResource = ((JvmElementImpl<?>) element).getDelegate().eResource();
        Resource _eResource_1 = this.unit.getXtendFile().eResource();
        return Objects.equal(_eResource, _eResource_1);
    }
    if (!_matched) {
        if (element instanceof JvmTypeParameterDeclarationImpl) {
            _matched = true;
            Resource _eResource = ((JvmTypeParameterDeclarationImpl) element).getDelegate().eResource();
            Resource _eResource_1 = this.unit.getXtendFile().eResource();
            return Objects.equal(_eResource, _eResource_1);
        }
    }
    if (!_matched) {
        _switchResult = false;
    }
    return _switchResult;
}
Also used : JvmTypeParameterDeclarationImpl(org.eclipse.xtend.core.macro.declaration.JvmTypeParameterDeclarationImpl) Resource(org.eclipse.emf.ecore.resource.Resource) JvmElementImpl(org.eclipse.xtend.core.macro.declaration.JvmElementImpl)

Aggregations

JvmTypeParameterDeclarationImpl (org.eclipse.xtend.core.macro.declaration.JvmTypeParameterDeclarationImpl)2 Resource (org.eclipse.emf.ecore.resource.Resource)1 JvmElementImpl (org.eclipse.xtend.core.macro.declaration.JvmElementImpl)1 MutableJvmTypeParameterDeclarationImpl (org.eclipse.xtend.core.macro.declaration.MutableJvmTypeParameterDeclarationImpl)1 JvmTypeParameter (org.eclipse.xtext.common.types.JvmTypeParameter)1 Procedure1 (org.eclipse.xtext.xbase.lib.Procedures.Procedure1)1