private void buildFields() { // Parse input fields to extract names and lengths Field[] fields = new Field[this.flFields.length]; int totalFieldLenght = 0; for(int i = 0; i < this.flFields.length; i++) { // Extract informations about the field String fieldInfos = this.flFields[i].trim(); // Extract name of the field (before bracket) String fieldName = fieldInfos.substring(0, fieldInfos.lastIndexOf('[')); // Extract length of the field (between brackets) int fieldLength = Integer.parseInt(fieldInfos.substring(fieldInfos.lastIndexOf('[') + 1, fieldInfos.lastIndexOf(']'))); String functionDefinition = fieldInfos.substring(fieldInfos.lastIndexOf(']')+1); if(functionDefinition.length() != 0 && functionDefinition.charAt(0) == FUNCTION_SEPARATOR) { functionDefinition = functionDefinition.substring(1); } StringFunctionExecutor stringFunctionExecutor = null; if(functionDefinition.length() != 0) { stringFunctionExecutor = StringFunctionExecutor.getInstance(functionDefinition); } fields[i] = new Field(fieldName, fieldLength, stringFunctionExecutor); totalFieldLenght += fieldLength; } this.fields = fields; this.totalFieldLenght = totalFieldLenght; } /****************************************************************************
private void buildFields() { // Parse input fields to extract names and lengths Field[] fields = new Field[this.flFields.length]; int totalFieldLenght = 0; for(int i = 0; i < this.flFields.length; i++) { // Extract informations about the field String fieldInfos = this.flFields[i].trim(); // Extract name of the field (before bracket) String fieldName = fieldInfos.substring(0, fieldInfos.lastIndexOf('[')); // Extract length of the field (between brackets) int fieldLength = Integer.parseInt(fieldInfos.substring(fieldInfos.lastIndexOf('[') + 1, fieldInfos.lastIndexOf(']'))); String functionDefinition = fieldInfos.substring(fieldInfos.lastIndexOf(']')+1); if(functionDefinition.length() != 0 && functionDefinition.charAt(0) == FUNCTION_SEPARATOR) { functionDefinition = functionDefinition.substring(1); } StringFunctionExecutor stringFunctionExecutor = null; if(functionDefinition.length() != 0) { stringFunctionExecutor = StringFunctionExecutor.getInstance(functionDefinition); } fields[i] = new Field(fieldName, fieldLength, stringFunctionExecutor); totalFieldLenght += fieldLength; } this.fields = fields; this.totalFieldLenght = totalFieldLenght; } /****************************************************************************
private void buildFields() { // Parse input fields to extract names and lengths Field[] fields = new Field[this.flFields.length]; int totalFieldLenght = 0; for(int i = 0; i < this.flFields.length; i++) { // Extract informations about the field String fieldInfos = this.flFields[i].trim(); // Extract name of the field (before bracket) String fieldName = fieldInfos.substring(0, fieldInfos.lastIndexOf('[')); // Extract length of the field (between brackets) int fieldLength = Integer.parseInt(fieldInfos.substring(fieldInfos.lastIndexOf('[') + 1, fieldInfos.lastIndexOf(']'))); String functionDefinition = fieldInfos.substring(fieldInfos.lastIndexOf(']')+1); if(functionDefinition.length() != 0 && functionDefinition.charAt(0) == FUNCTION_SEPARATOR) { functionDefinition = functionDefinition.substring(1); } StringFunctionExecutor stringFunctionExecutor = null; if(functionDefinition.length() != 0) { stringFunctionExecutor = StringFunctionExecutor.getInstance(functionDefinition); } fields[i] = new Field(fieldName, fieldLength, stringFunctionExecutor); totalFieldLenght += fieldLength; } this.fields = fields; this.totalFieldLenght = totalFieldLenght; } /****************************************************************************