wt.util
Class PropertiesConsumer

java.lang.Object
  extended bywt.util.Consumer
      extended bywt.util.FileConsumer
          extended bywt.util.PropertiesConsumer
All Implemented Interfaces:
Iterator

public final class PropertiesConsumer
extends FileConsumer

Creates an iteration over a list of properties files, without buffering all the properties files first. The files are processed just as properties files are, with the one exception that duplicate keys ARE returned. The expectation is that the caller will have its own handling of duplicate keys.

Supported API: false
Extendable: false


Nested Class Summary
protected static class PropertiesConsumer.PropertiesAdapter
          Adapter class that lets a properties file be parsed by the Properties code, without being stored in a Properties object.
 
Nested classes inherited from class wt.util.FileConsumer
FileConsumer.FileConsumerQueue, FileConsumer.FileProducer
 
Nested classes inherited from class wt.util.Consumer
Consumer.Producer, Consumer.Queue, Consumer.SynchronizedQueue
 
Field Summary
 
Fields inherited from class wt.util.FileConsumer
DEFAULT_SEPARATOR
 
Fields inherited from class wt.util.Consumer
DEFAULT_BUFFER_SIZE, producer, queue
 
Constructor Summary
PropertiesConsumer(String files)
           
PropertiesConsumer(String[] files)
           
PropertiesConsumer(String[] files, int max_buffer_size)
           
PropertiesConsumer(String files, String separator)
           
PropertiesConsumer(String files, String separator, int max_buffer_size)
           
 
Method Summary
protected  Consumer.Producer createProducer(String[] files)
          Override createProducer() to create a properties producer.
 
Methods inherited from class wt.util.FileConsumer
createQueue, getCurrentFile
 
Methods inherited from class wt.util.Consumer
finalize, hasNext, init, init, init, next, remove
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PropertiesConsumer

public PropertiesConsumer(String[] files,
                          int max_buffer_size)
Parameters:
files - An array of files to be included in the iterator

PropertiesConsumer

public PropertiesConsumer(String files)
Parameters:
files - A comma-separated list of files.

PropertiesConsumer

public PropertiesConsumer(String files,
                          String separator)
Parameters:
files - A list of files delineated by the separator parameter
separator - The separator for the files parameter

PropertiesConsumer

public PropertiesConsumer(String files,
                          String separator,
                          int max_buffer_size)
Parameters:
files - A list of files delineated by the separator parameter
separator - The separator for the files parameter

PropertiesConsumer

public PropertiesConsumer(String[] files)
Parameters:
files - An array of files to be included in the iterator
Method Detail

createProducer

protected final Consumer.Producer createProducer(String[] files)
Override createProducer() to create a properties producer.

Overrides:
createProducer in class FileConsumer
Parameters:
files - The list of files to be loaded.