private String wrappedMapping ( boolean makeDest , NullPointerControl npc , MappingType mtd , MappingType mts ) { String sClass = source . getName ( ) ; String dClass = destination . getName ( ) ; String str = ( makeDest ? " " + sClass + " " + stringOfGetSource + " = (" + sClass + ") $1;" : " " + dClass + " " + stringOfGetDestination + " = (" + dClass + ") $1;" + newLine + " " + sClass + " " + stringOfGetSource + " = (" + sClass + ") $2;" ) + newLine ; switch ( npc ) { case SOURCE : str += "if(" + stringOfGetSource + "!=null){" + newLine ; break ; case DESTINATION : str += "if(" + stringOfGetDestination + "!=null){" + newLine ; break ; case ALL : str += "if(" + stringOfGetSource + "!=null && " + stringOfGetDestination + "!=null){" + newLine ; break ; default : break ; } str += mapping ( makeDest , mtd , mts ) + newLine + " return " + stringOfSetDestination + ";" + newLine ; return ( npc != NOT_ANY ) ? str += "}" + newLine + " return null;" + newLine : str ; }
This method adds the Null Pointer Control to mapping created by the mapping method . wrapMapping is used to wrap the mapping returned by mapping method .