protected boolean generateEnumerationDeclaration ( SarlEnumeration enumeration , PyAppendable it , IExtraLanguageGeneratorContext context ) { if ( ! Strings . isEmpty ( enumeration . getName ( ) ) ) { it . append ( "class " ) . append ( enumeration . getName ( ) ) ; //$NON-NLS-1$ it . append ( "(Enum" ) ; //$NON-NLS-1$ it . append ( newType ( "enum.Enum" ) ) ; //$NON-NLS-1$ it . append ( "):" ) ; //$NON-NLS-1$ it . increaseIndentation ( ) . newLine ( ) ; generateDocString ( getTypeBuilder ( ) . getDocumentation ( enumeration ) , it ) ; int i = 0 ; for ( final XtendMember item : enumeration . getMembers ( ) ) { if ( context . getCancelIndicator ( ) . isCanceled ( ) ) { return false ; } if ( item instanceof XtendEnumLiteral ) { final XtendEnumLiteral literal = ( XtendEnumLiteral ) item ; it . append ( literal . getName ( ) ) . append ( " = " ) ; //$NON-NLS-1$ it . append ( Integer . toString ( i ) ) ; it . newLine ( ) ; ++ i ; } } // it . decreaseIndentation ( ) . newLine ( ) . newLine ( ) ; return true ; } return false ; }
Generate the given enumeration declaration .