Package org.compiere.model
Class NaturalAccountMap<K,V>
- java.lang.Object
-
- org.compiere.util.CCache<K,V>
-
- org.compiere.model.NaturalAccountMap<K,V>
-
- Type Parameters:
K
- keyV
- value
- All Implemented Interfaces:
Serializable
,Map<K,V>
,CacheInterface
public final class NaturalAccountMap<K,V> extends CCache<K,V>
Natural Account (HashMap) Management. <String,MElementValue>The key is a String of the column name (e.g. SUSPENSEBALANCING_ACCT) The value is an NaturalAccount a) Account information are loaded via the parse functions b) Accounts are created via the createAccounts function c) retrieve the C_ElementValue_ID for the given key
Change log:
- 2007-02-12 - teo_sarca - [ 1658127 ] Select charset encoding on import
- 2007-01-27 - teo_sarca - [ 1619158 ] Import is not working with UTF-8
- Version:
- $Id: NaturalAccountMap.java,v 1.3 2006/07/30 00:51:02 jjanke Exp $
- Author:
- Jorg Janke
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.compiere.util.CCache
cache, DEFAULT_EXPIRE_MINUTE, nullList
-
-
Constructor Summary
Constructors Constructor Description NaturalAccountMap(Properties ctx, String trxName)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getC_ElementValue_ID(String key)
Get ElementValueString
parseFile(File file)
Read and Parse FileString
parseLine(String line, int lineNo)
Create Account Entry for Default Accounts only.boolean
saveAccounts(int AD_Client_ID, int AD_Org_ID, int C_Element_ID, boolean isActive)
Save all Accounts-
Methods inherited from class org.compiere.util.CCache
addVetoableChangeListener, clear, containsKey, containsValue, entrySet, get, getExpireMinutes, getHit, getMaxSize, getMiss, getName, getTableName, isDistributed, isEmpty, isExpire, isReset, keySet, newRecord, put, putAll, remove, removeVetoableChangeListener, reset, reset, setExpireMinutes, setUsed, size, sizeNoExpire, toString, values
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
-
-
-
-
Constructor Detail
-
NaturalAccountMap
public NaturalAccountMap(Properties ctx, String trxName)
Constructor. Parse File does the processing- Parameters:
ctx
- contexttrxName
- transaction
-
-
Method Detail
-
parseFile
public String parseFile(File file)
Read and Parse File- Parameters:
file
- Accounts file- Returns:
- error message or "" if OK
-
parseLine
public String parseLine(String line, int lineNo) throws Exception
Create Account Entry for Default Accounts only.- Parameters:
line
- line with info Line format (9 fields) 1 A [Account Value] 2 B [Account Name] 3 C [Description] 4 D [Account Type] 5 E [Account Sign] 6 F [Document Controlled] 7 G [Summary Account] 8 H [Default_Account] 9 I [Parent Value] - ignored- Returns:
- error message or "" if OK
- Throws:
Exception
-
saveAccounts
public boolean saveAccounts(int AD_Client_ID, int AD_Org_ID, int C_Element_ID, boolean isActive)
Save all Accounts- Parameters:
AD_Client_ID
- clientAD_Org_ID
- orgC_Element_ID
- elementisActive
-- Returns:
- true if created
-
getC_ElementValue_ID
public int getC_ElementValue_ID(String key)
Get ElementValue- Parameters:
key
- key- Returns:
- 0 if error
-
-