|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.univocity.parsers.common.EntitySettings<C,S,G>
com.univocity.parsers.remote.RemoteEntitySettings<C,S,G,T>
C - the type of Context implementation supported by Processors of this entity.S - an internal configuration object that extends from CommonParserSettings, and is used to
manage configuration of elements shared with univocity-parsersG - type of the global configuration class (an instance of RemoteEntitySettings, used to configure
the parser (a concrete implementation of EntityParserInterface) and its entities.public abstract class RemoteEntitySettings<C extends com.univocity.parsers.common.Context,S extends com.univocity.parsers.common.CommonParserSettings,G extends RemoteParserSettings,T extends RemoteFollower>
Manages configuration options for individual entities of a RemoteEntityList. Settings that also exist in
the parent RemoteParserSettings will be used by default but can be overridden for an individual entity.
| Field Summary | |
|---|---|
protected Map<String,T> |
followers
|
protected Object |
owner
|
protected Set<String> |
requestParameters
|
| Fields inherited from class com.univocity.parsers.common.EntitySettings |
|---|
name, parentEntity, parserSettings, processor |
| Constructor Summary | |
|---|---|
protected |
RemoteEntitySettings(String entityName,
S entitySettings,
RemoteEntitySettings parentEntity)
Internal constructor to be invoked the subclasses of EntitySettings |
| Method Summary | |
|---|---|
protected EntitySettings<C,S,G> |
clone()
|
String |
getEmptyValue()
Returns the value to be used when the content parsed for a field of some record evaluates to an empty String
Defaults to null |
abstract Set<String> |
getFieldNames()
Returns the name of all fields associated with a remote entity. |
protected S |
getInternalSettings()
Returns the internal CommonSettings used |
Nesting |
getNesting()
Returns the nesting strategy to apply to rows associated to a "parent" row, such as results parsed from a link accessed by a RemoteFollower. |
protected RemoteEntityList |
getParentEntityList()
Returns the entity list that "owns" this entity. |
T |
getRemoteFollower(String followerName)
Obtains a RemoteFollowers associated with this entity. |
Map<String,T> |
getRemoteFollowers()
Returns a (unmodifiable) map of RemoteFollowers associated with this entity. |
void |
ignoreFollowingErrors(boolean ignoreLinkFollowingErrors)
Configures the parser to ignore (or not) invalid, malformed or unavailable links when following urls to collect additional data associated to a current result. |
boolean |
isColumnReorderingEnabled()
Identifies whether fields should be reordered when field selection methods such as EntitySettings.selectFields(String...) are used. |
boolean |
isIgnoreFollowingErrors()
Returns a flag indicating whether the parser will ignore invalid, malformed or unavailable links when following urls to collect additional data associated to a current result. |
abstract void |
removeField(String fieldName)
Removes a field from the entity. |
void |
setColumnReorderingEnabled(boolean columnReorderingEnabled)
Defines whether fields should be reordered when field selection methods such as EntitySettings.selectFields(String...) are used. |
void |
setEmptyValue(String emptyValue)
Defines the value to be used when the content parsed for a field of some record evaluates to an empty String
Defaults to null |
void |
setNesting(Nesting combineLinkFollowingRows)
Configures the nesting strategy to apply to rows associated to a "parent" row, such as results parsed from a link accessed by a RemoteFollower. |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected Set<String> requestParameters
protected Map<String,T extends RemoteFollower> followers
protected Object owner
| Constructor Detail |
|---|
protected RemoteEntitySettings(String entityName,
S entitySettings,
RemoteEntitySettings parentEntity)
EntitySettings
entityName - the entity name, usually provided by the userentitySettings - an internal implementation of a CommonSettings, used to manage configuration
of elements shared with univocity-parsers.
Not meant to be exposed/accessed directly by users.parentEntity - parent entity to build settings on top of| Method Detail |
|---|
public final Nesting getNesting()
RemoteFollower.
Defaults to the parent entity's getNesting() or if undefined,
the RemoteParserSettings.getNesting() setting.
public final void setNesting(Nesting combineLinkFollowingRows)
RemoteFollower.
Defaults to the parent entity's getNesting() or if undefined,
the RemoteParserSettings.getNesting() setting.
combineLinkFollowingRows - the nesting strategy to use when processing results associated with a parent row.public final void ignoreFollowingErrors(boolean ignoreLinkFollowingErrors)
false, the parser will throw an Exception when attempting to follow a link that is invalid,
malformed or unavailable. If true, the parser will simply ignore the error and proceed.
Defaults to true
ignoreLinkFollowingErrors - true if the parser will ignore errors when accessing linked page, false otherwise.public final boolean isIgnoreFollowingErrors()
true
true if the parser is set to ignore errors when accessing linked pageprotected S getInternalSettings()
EntitySettingsCommonSettings used
getInternalSettings in class EntitySettings<C extends com.univocity.parsers.common.Context,S extends com.univocity.parsers.common.CommonParserSettings,G extends RemoteParserSettings>public abstract Set<String> getFieldNames()
LinkedHashSet of field names available from this entity.public abstract void removeField(String fieldName)
fieldName - name of the field that should be be removed.public final boolean isColumnReorderingEnabled()
EntitySettings.selectFields(String...) are used.
When enabled, each parsed record will contain values only for the selected columns. The values will be ordered according to the selection.
When disabled, each parsed record will contain values for all columns, in their original sequence.
Fields which were not selected will contain null values, as defined in EntitySettings.getNullValue().
Defaults to true
public final void setColumnReorderingEnabled(boolean columnReorderingEnabled)
EntitySettings.selectFields(String...) are used.
When enabled, each parsed record will contain values only for the selected columns. The values will be ordered according to the selection.
When disabled, each parsed record will contain values for all columns, in their original sequence.
Fields which were not selected will contain null values, as defined in EntitySettings.getNullValue().
Defaults to true
columnReorderingEnabled - the flag indicating whether or not selected fields should be reorderedpublic final String getEmptyValue()
String
Defaults to null
String (i.e. "") when the content of a field is empty.public final void setEmptyValue(String emptyValue)
String
Defaults to null
emptyValue - the value to be used instead of empty String (i.e. "") when the content of a field is empty.public Map<String,T> getRemoteFollowers()
RemoteFollowers associated with this entity.
RemoteFollowers associated with this entity.protected RemoteEntityList getParentEntityList()
EntitySettings
getParentEntityList in class EntitySettings<C extends com.univocity.parsers.common.Context,S extends com.univocity.parsers.common.CommonParserSettings,G extends RemoteParserSettings>public T getRemoteFollower(String followerName)
RemoteFollowers associated with this entity.
followerName - name of the RemoteFollower to return
RemoteFollower associated with this entity, or null if not found.protected EntitySettings<C,S,G> clone()
clone in class EntitySettings<C extends com.univocity.parsers.common.Context,S extends com.univocity.parsers.common.CommonParserSettings,G extends RemoteParserSettings>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||