Class ColumnMapping.NameMapping
- java.lang.Object
-
- com.univocity.parsers.common.fields.AbstractColumnMapping<java.lang.String>
-
- com.univocity.parsers.common.fields.ColumnMapping.NameMapping
-
- All Implemented Interfaces:
java.lang.Cloneable
- Enclosing class:
- ColumnMapping
private class ColumnMapping.NameMapping extends AbstractColumnMapping<java.lang.String>
-
-
Field Summary
-
Fields inherited from class com.univocity.parsers.common.fields.AbstractColumnMapping
mapping, prefix
-
-
Constructor Summary
Constructors Constructor Description NameMapping(java.lang.String prefix, ColumnMapping.NameMapping parent)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) java.lang.String
findKey(java.lang.String nameWithPrefix)
Locates a given key based on an attribute or method name.(package private) java.lang.String
getKeyPrefix(java.lang.String prefix, java.lang.String key)
Returns the prefix of a given key, i.e.(package private) java.lang.String
prefixKey(java.lang.String prefix, java.lang.String key)
Transforms the key so it can work with the given prefix.-
Methods inherited from class com.univocity.parsers.common.fields.AbstractColumnMapping
clone, extractPrefixes, isMapped, mapToColumn, mapToColumnIndex, mapToColumnIndexes, mapToColumnName, mapToColumnNames, mapToColumns, remove, updateFieldMapping
-
-
-
-
Constructor Detail
-
NameMapping
public NameMapping(java.lang.String prefix, ColumnMapping.NameMapping parent)
-
-
Method Detail
-
prefixKey
java.lang.String prefixKey(java.lang.String prefix, java.lang.String key)
Description copied from class:AbstractColumnMapping
Transforms the key so it can work with the given prefix.- Specified by:
prefixKey
in classAbstractColumnMapping<java.lang.String>
- Parameters:
prefix
- the current object nesting level, denoted by a dot-separated string of nested attribute names.key
- the key to transform.- Returns:
- the transformed key or
null
if the key can't be used with the given prefix
-
getKeyPrefix
java.lang.String getKeyPrefix(java.lang.String prefix, java.lang.String key)
Description copied from class:AbstractColumnMapping
Returns the prefix of a given key, i.e. the current nested object that is being targeted.- Specified by:
getKeyPrefix
in classAbstractColumnMapping<java.lang.String>
- Parameters:
prefix
- the current prefix - a dot separated string with nested attribute nameskey
- the attribute name or method definition. If its own prefix starts with the given prefix, the next element after the dot will be returned (if any)- Returns:
- the name of the next nested object relative to the current prefix.
-
findKey
java.lang.String findKey(java.lang.String nameWithPrefix)
Description copied from class:AbstractColumnMapping
Locates a given key based on an attribute or method name.- Specified by:
findKey
in classAbstractColumnMapping<java.lang.String>
- Parameters:
nameWithPrefix
- name of the attribute or method, prefixed with nested object names that identify the path to the target class member.- Returns:
- the key formed with the given attribute name or method definition
-
-