public static List < Global > getVariableList ( final List < String > variableCells ) { final List < Global > variableList = new ArrayList < Global > ( ) ; if ( variableCells == null ) return variableList ; for ( String variableCell : variableCells ) { final StringTokenizer tokens = new StringTokenizer ( variableCell , "," ) ; while ( tokens . hasMoreTokens ( ) ) { final String token = tokens . nextToken ( ) ; final Global vars = new Global ( ) ; final StringTokenizer paramTokens = new StringTokenizer ( token , " " ) ; vars . setClassName ( paramTokens . nextToken ( ) ) ; if ( ! paramTokens . hasMoreTokens ( ) ) { throw new DecisionTableParseException ( "The format for global variables is incorrect. " + "It should be: [Class name, Class otherName]. But it was: [" + variableCell + "]" ) ; } vars . setIdentifier ( paramTokens . nextToken ( ) ) ; variableList . add ( vars ) ; } } return variableList ; }
Create a list of Global model objects from cell contents .