-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Standardise String/Constant conversion CodeGen enhancements
Standardised JRecord-Constant - String Conversion also add support the Conversion of JRecord-Constants to/from JRecord-constant as a String for use in Code generation (CodeGen). Adding support for Generating Message processing exaples in Code gen Improved support for String lines in CodeGen generated code
- Loading branch information
Showing
43 changed files
with
3,834 additions
and
2,075 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
70 changes: 35 additions & 35 deletions
70
Source/JRecord_Project/JRecord/src/main/java/net/sf/JRecord/IO/ListLineWriter.java
100644 → 100755
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,35 @@ | ||
package net.sf.JRecord.IO; | ||
|
||
import java.io.IOException; | ||
import java.io.OutputStream; | ||
import java.util.ArrayList; | ||
|
||
import net.sf.JRecord.Details.AbstractLine; | ||
|
||
|
||
/** | ||
* Write `Lines` to a list | ||
* @author Bruce Martin | ||
* | ||
*/ | ||
public class ListLineWriter extends AbstractLineWriter { | ||
|
||
private final ArrayList<AbstractLine> lines = new ArrayList<AbstractLine>(); | ||
@Override | ||
public void open(OutputStream outputStream) throws IOException { | ||
lines.clear(); | ||
} | ||
|
||
@Override | ||
public void write(AbstractLine line) throws IOException { | ||
lines.add(line); | ||
} | ||
|
||
@Override | ||
public void close() throws IOException { } | ||
|
||
public ArrayList<AbstractLine> getLines() { | ||
return lines; | ||
} | ||
|
||
} | ||
package net.sf.JRecord.IO; | ||
|
||
import java.io.IOException; | ||
import java.io.OutputStream; | ||
import java.util.ArrayList; | ||
|
||
import net.sf.JRecord.Details.AbstractLine; | ||
|
||
|
||
/** | ||
* Write `Lines` to a list | ||
* @author Bruce Martin | ||
* | ||
*/ | ||
public class ListLineWriter extends AbstractLineWriter { | ||
|
||
private final ArrayList<AbstractLine> lines = new ArrayList<AbstractLine>(); | ||
@Override | ||
public void open(OutputStream outputStream) throws IOException { | ||
lines.clear(); | ||
} | ||
|
||
@Override | ||
public void write(AbstractLine line) throws IOException { | ||
lines.add(line); | ||
} | ||
|
||
@Override | ||
public void close() throws IOException { } | ||
|
||
public ArrayList<AbstractLine> getLines() { | ||
return lines; | ||
} | ||
|
||
} |
88 changes: 44 additions & 44 deletions
88
Source/JRecord_Project/JRecord/src/main/java/net/sf/JRecord/IO/SingleLineReader.java
100644 → 100755
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,44 @@ | ||
package net.sf.JRecord.IO; | ||
|
||
import java.io.IOException; | ||
import java.io.InputStream; | ||
|
||
import net.sf.JRecord.Details.AbstractLine; | ||
import net.sf.JRecord.Details.LayoutDetail; | ||
|
||
/** | ||
* C | ||
* @author Bruce Martin | ||
* | ||
*/ | ||
public class SingleLineReader extends AbstractLineReader { | ||
|
||
private AbstractLine line; | ||
|
||
public SingleLineReader(AbstractLine line) { | ||
setLine(line); | ||
} | ||
|
||
public void setLine(AbstractLine line) { | ||
this.line = line; | ||
super.setLayout(line.getLayout()); | ||
} | ||
|
||
@Override | ||
public void open(InputStream inputStream, LayoutDetail pLayout) throws IOException { | ||
|
||
} | ||
|
||
@Override | ||
public AbstractLine readImplementation() throws IOException { | ||
AbstractLine ret = line; | ||
line = null; | ||
return ret; | ||
} | ||
|
||
@Override | ||
public void close() throws IOException { | ||
line = null; | ||
} | ||
|
||
} | ||
package net.sf.JRecord.IO; | ||
|
||
import java.io.IOException; | ||
import java.io.InputStream; | ||
|
||
import net.sf.JRecord.Details.AbstractLine; | ||
import net.sf.JRecord.Details.LayoutDetail; | ||
|
||
/** | ||
* C | ||
* @author Bruce Martin | ||
* | ||
*/ | ||
public class SingleLineReader extends AbstractLineReader { | ||
|
||
private AbstractLine line; | ||
|
||
public SingleLineReader(AbstractLine line) { | ||
setLine(line); | ||
} | ||
|
||
public void setLine(AbstractLine line) { | ||
this.line = line; | ||
super.setLayout(line.getLayout()); | ||
} | ||
|
||
@Override | ||
public void open(InputStream inputStream, LayoutDetail pLayout) throws IOException { | ||
|
||
} | ||
|
||
@Override | ||
public AbstractLine readImplementation() throws IOException { | ||
AbstractLine ret = line; | ||
line = null; | ||
return ret; | ||
} | ||
|
||
@Override | ||
public void close() throws IOException { | ||
line = null; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
130 changes: 65 additions & 65 deletions
130
...ct/JRecord/src/main/java/net/sf/JRecord/IO/builders/CreateExternalFromCb2xmlCopybook.java
100644 → 100755
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,65 +1,65 @@ | ||
/* ------------------------------------------------------------------------- | ||
* | ||
* Project: JRecord | ||
* | ||
* Sub-Project purpose: Provide support for reading Cobol-Data files | ||
* using a Cobol Copybook in Java. | ||
* Support for reading Fixed Width / Binary / Csv files | ||
* using a Xml schema. | ||
* General Fixed Width / Csv file processing in Java. | ||
* | ||
* Author: Bruce Martin | ||
* | ||
* License: LGPL 2.1 or latter | ||
* | ||
* Copyright (c) 2016, Bruce Martin, All Rights Reserved. | ||
* | ||
* This library is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU Lesser General Public | ||
* License as published by the Free Software Foundation; either | ||
* version 2.1 of the License, or (at your option) any later version. | ||
* | ||
* This library is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Lesser General Public License for more details. | ||
* | ||
* ------------------------------------------------------------------------ */ | ||
|
||
package net.sf.JRecord.IO.builders; | ||
|
||
import net.sf.JRecord.Common.Conversion; | ||
import net.sf.JRecord.Common.RecordException; | ||
import net.sf.JRecord.External.CobolCopybookLoader; | ||
import net.sf.JRecord.External.ExternalRecord; | ||
import net.sf.JRecord.External.ICopybookLoaderStream; | ||
import net.sf.cb2xml.def.ICopybookJrUpd; | ||
|
||
public class CreateExternalFromCb2xmlCopybook extends CreateExternalBase implements ICreateExternal { | ||
|
||
private final ICopybookJrUpd copybook; | ||
// private final CblIOBuilderMultiSchema parent; | ||
|
||
|
||
|
||
public CreateExternalFromCb2xmlCopybook(IGetLoader parent, ICopybookJrUpd copybook) { | ||
super(parent, Conversion.getCopyBookId(copybook.getFilename())); | ||
this.copybook = copybook; | ||
} | ||
|
||
|
||
@Override | ||
protected ExternalRecord createExternalRecordImp() throws Exception { | ||
ICopybookLoaderStream loader = parent.getLoader(); | ||
|
||
if (! (loader instanceof CobolCopybookLoader)) { | ||
throw new RecordException(ONLY_USED_WITH_COBOL); | ||
} | ||
|
||
return ((CobolCopybookLoader) loader).loadCopybook( | ||
copybook, | ||
Conversion.getCopyBookId(copybook.getFilename()), | ||
splitCopybook, 0, | ||
parent.getFont(), parent.getDialect(), 0); | ||
} | ||
} | ||
/* ------------------------------------------------------------------------- | ||
* | ||
* Project: JRecord | ||
* | ||
* Sub-Project purpose: Provide support for reading Cobol-Data files | ||
* using a Cobol Copybook in Java. | ||
* Support for reading Fixed Width / Binary / Csv files | ||
* using a Xml schema. | ||
* General Fixed Width / Csv file processing in Java. | ||
* | ||
* Author: Bruce Martin | ||
* | ||
* License: LGPL 2.1 or latter | ||
* | ||
* Copyright (c) 2016, Bruce Martin, All Rights Reserved. | ||
* | ||
* This library is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU Lesser General Public | ||
* License as published by the Free Software Foundation; either | ||
* version 2.1 of the License, or (at your option) any later version. | ||
* | ||
* This library is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Lesser General Public License for more details. | ||
* | ||
* ------------------------------------------------------------------------ */ | ||
|
||
package net.sf.JRecord.IO.builders; | ||
|
||
import net.sf.JRecord.Common.Conversion; | ||
import net.sf.JRecord.Common.RecordException; | ||
import net.sf.JRecord.External.CobolCopybookLoader; | ||
import net.sf.JRecord.External.ExternalRecord; | ||
import net.sf.JRecord.External.ICopybookLoaderStream; | ||
import net.sf.cb2xml.def.ICopybookJrUpd; | ||
|
||
public class CreateExternalFromCb2xmlCopybook extends CreateExternalBase implements ICreateExternal { | ||
|
||
private final ICopybookJrUpd copybook; | ||
// private final CblIOBuilderMultiSchema parent; | ||
|
||
|
||
|
||
public CreateExternalFromCb2xmlCopybook(IGetLoader parent, ICopybookJrUpd copybook) { | ||
super(parent, Conversion.getCopyBookId(copybook.getFilename())); | ||
this.copybook = copybook; | ||
} | ||
|
||
|
||
@Override | ||
protected ExternalRecord createExternalRecordImp() throws Exception { | ||
ICopybookLoaderStream loader = parent.getLoader(); | ||
|
||
if (! (loader instanceof CobolCopybookLoader)) { | ||
throw new RecordException(ONLY_USED_WITH_COBOL); | ||
} | ||
|
||
return ((CobolCopybookLoader) loader).loadCopybook( | ||
copybook, | ||
Conversion.getCopyBookId(copybook.getFilename()), | ||
splitCopybook, 0, | ||
parent.getFont(), parent.getDialect(), 0); | ||
} | ||
} |
Oops, something went wrong.