Search in sources :

Example 1 with MutableJvmClassDeclarationImpl

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

the class CompilationUnitImpl method toTypeDeclaration.

public TypeDeclaration toTypeDeclaration(final JvmDeclaredType delegate) {
    final Function1<JvmDeclaredType, TypeDeclaration> _function = (JvmDeclaredType it) -> {
        JvmTypeDeclarationImpl<? extends JvmDeclaredType> _switchResult = null;
        boolean _matched = false;
        if (delegate instanceof JvmGenericType) {
            boolean _isInterface = ((JvmGenericType) delegate).isInterface();
            if (_isInterface) {
                _matched = true;
                JvmInterfaceDeclarationImpl _xifexpression = null;
                boolean _isBelongedToCompilationUnit = this.isBelongedToCompilationUnit(delegate);
                if (_isBelongedToCompilationUnit) {
                    MutableJvmInterfaceDeclarationImpl _mutableJvmInterfaceDeclarationImpl = new MutableJvmInterfaceDeclarationImpl();
                    final Procedure1<MutableJvmInterfaceDeclarationImpl> _function_1 = (MutableJvmInterfaceDeclarationImpl it_1) -> {
                        it_1.setDelegate(((JvmGenericType) delegate));
                        it_1.setCompilationUnit(this);
                    };
                    _xifexpression = ObjectExtensions.<MutableJvmInterfaceDeclarationImpl>operator_doubleArrow(_mutableJvmInterfaceDeclarationImpl, _function_1);
                } else {
                    JvmInterfaceDeclarationImpl _jvmInterfaceDeclarationImpl = new JvmInterfaceDeclarationImpl();
                    final Procedure1<JvmInterfaceDeclarationImpl> _function_2 = (JvmInterfaceDeclarationImpl it_1) -> {
                        it_1.setDelegate(((JvmGenericType) delegate));
                        it_1.setCompilationUnit(this);
                    };
                    _xifexpression = ObjectExtensions.<JvmInterfaceDeclarationImpl>operator_doubleArrow(_jvmInterfaceDeclarationImpl, _function_2);
                }
                _switchResult = _xifexpression;
            }
        }
        if (!_matched) {
            if (delegate instanceof JvmGenericType) {
                _matched = true;
                JvmClassDeclarationImpl _xifexpression = null;
                boolean _isBelongedToCompilationUnit = this.isBelongedToCompilationUnit(delegate);
                if (_isBelongedToCompilationUnit) {
                    MutableJvmClassDeclarationImpl _mutableJvmClassDeclarationImpl = new MutableJvmClassDeclarationImpl();
                    final Procedure1<MutableJvmClassDeclarationImpl> _function_1 = (MutableJvmClassDeclarationImpl it_1) -> {
                        it_1.setDelegate(((JvmGenericType) delegate));
                        it_1.setCompilationUnit(this);
                    };
                    _xifexpression = ObjectExtensions.<MutableJvmClassDeclarationImpl>operator_doubleArrow(_mutableJvmClassDeclarationImpl, _function_1);
                } else {
                    JvmClassDeclarationImpl _jvmClassDeclarationImpl = new JvmClassDeclarationImpl();
                    final Procedure1<JvmClassDeclarationImpl> _function_2 = (JvmClassDeclarationImpl it_1) -> {
                        it_1.setDelegate(((JvmGenericType) delegate));
                        it_1.setCompilationUnit(this);
                    };
                    _xifexpression = ObjectExtensions.<JvmClassDeclarationImpl>operator_doubleArrow(_jvmClassDeclarationImpl, _function_2);
                }
                _switchResult = _xifexpression;
            }
        }
        if (!_matched) {
            if (delegate instanceof JvmAnnotationType) {
                _matched = true;
                JvmAnnotationTypeDeclarationImpl _xifexpression = null;
                boolean _isBelongedToCompilationUnit = this.isBelongedToCompilationUnit(delegate);
                if (_isBelongedToCompilationUnit) {
                    MutableJvmAnnotationTypeDeclarationImpl _mutableJvmAnnotationTypeDeclarationImpl = new MutableJvmAnnotationTypeDeclarationImpl();
                    final Procedure1<MutableJvmAnnotationTypeDeclarationImpl> _function_1 = (MutableJvmAnnotationTypeDeclarationImpl it_1) -> {
                        it_1.setDelegate(((JvmAnnotationType) delegate));
                        it_1.setCompilationUnit(this);
                    };
                    _xifexpression = ObjectExtensions.<MutableJvmAnnotationTypeDeclarationImpl>operator_doubleArrow(_mutableJvmAnnotationTypeDeclarationImpl, _function_1);
                } else {
                    JvmAnnotationTypeDeclarationImpl _jvmAnnotationTypeDeclarationImpl = new JvmAnnotationTypeDeclarationImpl();
                    final Procedure1<JvmAnnotationTypeDeclarationImpl> _function_2 = (JvmAnnotationTypeDeclarationImpl it_1) -> {
                        it_1.setDelegate(((JvmAnnotationType) delegate));
                        it_1.setCompilationUnit(this);
                    };
                    _xifexpression = ObjectExtensions.<JvmAnnotationTypeDeclarationImpl>operator_doubleArrow(_jvmAnnotationTypeDeclarationImpl, _function_2);
                }
                _switchResult = _xifexpression;
            }
        }
        if (!_matched) {
            if (delegate instanceof JvmEnumerationType) {
                _matched = true;
                JvmEnumerationTypeDeclarationImpl _xifexpression = null;
                boolean _isBelongedToCompilationUnit = this.isBelongedToCompilationUnit(delegate);
                if (_isBelongedToCompilationUnit) {
                    MutableJvmEnumerationTypeDeclarationImpl _mutableJvmEnumerationTypeDeclarationImpl = new MutableJvmEnumerationTypeDeclarationImpl();
                    final Procedure1<MutableJvmEnumerationTypeDeclarationImpl> _function_1 = (MutableJvmEnumerationTypeDeclarationImpl it_1) -> {
                        it_1.setDelegate(((JvmEnumerationType) delegate));
                        it_1.setCompilationUnit(this);
                    };
                    _xifexpression = ObjectExtensions.<MutableJvmEnumerationTypeDeclarationImpl>operator_doubleArrow(_mutableJvmEnumerationTypeDeclarationImpl, _function_1);
                } else {
                    JvmEnumerationTypeDeclarationImpl _jvmEnumerationTypeDeclarationImpl = new JvmEnumerationTypeDeclarationImpl();
                    final Procedure1<JvmEnumerationTypeDeclarationImpl> _function_2 = (JvmEnumerationTypeDeclarationImpl it_1) -> {
                        it_1.setDelegate(((JvmEnumerationType) delegate));
                        it_1.setCompilationUnit(this);
                    };
                    _xifexpression = ObjectExtensions.<JvmEnumerationTypeDeclarationImpl>operator_doubleArrow(_jvmEnumerationTypeDeclarationImpl, _function_2);
                }
                _switchResult = _xifexpression;
            }
        }
        return ((TypeDeclaration) _switchResult);
    };
    return this.<JvmDeclaredType, TypeDeclaration>getOrCreate(delegate, _function);
}
Also used : JvmAnnotationType(org.eclipse.xtext.common.types.JvmAnnotationType) JvmAnnotationTypeDeclarationImpl(org.eclipse.xtend.core.macro.declaration.JvmAnnotationTypeDeclarationImpl) MutableJvmAnnotationTypeDeclarationImpl(org.eclipse.xtend.core.macro.declaration.MutableJvmAnnotationTypeDeclarationImpl) JvmGenericType(org.eclipse.xtext.common.types.JvmGenericType) JvmDeclaredType(org.eclipse.xtext.common.types.JvmDeclaredType) MutableJvmInterfaceDeclarationImpl(org.eclipse.xtend.core.macro.declaration.MutableJvmInterfaceDeclarationImpl) MutableJvmAnnotationTypeDeclarationImpl(org.eclipse.xtend.core.macro.declaration.MutableJvmAnnotationTypeDeclarationImpl) JvmTypeDeclarationImpl(org.eclipse.xtend.core.macro.declaration.JvmTypeDeclarationImpl) Procedure1(org.eclipse.xtext.xbase.lib.Procedures.Procedure1) JvmClassDeclarationImpl(org.eclipse.xtend.core.macro.declaration.JvmClassDeclarationImpl) MutableJvmClassDeclarationImpl(org.eclipse.xtend.core.macro.declaration.MutableJvmClassDeclarationImpl) MutableJvmInterfaceDeclarationImpl(org.eclipse.xtend.core.macro.declaration.MutableJvmInterfaceDeclarationImpl) JvmInterfaceDeclarationImpl(org.eclipse.xtend.core.macro.declaration.JvmInterfaceDeclarationImpl) MutableJvmClassDeclarationImpl(org.eclipse.xtend.core.macro.declaration.MutableJvmClassDeclarationImpl) JvmEnumerationType(org.eclipse.xtext.common.types.JvmEnumerationType) XtendTypeDeclaration(org.eclipse.xtend.core.xtend.XtendTypeDeclaration) TypeDeclaration(org.eclipse.xtend.lib.macro.declaration.TypeDeclaration) MutableJvmEnumerationTypeDeclarationImpl(org.eclipse.xtend.core.macro.declaration.MutableJvmEnumerationTypeDeclarationImpl) MutableJvmEnumerationTypeDeclarationImpl(org.eclipse.xtend.core.macro.declaration.MutableJvmEnumerationTypeDeclarationImpl) JvmEnumerationTypeDeclarationImpl(org.eclipse.xtend.core.macro.declaration.JvmEnumerationTypeDeclarationImpl)

