T - public class FixedLength<T>
extends java.lang.Object
| Constructor and Description |
|---|
FixedLength() |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
format(java.util.List<T> lines)
Builds a fixed length String
|
java.util.List<T> |
parse(java.io.InputStream stream)
Parses a fixed length file into a List
|
java.util.List<T> |
parse(java.io.Reader reader)
Parses a fixed length file into a List
|
java.util.stream.Stream<T> |
parseAsStream(java.io.InputStream inputStream)
Parses a fixed length file into a stream
|
java.util.stream.Stream<T> |
parseAsStream(java.io.Reader reader)
Parses a fixed length file into a stream
|
FixedLength<T> |
registerFormatter(java.lang.Class<? extends java.io.Serializable> typeClass,
java.lang.Class<? extends Formatter<? extends java.io.Serializable>> formatterClass)
Add formatter to work with class types.
|
FixedLength<T> |
registerLineType(java.lang.Class<? extends T> lineClass)
Register here type that will be processed in serialization, or deserialization process.
|
FixedLength<T> |
registerLineTypes(java.lang.Class<T>[] lineClasses)
In case you have a mixed fixed length file with different types in it,
you could register more than one line type in array instead of calling registerLineType multiple times.
|
FixedLength<T> |
registerLineTypes(java.util.List<java.lang.Class<T>> lineClasses)
In case you have a mixed fixed length file with different types in it,
you could register more than one line type in array instead of calling registerLineType multiple times.
|
FixedLength<T> |
skipErroneousFields()
In case of error field in parsing the line, the one will be skipped with no exception thrown
|
FixedLength<T> |
skipErroneousLines()
In case of error line while parsing, the one will be skipped with no exception thrown
|
FixedLength<T> |
stopSkipUnknownLines()
In case of unknown line, the one will be skipped with no exception thrown
|
FixedLength<T> |
usingCharset(java.nio.charset.Charset charset)
Specifies charset of a file, in case of no provided Charset.defaultCharset() will be used
|
FixedLength<T> |
usingLineDelimiter(java.util.regex.Pattern pattern)
Delimiter between fixed line entity records could be specified as a regexp pattern.
|
FixedLength<T> |
usingLineDelimiter(java.lang.String delimiterString)
Delimiter between fixed line entity records.
|
public FixedLength<T> registerLineType(java.lang.Class<? extends T> lineClass)
lineClass - class for entity to be registeredpublic FixedLength<T> registerFormatter(java.lang.Class<? extends java.io.Serializable> typeClass, java.lang.Class<? extends Formatter<? extends java.io.Serializable>> formatterClass)
typeClass - type that should be formatterformatterClass - formatter to pass throughpublic FixedLength<T> stopSkipUnknownLines()
public FixedLength<T> skipErroneousFields()
public FixedLength<T> skipErroneousLines()
public FixedLength<T> registerLineTypes(java.util.List<java.lang.Class<T>> lineClasses)
lineClasses - class for entity to be registeredpublic FixedLength<T> registerLineTypes(java.lang.Class<T>[] lineClasses)
lineClasses - class for entity to be registeredpublic FixedLength<T> usingCharset(java.nio.charset.Charset charset)
charset - Charset of current filepublic FixedLength<T> usingLineDelimiter(java.util.regex.Pattern pattern)
pattern - regexp pattern how to break linespublic FixedLength<T> usingLineDelimiter(java.lang.String delimiterString)
delimiterString - string that points the end of a linepublic java.util.List<T> parse(java.io.InputStream stream) throws FixedLengthException
stream - InputStream of a fixed length fileFixedLengthException - in case of parsing errorspublic java.util.List<T> parse(java.io.Reader reader) throws FixedLengthException
reader - Reader of a fixed length fileFixedLengthException - in case of parsing errorspublic java.util.stream.Stream<T> parseAsStream(java.io.InputStream inputStream) throws FixedLengthException
inputStream - InputStream of a fixed length fileFixedLengthException - in case of parsing errorspublic java.util.stream.Stream<T> parseAsStream(java.io.Reader reader) throws FixedLengthException
reader - Reader of a fixed length fileFixedLengthException - in case of parsing errorspublic java.lang.String format(java.util.List<T> lines)
lines - lines to be serialized