List of usage examples for com.google.gwt.xml.client Element getAttribute
String getAttribute(String name);
name. From source file:carteirainveste.client.DateUtil.java
License:Creative Commons License
static void loadFromDb(Element elem) throws IllegalArgumentException { String strSellSpread = elem.getAttribute("stock_sell_spread"); String strBrokerFeeCents = elem.getAttribute("stock_broker_fee"); String strStockTaxExemptionCents = elem.getAttribute("stock_tax_exemption_limit"); String strStockTaxFee = elem.getAttribute("stock_tax_fee"); String strStockDayTradeTaxFee = elem.getAttribute("stock_daytrade_tax_fee"); String strStockDayTradeAffectExemptionLimit = elem.getAttribute("stock_daytrade_affect_exemption_limit"); String strStockExemptGainsReduceCarriedLoss = elem.getAttribute("stock_exempt_gains_reduce_carried_loss"); String strStockTaxRatioOverPretaxEarnings = elem.getAttribute("stock_tax_ratio_over_pretax_earnings"); String strStockStartTaxCarryLoss = elem.getAttribute("stock_tax_start_carry_loss"); String strStockStartTaxDayTradeCarryLoss = elem.getAttribute("stock_tax_daytrade_start_carry_loss"); if (strSellSpread != null) sellSpread = Double.parseDouble(strSellSpread); if (strBrokerFeeCents != null) brokerFeeCents = Long.parseLong(strBrokerFeeCents); if (strStockTaxExemptionCents != null) stockTaxExemptionCents = Long.parseLong(strStockTaxExemptionCents); if (strStockTaxFee != null) stockTaxFee = Double.parseDouble(strStockTaxFee); if (strStockDayTradeTaxFee != null) stockDayTradeTaxFee = Double.parseDouble(strStockDayTradeTaxFee); if (strStockDayTradeAffectExemptionLimit != null) stockDayTradeAffectExemptionLimit.setValue(Boolean.parseBoolean(strStockDayTradeAffectExemptionLimit)); if (strStockExemptGainsReduceCarriedLoss != null) stockExemptGainsReduceCarriedLoss.setValue(Boolean.parseBoolean(strStockExemptGainsReduceCarriedLoss)); if (strStockTaxRatioOverPretaxEarnings != null) stockTaxRatioOverPretaxEarnings.setValue(Boolean.parseBoolean(strStockTaxRatioOverPretaxEarnings)); if (strStockStartTaxCarryLoss != null) startTaxCarryLoss.setText(strStockStartTaxCarryLoss); if (strStockStartTaxDayTradeCarryLoss != null) startTaxDayTradeCarryLoss.setText(strStockStartTaxDayTradeCarryLoss); }
From source file:carteirainveste.client.DateUtil.java
License:Creative Commons License
Quote(Element elem) throws IllegalArgumentException { quoteDate = Preference.dateFormat.parse(elem.getAttribute("date")); quoteAssetName = elem.getAttribute("asset_name"); quoteAssetAmount = Double.parseDouble(elem.getAttribute("asset_amount")); quoteValue = Double.parseDouble(elem.getAttribute("value")); key = makeKey(quoteAssetName, quoteDate); }
From source file:carteirainveste.client.DateUtil.java
License:Creative Commons License
Yield(Element elem) throws IllegalArgumentException { super();//from ww w. j a v a2 s.c om yieldType = findYieldType(elem.getAttribute("yield_type")); yieldDate = Preference.dateFormat.parse(elem.getAttribute("date")); //yieldTaxYear = Integer.parseInt(elem.getAttribute("tax_year")); yieldAsset = elem.getAttribute("asset_name"); yieldAssetAmount = Double.parseDouble(elem.getAttribute("asset_amount")); yieldGrossCents = Long.parseLong(elem.getAttribute("gross_value")); yieldNetCents = Long.parseLong(elem.getAttribute("net_value")); yieldAccount = elem.getAttribute("account"); }
From source file:carteirainveste.client.DateUtil.java
License:Creative Commons License
Split(Element elem) throws IllegalArgumentException { super();// w w w .j ava2 s. c o m splitDate = Preference.dateFormat.parse(elem.getAttribute("date")); splitAsset = elem.getAttribute("asset_name"); splitFrom = Double.parseDouble(elem.getAttribute("from")); splitTo = Double.parseDouble(elem.getAttribute("to")); }
From source file:carteirainveste.client.DateUtil.java
License:Creative Commons License
Buy(Element elem) throws IllegalArgumentException { super();/*from ww w . ja v a2 s . co m*/ //buyDate = DateFormat.getDateInstance().parse(elem.getAttribute("date")); //buyDate = buyDate.parse(elem.getAttribute("date")); buyDate = Preference.dateFormat.parse(elem.getAttribute("date")); buyAssetType = Asset.findAssetType(elem.getAttribute("asset_type")); buyAssetName = elem.getAttribute("asset_name"); buyAmount = Double.parseDouble(elem.getAttribute("amount")); buyCostCents = Long.parseLong(elem.getAttribute("cost")); buyExpenseCents = Long.parseLong(elem.getAttribute("expense")); buyAccount = elem.getAttribute("account"); }
From source file:carteirainveste.client.DateUtil.java
License:Creative Commons License
Sell(Element elem) throws IllegalArgumentException { super();/*from w w w . ja va 2 s .c o m*/ sellDate = Preference.dateFormat.parse(elem.getAttribute("date")); sellAssetType = Asset.findAssetType(elem.getAttribute("asset_type")); sellAssetName = elem.getAttribute("asset_name"); sellAmount = Double.parseDouble(elem.getAttribute("amount")); try { sellGrossValueCents = Long.parseLong(elem.getAttribute("gross")); } catch (NumberFormatException e) { sellGrossValueCents = 0; } try { sellNetRevenueCents = Long.parseLong(elem.getAttribute("revenue")); } catch (NumberFormatException e) { sellNetRevenueCents = 0; } try { sellRetainedTaxCents = Long.parseLong(elem.getAttribute("retained_tax")); } catch (NumberFormatException e) { sellRetainedTaxCents = 0; } sellAccount = elem.getAttribute("account"); }
From source file:carteirainveste.client.DateUtil.java
License:Creative Commons License
DayTrade(Element elem) throws IllegalArgumentException { super();//from w ww . j a v a 2 s . co m dtDate = Preference.dateFormat.parse(elem.getAttribute("date")); dtAssetName = elem.getAttribute("asset_name"); dtAmount = Double.parseDouble(elem.getAttribute("amount")); dtAccount = elem.getAttribute("account"); try { dtBuyGrossValueCents = Long.parseLong(elem.getAttribute("buy_gross")); } catch (NumberFormatException e) { dtBuyGrossValueCents = 0; } try { dtSellGrossValueCents = Long.parseLong(elem.getAttribute("sell_gross")); } catch (NumberFormatException e) { dtSellGrossValueCents = 0; } try { dtSellNetValueCents = Long.parseLong(elem.getAttribute("sell_net")); } catch (NumberFormatException e) { dtSellNetValueCents = 0; } try { dtRetainedTaxCents = Long.parseLong(elem.getAttribute("retained_tax")); } catch (NumberFormatException e) { dtRetainedTaxCents = 0; } }
From source file:carteirainveste.client.DateUtil.java
License:Creative Commons License
Deposit(Element elem) throws IllegalArgumentException { super();//from w w w . j a va 2 s .c o m //depDate = DateFormat.getDateInstance().parse(elem.getAttribute("date")); //depDate = depDate.parse(elem.getAttribute("date")); depDate = Preference.dateFormat.parse(elem.getAttribute("date")); depAccount = elem.getAttribute("account"); try { depValueCents = Long.parseLong(elem.getAttribute("value")); } catch (NumberFormatException e) { depValueCents = 0; } try { depExpenseCents = Long.parseLong(elem.getAttribute("expense")); } catch (NumberFormatException e) { depExpenseCents = 0; } }
From source file:carteirainveste.client.DateUtil.java
License:Creative Commons License
Withdraw(Element elem) throws IllegalArgumentException { super();//ww w .jav a2s . c om wdrawDate = Preference.dateFormat.parse(elem.getAttribute("date")); wdrawAccount = elem.getAttribute("account"); wdrawValueCents = Long.parseLong(elem.getAttribute("value")); }
From source file:carteirainveste.client.DateUtil.java
License:Creative Commons License
Transfer(Element elem) throws IllegalArgumentException { super();/* ww w. jav a 2 s . c o m*/ transferDate = Preference.dateFormat.parse(elem.getAttribute("date")); transferAccountFrom = elem.getAttribute("account_from"); transferAccountTo = elem.getAttribute("account_to"); transferValueCents = Long.parseLong(elem.getAttribute("value")); }