com.univocity.parsers.remote
Class RemoteEntityList<S extends RemoteEntitySettings>

java.lang.Object
  extended by com.univocity.parsers.common.EntityList<S>
      extended by com.univocity.parsers.remote.RemoteEntityList<S>
Type Parameters:
S - the type of RemoteEntitySettings managed by this list.
All Implemented Interfaces:
Iterable<S>

public abstract class RemoteEntityList<S extends RemoteEntitySettings>
extends EntityList<S>

A list of remote entities to be parsed by some implementation of EntityParserInterface, and their specific configurations.

The configuration applied over individual RemoteEntitySettings elements override their counterparts in the global parser settings, usually a subclass of RemoteParserSettings

Author:
uniVocity Software Pty Ltd - dev@univocity.com
See Also:
RemoteEntitySettings, RemoteParserSettings, EntityParserInterface

Field Summary
protected  ExecutorService downloadThreadPool
           
 
Fields inherited from class com.univocity.parsers.common.EntityList
entities, originalEntityNames
 
Constructor Summary
RemoteEntityList(RemoteParserSettings globalSettings)
          Creates a new, empty RemoteEntityList, applying the global configuration object, used by the EntityParserInterface implementation, to all entity-specific settings in this list.
 
Method Summary
protected  S addEntitySettings(S settings)
          Associates an entity setting configuration to a given entity.
protected  S configureEntity(String entityName, S parentEntity)
          Returns the configuration object associated with the given entityName.
protected  ExecutorService getDownloadThreadPool()
           
 RemoteParserSettings getParserSettings()
          Returns the global parser settings whose configuration may provide defaults for all entities defined in this list.
protected abstract  RemoteEntityList<S> newInstance()
          Creates a new instance of EntityList using properties from this instance.
 
Methods inherited from class com.univocity.parsers.common.EntityList
configureEntity, getEntities, getEntity, getEntityNames, iterator, newEntity, removeEntity, removeEntity
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

downloadThreadPool

protected ExecutorService downloadThreadPool
Constructor Detail

RemoteEntityList

public RemoteEntityList(RemoteParserSettings globalSettings)
Creates a new, empty RemoteEntityList, applying the global configuration object, used by the EntityParserInterface implementation, to all entity-specific settings in this list.

Parameters:
globalSettings - the global parser settings whose configuration may provide defaults for all entities defined in this list.
Method Detail

addEntitySettings

protected final S addEntitySettings(S settings)
Description copied from class: EntityList
Associates an entity setting configuration to a given entity. If the entity does not exist, it will be created. The general settings will be copied into a new configuration object, while any input-specific setting will be lost.

Overrides:
addEntitySettings in class EntityList<S extends RemoteEntitySettings>
Parameters:
settings - the configuration to be associated with the given entity.
Returns:
the new configuration object

getParserSettings

public RemoteParserSettings getParserSettings()
Description copied from class: EntityList
Returns the global parser settings whose configuration may provide defaults for all entities defined in this list.

Overrides:
getParserSettings in class EntityList<S extends RemoteEntitySettings>
Returns:
the parent parser settings object.

newInstance

protected abstract RemoteEntityList<S> newInstance()
Description copied from class: EntityList
Creates a new instance of EntityList using properties from this instance.

Specified by:
newInstance in class EntityList<S extends RemoteEntitySettings>
Returns:
the new EntityList

configureEntity

protected S configureEntity(String entityName,
                            S parentEntity)
Description copied from class: EntityList
Returns the configuration object associated with the given entityName. If there is no entity with that name, a new configuration will be created and returned. The global settings made for the parser will be used by default. You can configure your entity to use different settings if required.

Overrides:
configureEntity in class EntityList<S extends RemoteEntitySettings>
Parameters:
entityName - name of the entity whose configuration that will be returned.
parentEntity - the "parent" entity (which can be null), whose settings will be passed on to the new entity.
Returns:
an existing or new entity configuration associated with the given entity name

getDownloadThreadPool

protected final ExecutorService getDownloadThreadPool()


Copyright © 2018 uniVocity Software Pty Ltd. All rights reserved.