public class RowMeta extends Object implements RowMetaInterface
| Modifier and Type | Field and Description |
|---|---|
static String |
XML_DATA_TAG |
static String |
XML_META_TAG |
| Constructor and Description |
|---|
RowMeta() |
RowMeta(DataInputStream inputStream) |
RowMeta(Node node)
Create a new row metadata object from XML
|
| Modifier and Type | Method and Description |
|---|---|
void |
addRowMeta(RowMetaInterface rowMeta)
Add a number of fields from another row (append to the end).
|
void |
addValueMeta(int index,
ValueMetaInterface meta)
Add a metadata value on a certain location in the row.
|
void |
addValueMeta(ValueMetaInterface meta)
Add a metadata value.
|
void |
clear()
Clear the row metadata.
|
RowMeta |
clone()
Clone this RowMetaInterface object.
|
Object[] |
cloneRow(Object[] objects)
Clone row.
|
Object[] |
cloneRow(Object[] objects,
Object[] newObjects)
Clone row.
|
RowMetaInterface |
cloneToType(int targetType)
This method copies the row metadata and sets all values to the specified type (usually String)
|
int |
compare(Object[] rowData1,
Object[] rowData2)
Compare 2 rows with each other using all values in the rows and also considering the specified ascending clauses of
the value metadata.
|
int |
compare(Object[] rowData1,
Object[] rowData2,
int[] fieldnrs)
Compare 2 rows with each other using certain values in the rows and also considering the specified ascending
clauses of the value metadata.
|
int |
compare(Object[] rowData1,
Object[] rowData2,
int[] fieldnrs1,
int[] fieldnrs2)
Compare 2 rows with each other using certain values in the rows and also considering the specified ascending
clauses of the value metadata.
|
int |
compare(Object[] rowData1,
RowMetaInterface rowMeta2,
Object[] rowData2,
int[] fieldnrs1,
int[] fieldnrs2)
Compare 2 rows with each other using certain values in the rows and also considering the specified ascending
clauses of the value metadata.
|
int |
convertedValuesHashCode(Object[] rowData)
Calculates a hashcode of the converted value of all objects in the supplied row.
|
static Row |
createOriginalRow(RowMetaInterface rowMeta,
Object[] rowData) |
boolean |
equals(Object[] rowData1,
Object[] rowData2,
int[] fieldnrs)
Compare 2 rows with each other for equality using certain values in the rows and also considering the case
sensitivity flag.
|
boolean |
exists(ValueMetaInterface meta)
Check if a value is already present in this row with the same name.
|
static byte[] |
extractData(RowMetaInterface metadata,
Object[] row)
Serialize a row of data to byte[]
|
BigDecimal |
getBigNumber(Object[] dataRow,
int index)
Get a BigNumber value from a row of data.
|
byte[] |
getBinary(Object[] dataRow,
int index)
Get a Binary value from a row of data.
|
Boolean |
getBoolean(Object[] dataRow,
int index)
Get a Boolean value from a row of data.
|
String |
getDataXML(Object[] rowData)
Gets the data xml.
|
Date |
getDate(Object[] dataRow,
int index)
Get a Date value from a row of data.
|
Date |
getDate(Object[] dataRow,
String valueName,
Date defaultValue)
Gets the date.
|
String[] |
getFieldNames()
Get an array of the names of all the Values in the Row.
|
String[] |
getFieldNamesAndTypes(int maxlen)
Get an array of strings showing the name of the values in the row padded to a maximum length, followed by the types
of the values.
|
Long |
getInteger(Object[] dataRow,
int index)
Get an Integer value from a row of data.
|
Long |
getInteger(Object[] dataRow,
String valueName,
Long defaultValue)
Gets the integer.
|
String |
getMetaXML()
Gets the meta xml.
|
Double |
getNumber(Object[] dataRow,
int index)
Get a Number value from a row of data.
|
Object[] |
getRow(Node node)
Convert an XML node into binary data using the row metadata supplied.
|
static Object[] |
getRow(RowMetaInterface metadata,
byte[] data)
Create a row of data bases on a serialized format (byte[])
|
String |
getString(Object[] row)
Get the string representation of the data in a row of data
|
String |
getString(Object[] dataRow,
int index)
Get a String value from a row of data.
|
String |
getString(Object[] dataRow,
String valueName,
String defaultValue)
Gets the string.
|
ValueMetaInterface |
getValueMeta(int index)
Get the value metadata on the specified index.
|
List<ValueMetaInterface> |
getValueMetaList()
Gets the value meta list.
|
int |
hashCode(Object[] rowData)
Calculates a simple hashCode of all the native data objects in the supplied row.
|
int |
indexOfValue(String valueName)
Searches the index of a value meta with a given name
|
boolean |
isEmpty()
Returns true if there are no elements in the row metadata.
|
boolean |
isNull(Object[] dataRow,
int index)
Determines whether a value in a row is null.
|
void |
mergeRowMeta(RowMetaInterface r)
Merge the values of row r to this Row.
|
void |
mergeRowMeta(RowMetaInterface r,
String originStepName)
Merge the values of row r to this Row.
|
int |
oldXORHashCode(Object[] rowData)
Deprecated.
|
Object[] |
readData(DataInputStream inputStream)
De-serialize a row of data (no metadata is read) from an input stream.
|
void |
removeValueMeta(int index)
Remove a value metadata object on a certain index in the row.
|
void |
removeValueMeta(String valueName)
Remove a value with a certain name from the row metadata.
|
ValueMetaInterface |
searchValueMeta(String valueName)
Searches for a value with a certain name in the value meta list
|
void |
setValueMeta(int index,
ValueMetaInterface valueMeta)
Replaces a value meta entry in the row metadata with another one
|
void |
setValueMetaList(List<ValueMetaInterface> valueMetaList)
Sets the value meta list.
|
int |
size()
Returns the size of the metadata row.
|
String |
toString() |
String |
toStringMeta()
To string meta.
|
void |
writeData(DataOutputStream outputStream,
Object[] data)
Write ONLY the specified data to the outputStream
|
void |
writeMeta(DataOutputStream outputStream)
Write ONLY the specified metadata to the outputStream
|
public static final String XML_META_TAG
public static final String XML_DATA_TAG
public RowMeta()
public RowMeta(DataInputStream inputStream) throws KettleFileException, SocketTimeoutException
public RowMeta(Node node) throws KettleException
node - the XML node to deserialize fromIOException - Thrown in case there is an (Base64/GZip) decoding problemKettleExceptionpublic RowMeta clone()
RowMetaInterfaceclone in interface RowMetaInterfaceclone in class Objectpublic RowMetaInterface cloneToType(int targetType) throws KettleValueException
cloneToType in interface RowMetaInterfacetargetType - The target typeif - the target type could not be loaded from the plugin registryKettleValueExceptionpublic List<ValueMetaInterface> getValueMetaList()
RowMetaInterfacegetValueMetaList in interface RowMetaInterfacepublic void setValueMetaList(List<ValueMetaInterface> valueMetaList)
RowMetaInterfacesetValueMetaList in interface RowMetaInterfacevalueMetaList - the list of valueMeta to setpublic int size()
RowMetaInterfacesize in interface RowMetaInterfacepublic boolean isEmpty()
RowMetaInterfaceisEmpty in interface RowMetaInterfacepublic boolean exists(ValueMetaInterface meta)
RowMetaInterfaceexists in interface RowMetaInterfacemeta - the value to check for existencepublic void addValueMeta(ValueMetaInterface meta)
addValueMeta in interface RowMetaInterfacemeta - The metadata value to addpublic void addValueMeta(int index,
ValueMetaInterface meta)
addValueMeta in interface RowMetaInterfaceindex - The index where the metadata value needs to be put in the rowmeta - The metadata value to add to the rowpublic ValueMetaInterface getValueMeta(int index)
getValueMeta in interface RowMetaInterfaceindex - The index to get the value metadata frompublic void setValueMeta(int index,
ValueMetaInterface valueMeta)
setValueMeta in interface RowMetaInterfaceindex - The index in the row to replace atvalueMeta - the metadata to replace withpublic String getString(Object[] dataRow, int index) throws KettleValueException
getString in interface RowMetaInterfacedataRow - the row of dataindex - the indexKettleValueException - in case there was a problem converting the data.public Long getInteger(Object[] dataRow, int index) throws KettleValueException
getInteger in interface RowMetaInterfacedataRow - the row of dataindex - the indexKettleValueException - in case there was a problem converting the data.public Double getNumber(Object[] dataRow, int index) throws KettleValueException
getNumber in interface RowMetaInterfacedataRow - the row of dataindex - the indexKettleValueException - in case there was a problem converting the data.public Date getDate(Object[] dataRow, int index) throws KettleValueException
getDate in interface RowMetaInterfacedataRow - the row of dataindex - the indexKettleValueException - in case there was a problem converting the data.public BigDecimal getBigNumber(Object[] dataRow, int index) throws KettleValueException
getBigNumber in interface RowMetaInterfacedataRow - the row of dataindex - the indexKettleValueException - in case there was a problem converting the data.public Boolean getBoolean(Object[] dataRow, int index) throws KettleValueException
getBoolean in interface RowMetaInterfacedataRow - the row of dataindex - the indexKettleValueException - in case there was a problem converting the data.public byte[] getBinary(Object[] dataRow, int index) throws KettleValueException
getBinary in interface RowMetaInterfacedataRow - the row of dataindex - the indexKettleValueException - in case there was a problem converting the data.public boolean isNull(Object[] dataRow, int index) throws KettleValueException
isNull in interface RowMetaInterfacedataRow - The row of dataindex - the index to referenceKettleValueException - in case there is a conversion error (only thrown in case of lazy conversion)public Object[] cloneRow(Object[] objects) throws KettleValueException
RowMetaInterfacecloneRow in interface RowMetaInterfaceobjects - object to cloneKettleValueException - in case something is not quite right with the expected datapublic Object[] cloneRow(Object[] objects, Object[] newObjects) throws KettleValueException
RowMetaInterfacecloneRow in interface RowMetaInterfaceobjects - objects to clonenewObjects - objects to clone toKettleValueException - in case something is not quite right with the expected datapublic String getString(Object[] dataRow, String valueName, String defaultValue) throws KettleValueException
RowMetaInterfacegetString in interface RowMetaInterfacedataRow - the data rowvalueName - the value namedefaultValue - the default valueKettleValueException - the kettle value exceptionpublic Long getInteger(Object[] dataRow, String valueName, Long defaultValue) throws KettleValueException
RowMetaInterfacegetInteger in interface RowMetaInterfacedataRow - the data rowvalueName - the value namedefaultValue - the default valueKettleValueException - the kettle value exceptionpublic Date getDate(Object[] dataRow, String valueName, Date defaultValue) throws KettleValueException
RowMetaInterfacegetDate in interface RowMetaInterfacedataRow - the data rowvalueName - the value namedefaultValue - the default valueKettleValueException - the kettle value exceptionpublic int indexOfValue(String valueName)
indexOfValue in interface RowMetaInterfacevalueName - the name of the value metadata to look forpublic ValueMetaInterface searchValueMeta(String valueName)
searchValueMeta in interface RowMetaInterfacevalueName - The value name to search forpublic void addRowMeta(RowMetaInterface rowMeta)
RowMetaInterfaceaddRowMeta in interface RowMetaInterfacerowMeta - The row of metadata values to addpublic void mergeRowMeta(RowMetaInterface r)
mergeRowMeta in interface RowMetaInterfacer - The row to be merged with this rowpublic void mergeRowMeta(RowMetaInterface r, String originStepName)
mergeRowMeta in interface RowMetaInterfacer - The row to be merged with this roworiginStepName - The name to use as the origin steppublic String[] getFieldNames()
getFieldNames in interface RowMetaInterfacepublic void writeData(DataOutputStream outputStream, Object[] data) throws KettleFileException
writeData in interface RowMetaInterfaceoutputStream - the outputstream to write todata - the data to write after the metadataKettleFileException - in case things go awrypublic void writeMeta(DataOutputStream outputStream) throws KettleFileException
writeMeta in interface RowMetaInterfaceoutputStream - the outputstream to write toKettleFileException - in case things go awrypublic Object[] readData(DataInputStream inputStream) throws KettleFileException, SocketTimeoutException
RowMetaInterfacereadData in interface RowMetaInterfaceinputStream - the inputstream to read fromKettleFileException - in case a I/O error occursSocketTimeoutException - In case there is a timeout during reading.public void clear()
RowMetaInterfaceclear in interface RowMetaInterfacepublic void removeValueMeta(String valueName) throws KettleValueException
RowMetaInterfaceremoveValueMeta in interface RowMetaInterfacevalueName - the name of the value metadata to removeKettleValueException - in case the value couldn't be found in the row metadatapublic void removeValueMeta(int index)
RowMetaInterfaceremoveValueMeta in interface RowMetaInterfaceindex - the index to remove the value metadata frompublic String toStringMeta()
RowMetaInterfacetoStringMeta in interface RowMetaInterfacepublic String getString(Object[] row) throws KettleValueException
getString in interface RowMetaInterfacerow - the row of data to convert to stringKettleValueException - in case of a conversion errorpublic String[] getFieldNamesAndTypes(int maxlen)
getFieldNamesAndTypes in interface RowMetaInterfacemaxlen - The length to which the name will be padded.public int compare(Object[] rowData1, Object[] rowData2, int[] fieldnrs) throws KettleValueException
compare in interface RowMetaInterfacerowData1 - The first row of datarowData2 - The second row of datafieldnrs - the fields to compare on (in that order)KettleValueExceptionpublic boolean equals(Object[] rowData1, Object[] rowData2, int[] fieldnrs) throws KettleValueException
equals in interface RowMetaInterfacerowData1 - The first row of datarowData2 - The second row of datafieldnrs - the fields to compare on (in that order)KettleValueExceptionpublic int compare(Object[] rowData1, Object[] rowData2, int[] fieldnrs1, int[] fieldnrs2) throws KettleValueException
compare in interface RowMetaInterfacerowData1 - The first row of datarowData2 - The second row of datafieldnrs1 - The indexes of the values to compare in the first rowfieldnrs2 - The indexes of the values to compare with in the second rowKettleValueExceptionpublic int compare(Object[] rowData1, RowMetaInterface rowMeta2, Object[] rowData2, int[] fieldnrs1, int[] fieldnrs2) throws KettleValueException
compare in interface RowMetaInterfacerowData1 - The first row of datarowMeta2 - the metadata of the second row of datarowData2 - The second row of datafieldnrs1 - The indexes of the values to compare in the first rowfieldnrs2 - The indexes of the values to compare with in the second rowKettleValueExceptionpublic int compare(Object[] rowData1, Object[] rowData2) throws KettleValueException
compare in interface RowMetaInterfacerowData1 - The first row of datarowData2 - The second row of dataKettleValueException@Deprecated public int oldXORHashCode(Object[] rowData) throws KettleValueException
oldXORHashCode in interface RowMetaInterfacerowData - The data to calculate a hashCode withKettleValueException - in case there is a data conversion errorpublic int hashCode(Object[] rowData) throws KettleValueException
hashCode in interface RowMetaInterfacerowData - The data to calculate a hashCode withKettleValueException - in case there is a data conversion errorpublic int convertedValuesHashCode(Object[] rowData) throws KettleValueException
convertedValuesHashCode in interface RowMetaInterfacerowData - The data to calculate a hashCode withKettleValueException - in case there is a data conversion errorpublic static byte[] extractData(RowMetaInterface metadata, Object[] row)
metadata - the metadata to userow - the row of datapublic static Object[] getRow(RowMetaInterface metadata, byte[] data)
data - the serialized datametadata - the metadata to usepublic static Row createOriginalRow(RowMetaInterface rowMeta, Object[] rowData) throws KettleValueException
KettleValueExceptionpublic String getMetaXML() throws IOException
RowMetaInterfacegetMetaXML in interface RowMetaInterfaceIOException - Thrown in case there is an (Base64/GZip) encoding problempublic String getDataXML(Object[] rowData) throws IOException
RowMetaInterfacegetDataXML in interface RowMetaInterfacerowData - the row of data to serialize as XMLIOException - Thrown in case there is an (Base64/GZip) encoding problempublic Object[] getRow(Node node) throws KettleException
getRow in interface RowMetaInterfacenode - The data row nodeIOException - Thrown in case there is an (Base64/GZip) decoding problemKettleException - Thrown in case there is an (Base64/GZip) decoding problemCopyright © 2020 Hitachi Vantara. All rights reserved.