Class RegexToBeanField<T>

  • Type Parameters:
    T - The type of the bean being converted
    All Implemented Interfaces:
    ComplexFieldMapEntry<java.lang.String,​java.lang.String,​T>

    public class RegexToBeanField<T>
    extends AbstractFieldMapEntry<java.lang.String,​java.lang.String,​T>
    Maps any header name matching a regular expression to a BeanField.
    Since:
    4.2
    Author:
    Andrew Rucker Jones
    • Constructor Summary

      Constructors 
      Constructor Description
      RegexToBeanField​(java.lang.String pattern, BeanField<T,​java.lang.String> field, java.util.Locale errorLocale)
      Initializes this mapping with the regular expression used to map header names and the BeanField they should be mapped to.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean contains​(java.lang.String key)
      Determines whether or not the given key is contained in this entry.
      java.lang.String getInitializer()
      Returns the information used to initialize this entry.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • RegexToBeanField

        public RegexToBeanField​(java.lang.String pattern,
                                BeanField<T,​java.lang.String> field,
                                java.util.Locale errorLocale)
        Initializes this mapping with the regular expression used to map header names and the BeanField they should be mapped to.
        Parameters:
        pattern - A valid regular expression against which potential header names are matched
        field - The BeanField this mapping maps to
        errorLocale - The locale for error messages
    • Method Detail

      • contains

        public boolean contains​(java.lang.String key)
        Description copied from interface: ComplexFieldMapEntry
        Determines whether or not the given key is contained in this entry.
        Parameters:
        key - The key to be located
        Returns:
        Whether key is represented by this entry
      • getInitializer

        public java.lang.String getInitializer()
        Description copied from interface: ComplexFieldMapEntry
        Returns the information used to initialize this entry. This information is not guaranteed to be exactly the same as the original value, but is functionally equivalent.
        Returns:
        The original information used to initialize this mapping entry