|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.univocity.parsers.common.EntityList<E>
E - the type of EntitySettings managed by this list.public abstract class EntityList<E extends EntitySettings>
A list of entities to be parsed by some implementation of EntityParserInterface,
and their specific configurations.
The configuration applied over individual EntitySettings elements override their counterparts in the
global parser settings, usually a subclass of EntityParserSettings
EntitySettings,
EntityParserSettings,
EntityParserInterface| Field Summary | |
|---|---|
protected Map<String,E> |
entities
|
protected Map<String,String> |
originalEntityNames
|
| Constructor Summary | |
|---|---|
protected |
EntityList(EntityParserSettings globalSettings)
Creates a new, empty EntityList, applying the global configuration object, used by the
EntityParserInterface implementation, to all entity-specific settings in this list. |
| Method Summary | |
|---|---|
protected E |
addEntitySettings(E settings)
Associates an entity setting configuration to a given entity. |
E |
configureEntity(String entityName)
Returns the configuration object associated with the given entityName. |
protected E |
configureEntity(String entityName,
E parentEntity)
Returns the configuration object associated with the given entityName. |
Collection<E> |
getEntities()
Returns all the entity configurations stored in this EntityList as a unmodifiable Collection |
E |
getEntity(String entityName)
Returns the configuration of a an existing entity or null if there's no entity with the given name. |
Set<String> |
getEntityNames()
Returns the entity names stored in the EntityList as a set of Strings. |
EntityParserSettings |
getParserSettings()
Returns the global parser settings whose configuration may provide defaults for all entities defined in this list. |
Iterator<E> |
iterator()
Iterates over the entity configurations managed by this EntityList. |
protected abstract E |
newEntity(String entityName,
E parentEntity)
Creates a new configuration object for the given entity name |
protected abstract EntityList |
newInstance()
Creates a new instance of EntityList using properties from this instance. |
void |
removeEntity(E entity)
Removes an entity from this EntityList. |
void |
removeEntity(String entityName)
Removes an entity from this EntityList. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Map<String,E extends EntitySettings> entities
protected Map<String,String> originalEntityNames
| Constructor Detail |
|---|
protected EntityList(EntityParserSettings globalSettings)
EntityList, applying the global configuration object, used by the
EntityParserInterface implementation, to all entity-specific settings in this list.
globalSettings - the global parser settings whose configuration may provide defaults for all entities
defined in this list.| Method Detail |
|---|
public final E configureEntity(String entityName)
entityName - name of the entity whose configuration that will be returned.
protected E configureEntity(String entityName,
E parentEntity)
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.
protected abstract E newEntity(String entityName,
E parentEntity)
entityName - name of the new entityparentEntity - the "parent" entity (which can be null), whose settings will
be passed on to the new entity.
public final Set<String> getEntityNames()
EntityList as a set of Strings. Returns an empty set if no
entities configured.
public final Collection<E> getEntities()
EntityList as a unmodifiable Collection
public final E getEntity(String entityName)
null if there's no entity with the given name.
entityName - name of the entity whose configuration will be returned
EntitySettings which manages the configuration of the given entity,
or null if no such entity exist.public final void removeEntity(String entityName)
EntityList. A removed entity will not be used by the parser and any
fields/configuration made for the removed entity configuration will be lost.
entityName - name of the entity that will be removed.public final void removeEntity(E entity)
EntityList. A removed entity will not be used by the parser and any
fields/configuration made for the removed entity configuration will be lost.
entity - the entity object that should be be removedpublic final Iterator<E> iterator()
EntityList.
iterator in interface Iterable<E extends EntitySettings>Iterator of EntitySettings objects stored in this EntityList.protected E addEntitySettings(E settings)
settings - the configuration to be associated with the given entity.
public EntityParserSettings getParserSettings()
protected abstract EntityList newInstance()
EntityList using properties from this instance.
EntityList
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||