Class StreamConfig

  • All Implemented Interfaces:
    java.lang.Cloneable, java.lang.Iterable<ComponentConfig>, SelectorConfig, Replicateable

    public class StreamConfig
    extends GroupConfig
    A stream is the root (a.k.a top or parent) group of a stream mapping configuration. As such, it contains other attributes that apply to the entire stream.

    By default, a stream can be used for both marshalling (write) and unmarshalling (read). Calling setMode(String) can restrict the use of the stream, but will relax some validations on the types of objects that can be read or written.

    Since:
    2.0
    • Field Detail

      • READ_WRITE_MODE

        public static final java.lang.String READ_WRITE_MODE
        Stream configuration supports reading and writing
        See Also:
        Constant Field Values
      • READ_ONLY_MODE

        public static final java.lang.String READ_ONLY_MODE
        Stream configuration supports reading only
        See Also:
        Constant Field Values
      • WRITE_ONLY_MODE

        public static final java.lang.String WRITE_ONLY_MODE
        Stream configuration supports writing only
        See Also:
        Constant Field Values
    • Constructor Detail

      • StreamConfig

        public StreamConfig()
        Constructs a new StreamConfig.
    • Method Detail

      • getFormat

        public java.lang.String getFormat()
        Returns the format of this stream.
        Returns:
        the stream format
      • setFormat

        public void setFormat​(java.lang.String format)
        Sets the format of this stream.
        Parameters:
        format - the stream format
      • getMode

        public java.lang.String getMode()
        Returns the allowed mode(s) of operation for this stream.
        Returns:
        READ_WRITE_MODE if reading and writing from a stream is allowed, READ_ONLY_MODE if only reading is allowed, WRITE_ONLY_MODE if only writing is allowed, or null if explicitly set
      • setMode

        public void setMode​(java.lang.String mode)
        Sets the allowed mode(s) of operation for this stream. If not set, or explicitly set to null, the stream configuration defaults to read/write. Some configuration validations are relaxed if set to read or write only.
        Parameters:
        mode - READ_WRITE_MODE if reading and writing from a stream is allowed, READ_ONLY_MODE if only reading is allowed, WRITE_ONLY_MODE if only writing is allowed
      • getResourceBundle

        public java.lang.String getResourceBundle()
        Returns the path name of the resource bundle containing customized error messages for this stream.
        Returns:
        the resource bundle name
      • setResourceBundle

        public void setResourceBundle​(java.lang.String resourceBundle)
        Sets the path name of the resource bundle containing customized error messages for this stream.
        Parameters:
        resourceBundle - the resource bundle name
      • addHandler

        public void addHandler​(TypeHandlerConfig handler)
        Adds a custom type handler to this stream.
        Parameters:
        handler - the type handler to add
      • getHandlerList

        public java.util.List<TypeHandlerConfig> getHandlerList()
        Returns a list of customized type handlers configured for this stream.
        Returns:
        the list of custom type handlers
      • getParserFactory

        public BeanConfig<RecordParserFactory> getParserFactory()
        Returns the record parser factory configuration bean.
        Returns:
        the record parser factory configuration bean.
      • setParserFactory

        public void setParserFactory​(BeanConfig<RecordParserFactory> parserFactory)
        Sets the record parser factory configuration bean.
        Parameters:
        parserFactory - the record parser factory configuration bean
      • isStrict

        public boolean isStrict()
        Returns whether BeanIO should calculate and enforce strict record ordering (based on the order records are declared in the mapping file) and record length (based on configured field occurrences).
        Returns:
        true if strict, false otherwise
      • setStrict

        public void setStrict​(boolean strict)
        Sets whether BeanIO should calculate and enforce strict record ordering (based on the order records are declared in the mapping file) and record length (based on configured field occurrences).
        Parameters:
        strict - true if strict, false otherwise
      • isIgnoreUnidentifiedRecords

        public boolean isIgnoreUnidentifiedRecords()
        Returns whether to ignore unidentified records. Defaults to false.
        Returns:
        true to ignore unidentified records, false otherwise
        Since:
        2.0.4
      • setIgnoreUnidentifiedRecords

        public void setIgnoreUnidentifiedRecords​(boolean ignoreUnidentifiedRecords)
        Sets whether to ignore unidentified records. Defaults to false.
        Parameters:
        ignoreUnidentifiedRecords - true to ignore unidentified records, false otherwise
        Since:
        2.0.4