public void writeDefaultMethodCode ( String strMethodName , String strMethodReturns , String strMethodInterface , String strClassName ) { String strBaseClass , strMethodVariables = DBConstants . BLANK ; Record recClassInfo = this . getMainRecord ( ) ; LogicFile recLogicFile = ( LogicFile ) this . getRecord ( LogicFile . LOGIC_FILE_FILE ) ; strBaseClass = recClassInfo . getField ( ClassInfo . BASE_CLASS_NAME ) . getString ( ) ; // Get the base class name strMethodVariables = this . getMethodVariables ( strMethodInterface ) ; if ( strClassName . equals ( strMethodName ) ) { // Call super.NewC initializer if ( strMethodVariables . equalsIgnoreCase ( "VOID" ) ) strMethodVariables = "" ; if ( strMethodInterface . length ( ) == 0 ) m_StreamOut . writeit ( "\tsuper();\n" ) ; else { boolean bSuperFound = false ; if ( ( strMethodReturns . length ( ) == 0 ) || ( strMethodReturns . equalsIgnoreCase ( "void" ) ) ) if ( recLogicFile . getField ( LogicFile . LOGIC_SOURCE ) . getLength ( ) > 0 ) strMethodReturns = strMethodVariables ; // Special case - if you have code, pass the default variables if ( ( strMethodReturns . length ( ) == 0 ) || ( strMethodReturns . equalsIgnoreCase ( "void" ) ) ) m_StreamOut . writeit ( "\tthis();\n\tthis.init(" + strMethodVariables + ");\n" ) ; else { // Special Case - Different variables are passed in, must supply and init method w/the correct interface if ( ! strMethodReturns . equalsIgnoreCase ( "INIT" ) ) { m_StreamOut . writeit ( "\tthis();\n\tthis.init(" + strMethodVariables + ");\n" ) ; m_StreamOut . writeit ( "}\n" ) ; m_strLastMethodInterface = strMethodInterface ; m_strLastMethod = strMethodName ; this . writeMethodInterface ( null , "init" , "void" , strMethodInterface , "" , "Initialize class fields" , null ) ; if ( strMethodReturns . equalsIgnoreCase ( "VOID" ) ) strMethodReturns = "" ; this . writeClassInitialize ( true ) ; } else bSuperFound = true ; // Don't call init.super(); if ( recLogicFile . getField ( LogicFile . LOGIC_SOURCE ) . getString ( ) . length ( ) != 0 ) { m_StreamOut . setTabs ( + 1 ) ; //x bSuperFound = m_MethodsOut.writeit(recLogicFile.getField(LogicFile.LOGIC_SOURCE).getString() + "\n"); bSuperFound = bSuperFound | this . writeTextField ( recLogicFile . getField ( LogicFile . LOGIC_SOURCE ) , strBaseClass , "init" , strMethodReturns , strClassName ) ; m_StreamOut . setTabs ( - 1 ) ; } if ( ! bSuperFound ) m_StreamOut . writeit ( "\tsuper.init(" + strMethodReturns + ");\n" ) ; } } } else { // Call super.NewC if ( ! strMethodName . equals ( "setupSFields" ) ) { String beginString = "" ; if ( strMethodReturns . length ( ) == 0 ) beginString = "return " ; m_StreamOut . writeit ( "\t" + beginString + "super." + strMethodName + "(" + strMethodVariables + ");\n" ) ; } else this . writeSetupSCode ( strMethodName , strMethodReturns , strMethodInterface , strClassName ) ; } }
No code supplied write default code .