Class Marshaller<E>

  • public class Marshaller<E>
    extends Object
    Transforms beans to text according to the given record definition
    • Field Detail

      • propertyUtils

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

      • Marshaller

        public Marshaller​(RecordDefinition definition,
                          Map<String,​Converter> converters,
                          Map<String,​Padder> padders)
        Creates a new marshaller, with the specified record definition and user provided instances of converters and padders.
        definition - the record definition
        converters - user provided instances of converters
        padders - user provided instances of padders
    • Method Detail

      • marshall

        public void marshall​(E record,
                             Writer writer)
        Marshalls a bean to a writer
        record - the bean to marshal
        writer - the target writer
      • marshallAll

        public void marshallAll​(Collection<E> records,
                                Writer writer)
        Marshalls a collection of beans to a writer
        records - the beans to marshall
        writer - the target writer
      • 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
        currentDefinition - the record definition
        property - the property
        a padder instance