Class ColumnMapping.MethodMapping
- java.lang.Object
-
- com.univocity.parsers.common.fields.AbstractColumnMapping<MethodDescriptor>
-
- com.univocity.parsers.common.fields.ColumnMapping.MethodMapping
-
- All Implemented Interfaces:
java.lang.Cloneable
- Enclosing class:
- ColumnMapping
private class ColumnMapping.MethodMapping extends AbstractColumnMapping<MethodDescriptor>
-
-
Field Summary
-
Fields inherited from class com.univocity.parsers.common.fields.AbstractColumnMapping
mapping, prefix
-
-
Constructor Summary
Constructors Constructor Description MethodMapping(java.lang.String prefix, ColumnMapping.MethodMapping parent)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) MethodDescriptor
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, MethodDescriptor key)
Returns the prefix of a given key, i.e.(package private) MethodDescriptor
prefixKey(java.lang.String prefix, MethodDescriptor 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
-
MethodMapping
public MethodMapping(java.lang.String prefix, ColumnMapping.MethodMapping parent)
-
-
Method Detail
-
prefixKey
MethodDescriptor prefixKey(java.lang.String prefix, MethodDescriptor key)
Description copied from class:AbstractColumnMapping
Transforms the key so it can work with the given prefix.- Specified by:
prefixKey
in classAbstractColumnMapping<MethodDescriptor>
- 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, MethodDescriptor 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<MethodDescriptor>
- 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
MethodDescriptor 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<MethodDescriptor>
- 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
-
-