Package org.compiere.impexp
Class ImpFormatRow
java.lang.Object
org.compiere.impexp.ImpFormatRow
Import Format Row with parsing capability
- Version:
- $Id: ImpFormatRow.java,v 1.2 2006/07/30 00:51:05 jjanke Exp $ globalqss: integrate Teo Sarca bug fix [ 1623817 ] Minor bug on importing calendar date
- Author:
- Jorg Janke, Trifon Trifonov, Catura AG (www.catura.de)
- FR [ 3010957 ] Custom Separator Character, https://sourceforge.net/p/adempiere/feature-requests/975/
-
Constructor Summary
ConstructorDescriptionImpFormatRow
(int seqNo, String columnName, int startNo, int endNo, String dataType, int maxLength, String name) Constructor for fixed formatImpFormatRow
(int seqNo, String columnName, String dataType, int maxLength) Constructor for non-fixed format -
Method Summary
Modifier and TypeMethodDescriptionGet Column NameGet the constant valueGet FormatData TypeGet Decimal Pointint
getEndNo()
Get End PositiongetName()
Get Nameint
getSeqNo()
Sequence Noint
Get Start Positionboolean
Is Constantboolean
isDate()
Is Dateboolean
Divide result by 100boolean
isNumber()
Is Numberboolean
isString()
Is StringParse value.void
setColumnName
(String columnName) Columnvoid
setDataType
(String dataType) Data Typevoid
setEndNo
(int newEndNo) End Positionvoid
setFormatInfo
(String dataFormat, String decimalPoint, boolean divideBy100, String constantValue, String callout, String importprefix) Set Format Infovoid
setMaxLength
(int maxLength) Set maximum length for Strings (truncated).void
Namevoid
setSeqNo
(int newSeqNo) Set Sequence Novoid
setStartNo
(int newStartNo) Start Position
-
Constructor Details
-
ImpFormatRow
public ImpFormatRow(int seqNo, String columnName, int startNo, int endNo, String dataType, int maxLength, String name) Constructor for fixed format- Parameters:
seqNo
- sequencecolumnName
- db column namestartNo
- start noendNo
- and nodataType
- data type - see constants DATATYPE_maxLength
- if String it is the maximum length (truncated)name
- column label
-
ImpFormatRow
Constructor for non-fixed format- Parameters:
seqNo
- sequencecolumnName
- db column namedataType
- data type - see constants DATATYPE_maxLength
- if String it is the maximum length (truncated)
-
-
Method Details
-
getSeqNo
public int getSeqNo()Sequence No- Returns:
- seq no
-
setSeqNo
public void setSeqNo(int newSeqNo) Set Sequence No- Parameters:
newSeqNo
- sequence
-
setStartNo
public void setStartNo(int newStartNo) Start Position- Parameters:
newStartNo
- start position
-
getStartNo
public int getStartNo()Get Start Position- Returns:
- start position
-
setEndNo
public void setEndNo(int newEndNo) End Position- Parameters:
newEndNo
- end position
-
getEndNo
public int getEndNo()Get End Position- Returns:
- End Position
-
setColumnName
Column- Parameters:
columnName
- column name
-
getColumnName
Get Column Name- Returns:
- Column Name
-
setName
Name- Parameters:
name
- name
-
getName
Get Name- Returns:
- Name
-
setDataType
Data Type- Parameters:
dataType
- data type - see constants DATATYPE_
-
getDataType
Data Type- Returns:
- data type
-
isString
public boolean isString()Is String- Returns:
- true if data type is String
-
isNumber
public boolean isNumber()Is Number- Returns:
- true if data type is Number
-
isDate
public boolean isDate()Is Date- Returns:
- true if data type is Date
-
isConstant
public boolean isConstant()Is Constant- Returns:
- true if data type is Constant
-
setFormatInfo
public void setFormatInfo(String dataFormat, String decimalPoint, boolean divideBy100, String constantValue, String callout, String importprefix) Set Format Info- Parameters:
dataFormat
- data format - see constants DATATYPE_decimalPoint
- decimal point representationdivideBy100
- divide number by 100constantValue
- constant valuecallout
- Java calloutimportprefix
- Prefix to be added if value is not null or empty
-
getDataFormat
Get Format- Returns:
- Data Format
-
getDecimalPoint
Get Decimal Point- Returns:
- Decimal Point
-
isDivideBy100
public boolean isDivideBy100()Divide result by 100- Returns:
- true if result will be divided by 100
-
getConstantValue
Get the constant value- Returns:
- constant value
-
setMaxLength
public void setMaxLength(int maxLength) Set maximum length for Strings (truncated). Ignored, if 0.- Parameters:
maxLength
- max length
-
parse
Parse value. Field content in [] are treated as comments- Parameters:
info
- data item- Returns:
- parsed info
-