public class ValueLine
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
ValueLine.ValueEntry
The actual value object inside a value line.
|
| Constructor and Description |
|---|
ValueLine(HeaderDescriptor header,
java.lang.String firstCell,
java.util.Map<java.lang.Integer,java.lang.String> cellValueStrings,
int linenumber,
java.lang.String location)
Creates a new value line.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addHiddenLine(ValueLine line)
Adds another value line mainly created by the
createCopy() method, representing another item resolved by
this value line. |
void |
clearProcessedItemPK() |
java.util.Collection<ValueLine> |
createCopies(int count)
Creates a number of copies of this line without copying the potentially assigned item pk, unresolved flags and/or
hidden value lines.
|
ValueLine |
createCopy()
Creates a copy of this value except the assigned item, unresolved flag and/or hidden value lines.
|
java.util.Map<java.lang.Integer,java.lang.String> |
dump()
Produces a csv cell map to be written using
CSVWriter.write(Map) into a file for
being processed in a second-pass import. |
AbstractCodeLine |
getAfterEachCode() |
ComposedType |
getComposedType()
Returns the actual composed type item defined by its own
type code or the default type
defined by its header (see HeaderDescriptor.getDefaultComposedType(). |
PK |
getConflictingItemPk() |
HeaderDescriptor |
getHeader()
Gets the header descriptor this line belongs to.
|
java.util.Collection<ValueLine> |
getHiddenLines()
Gets all hidden lines.
|
int |
getLineNumber()
Returns the real document line number of this value line.
|
java.lang.String |
getLocation()
Returns the textual representation of the line number of this value line.
|
ValueLineMetaData |
getMetaData() |
java.lang.String |
getPlainUnresolvedReason() |
PK |
getProcessedItemPK()
In case a value line could not be completely processed during the first run this line may provide the item pk of
the previously located or created item belonging to this line.
|
java.util.Map<java.lang.Integer,java.lang.String> |
getSource()
Gets the original source line of this value line.
|
java.lang.String |
getTypeCode()
Returns the own item type code of this line, or
null if no type code was defined within the first
cell of this line. |
java.util.Collection<StandardColumnDescriptor> |
getUnresolved(java.util.Collection<StandardColumnDescriptor> columnDescriptors)
Filters all column descriptors whose column entries of this value line are unresolved.
|
java.lang.String |
getUnresolvedReason() |
ValueLine.ValueEntry |
getValueEntry(int index)
Provides the value entry object for a given position.
|
boolean |
hasHiddenLines()
Checks whether there are hidden lines stored.
|
boolean |
isUnrecoverable()
Checks if this line contains unrecoverable error.
|
boolean |
isUnresolved()
Checks if this line is either marked as completely unresolved ( via
markUnresolved() ) or owns a
non-ignored value entry which has not been resolved yet. |
boolean |
isUnresolved(java.util.Collection<StandardColumnDescriptor> columnDescriptors)
Same as
isUnresolved() except that only value entries belonging to the given column descriptors are
evaluated. |
boolean |
isUsingJaloOnlyFeatures() |
void |
markUnrecoverable()
Marks this line as unrecoverable.
|
void |
markUnrecoverable(java.lang.String reason) |
void |
markUnresolved()
Marks this line as being completely unresolved.
|
void |
markUnresolved(java.lang.String reason)
Marks this line as being completely unresolved.
|
void |
resolve(Item processedItem,
java.util.Collection<StandardColumnDescriptor> processedColumns)
Tries to resolve this line by passing the processed item and the used columns.
|
void |
resolve(PK processedItemPk,
java.util.Collection<StandardColumnDescriptor> processedColumns) |
protected ValueLine.ValueEntry |
resolveMissingEntry(int index,
java.lang.Object resolvingValue)
Marks the column value at position
index as resolved with given value. |
void |
setAfterEachCode(AbstractCodeLine abstractCodeLine) |
void |
setComposedType(ComposedType type) |
void |
setConflictingItemPK(PK conflictingItemPK) |
void |
setTypeCode(java.lang.String typeCode) |
protected java.lang.String[] |
splitTypeCodeCell(java.lang.String typeCodeCell)
Deprecated.
since ages - This method is deprecated in favor of
ValueLineMetaData class. |
java.lang.String |
toString() |
protected ValueLine.ValueEntry |
unresolveMissingEntry(int index)
Marks the column value at position
index as unresolved. |
public ValueLine(HeaderDescriptor header, java.lang.String firstCell, java.util.Map<java.lang.Integer,java.lang.String> cellValueStrings, int linenumber, java.lang.String location)
header - header descriptor this line belongs tofirstCell - content of first cell containing the value line specific type code (maybe contains the three part text
of the dumped lines)cellValueStrings - Map of all column valueslinenumber - line number of this value line within scriptlocation - location text of this value line within script (containing also the line number)public ValueLine createCopy()
public java.util.Collection<ValueLine> createCopies(int count)
count - amount of copies to createpublic java.util.Map<java.lang.Integer,java.lang.String> getSource()
public void addHiddenLine(ValueLine line)
createCopy() method, representing another item resolved by
this value line. Used if more than one item is resolved using this value line.line - value line to addpublic boolean hasHiddenLines()
public java.util.Collection<ValueLine> getHiddenLines()
@Deprecated protected java.lang.String[] splitTypeCodeCell(java.lang.String typeCodeCell)
ValueLineMetaData class.typeCodeCell - the first cell string as read by the csv parserpublic void markUnresolved()
public void markUnresolved(java.lang.String reason)
reason - reason for not resolving the linepublic int getLineNumber()
public java.lang.String getLocation()
public java.lang.String getTypeCode()
null if no type code was defined within the first
cell of this line.public void setTypeCode(java.lang.String typeCode)
public ComposedType getComposedType() throws InsufficientDataException
type code or the default type
defined by its header (see HeaderDescriptor.getDefaultComposedType().InsufficientDataException - in case this line defines a type which is unknown in the current systempublic void setComposedType(ComposedType type)
public ValueLine.ValueEntry getValueEntry(int index)
index - the value position ( starting at 1 )public HeaderDescriptor getHeader()
public PK getProcessedItemPK()
public java.util.Map<java.lang.Integer,java.lang.String> dump()
CSVWriter.write(Map) into a file for
being processed in a second-pass import.
Unless the complete line was marked unresolved all cells which have been resolved by now
or have no been used at all will be prefixed with the
ImpExConstants.Syntax.IGNORE_PREFIX token to skip their processing
during a second pass.public ValueLineMetaData getMetaData()
public boolean isUnresolved()
markUnresolved() ) or owns a
non-ignored value entry which has not been resolved yet.public boolean isUnresolved(java.util.Collection<StandardColumnDescriptor> columnDescriptors)
isUnresolved() except that only value entries belonging to the given column descriptors are
evaluated.columnDescriptors - a collection of column descriptors to define which value entries to
checkpublic java.util.Collection<StandardColumnDescriptor> getUnresolved(java.util.Collection<StandardColumnDescriptor> columnDescriptors)
columnDescriptors - a collection of column descriptors whose value lines entries will be
checked for unresolvingpublic void resolve(Item processedItem, java.util.Collection<StandardColumnDescriptor> processedColumns)
unused.
The line stays unresolved if at least one unresolved value entry of the used columns exists! Use
dump() to store this line for retrying import later on.processedItem - the item created, removed or updated upon this lineprocessedColumns - the columns used to processing the given itempublic void resolve(PK processedItemPk, java.util.Collection<StandardColumnDescriptor> processedColumns)
protected ValueLine.ValueEntry resolveMissingEntry(int index, java.lang.Object resolvingValue)
index as resolved with given value.index - index of the column value within value lineresolvingValue - resolved valueprotected ValueLine.ValueEntry unresolveMissingEntry(int index)
index as unresolved.index - index of the column value within value linepublic void markUnrecoverable()
public void markUnrecoverable(java.lang.String reason)
public boolean isUnrecoverable()
public java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String getUnresolvedReason()
public java.lang.String getPlainUnresolvedReason()
public void setConflictingItemPK(PK conflictingItemPK)
public PK getConflictingItemPk()
public boolean isUsingJaloOnlyFeatures()
public void clearProcessedItemPK()
public AbstractCodeLine getAfterEachCode()
public void setAfterEachCode(AbstractCodeLine abstractCodeLine)
Copyright © 2018 SAP SE. All Rights Reserved.