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.
        Parameters:
        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
        Parameters:
        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
        Parameters:
        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
        Parameters:
        currentDefinition - the record definition
        property - the property
        Returns:
        a padder instance