Class Unmarshaller<E>

    • Field Detail

      • propertyUtils

        protected final org.fissore.jrecordbind.PropertyUtils propertyUtils
    • Constructor Detail

      • Unmarshaller

        public Unmarshaller​(RecordDefinition definition)
        Creates a new Unmarshaller, with the specified record definition and using the default LineReader implementation
        Parameters:
        definition - the record definition
      • Unmarshaller

        public Unmarshaller​(RecordDefinition definition,
                            LineReader lineReader)
        Creates a new Unmarshaller, with the specified record definition and using the specified LineReader implementation
        Parameters:
        definition - the record definition
        lineReader - a custom implementation of the LineReader
      • Unmarshaller

        public Unmarshaller​(RecordDefinition definition,
                            LineReader lineReader,
                            Map<String,​Converter> converters,
                            Map<String,​Padder> padders)
        Creates a new Unmarshaller, with the specified record definition and using the specified LineReader implementation, and with user provided instances of converters and padders.
        Parameters:
        definition - the record definition
        lineReader - a custom implementation of the LineReader
        converters - user provided instances of converters
        padders - user provided instances of padders
    • Method Detail

      • getCurrentJunk

        public String getCurrentJunk()
        Returns the current internal buffer content. If called right after a Iterator.next() call, it will return what JRecordBind wasn't able to unmarshall. Usually called after the Iterator.hasNext() has returned false to report the user about the "junk" found in the text file
        Returns:
        the current "junk" stored in the internal buffer
      • unmarshallToIterator

        public Iterator<EunmarshallToIterator​(Reader input)
        Unmarshalls the input fixed-length file, a bean at a time
        Parameters:
        input - the input fixed-length file
        Returns:
        an Iterator: each next() call will give back the next bean
      • getPadder

        protected Padder getPadder​(RecordDefinition currentDefinition,
                                   RecordDefinition.Property property)
        Gets the padder for the specified property or the default one specified by the record definition
        Parameters:
        currentDefinition - the record definition
        property - the property
        Returns:
        a padder instance