Aggregations

JvmAnnotationTypeDeclarationImpl (org.eclipse.xtend.core.macro.declaration.JvmAnnotationTypeDeclarationImpl)1 JvmClassDeclarationImpl (org.eclipse.xtend.core.macro.declaration.JvmClassDeclarationImpl)1 JvmEnumerationTypeDeclarationImpl (org.eclipse.xtend.core.macro.declaration.JvmEnumerationTypeDeclarationImpl)1 JvmInterfaceDeclarationImpl (org.eclipse.xtend.core.macro.declaration.JvmInterfaceDeclarationImpl)1 JvmTypeDeclarationImpl (org.eclipse.xtend.core.macro.declaration.JvmTypeDeclarationImpl)1 MutableJvmAnnotationTypeDeclarationImpl (org.eclipse.xtend.core.macro.declaration.MutableJvmAnnotationTypeDeclarationImpl)1 MutableJvmClassDeclarationImpl (org.eclipse.xtend.core.macro.declaration.MutableJvmClassDeclarationImpl)1 MutableJvmEnumerationTypeDeclarationImpl (org.eclipse.xtend.core.macro.declaration.MutableJvmEnumerationTypeDeclarationImpl)1 MutableJvmInterfaceDeclarationImpl (org.eclipse.xtend.core.macro.declaration.MutableJvmInterfaceDeclarationImpl)1 XtendTypeDeclaration (org.eclipse.xtend.core.xtend.XtendTypeDeclaration)1 TypeDeclaration (org.eclipse.xtend.lib.macro.declaration.TypeDeclaration)1 JvmAnnotationType (org.eclipse.xtext.common.types.JvmAnnotationType)1 JvmDeclaredType (org.eclipse.xtext.common.types.JvmDeclaredType)1 JvmEnumerationType (org.eclipse.xtext.common.types.JvmEnumerationType)1 JvmGenericType (org.eclipse.xtext.common.types.JvmGenericType)1 Procedure1 (org.eclipse.xtext.xbase.lib.Procedures.Procedure1)1