Package com.wesabe.xmlson

Examples of com.wesabe.xmlson.XmlsonObject.addProperty()


*
*/
public class InvestmentSecurityPresenter {
  public XmlsonObject present(InvestmentSecurity security) {
    final XmlsonObject root = new XmlsonObject("investment-security");
    root.addProperty("name", security.getName());
    if (security.getDisplayName() != null) {
      root.addProperty("display-name", security.getDisplayName());
    }
    root.addProperty("ticker", security.getTicker());
    root.addProperty("id", security.getId());
View Full Code Here


public class InvestmentSecurityPresenter {
  public XmlsonObject present(InvestmentSecurity security) {
    final XmlsonObject root = new XmlsonObject("investment-security");
    root.addProperty("name", security.getName());
    if (security.getDisplayName() != null) {
      root.addProperty("display-name", security.getDisplayName());
    }
    root.addProperty("ticker", security.getTicker());
    root.addProperty("id", security.getId());
    root.addProperty("uri", String.format("/investment-transactions/investment-security/%d", security.getId()));
    return root;
View Full Code Here

    final XmlsonObject root = new XmlsonObject("investment-security");
    root.addProperty("name", security.getName());
    if (security.getDisplayName() != null) {
      root.addProperty("display-name", security.getDisplayName());
    }
    root.addProperty("ticker", security.getTicker());
    root.addProperty("id", security.getId());
    root.addProperty("uri", String.format("/investment-transactions/investment-security/%d", security.getId()));
    return root;
  }
}
View Full Code Here

    root.addProperty("name", security.getName());
    if (security.getDisplayName() != null) {
      root.addProperty("display-name", security.getDisplayName());
    }
    root.addProperty("ticker", security.getTicker());
    root.addProperty("id", security.getId());
    root.addProperty("uri", String.format("/investment-transactions/investment-security/%d", security.getId()));
    return root;
  }
}
View Full Code Here

    if (security.getDisplayName() != null) {
      root.addProperty("display-name", security.getDisplayName());
    }
    root.addProperty("ticker", security.getTicker());
    root.addProperty("id", security.getId());
    root.addProperty("uri", String.format("/investment-transactions/investment-security/%d", security.getId()));
    return root;
  }
}
View Full Code Here

*
*/
public class MerchantReferencePresenter {
  public XmlsonObject present(Merchant merchant) {
    final XmlsonObject root = new XmlsonObject("merchant");
    root.addProperty("name", merchant.getName());
    root.addProperty("id", merchant.getId());
    root.addProperty("uri", String.format("/transactions/merchant/%d", merchant.getId()));
    return root;
  }
}
View Full Code Here

*/
public class MerchantReferencePresenter {
  public XmlsonObject present(Merchant merchant) {
    final XmlsonObject root = new XmlsonObject("merchant");
    root.addProperty("name", merchant.getName());
    root.addProperty("id", merchant.getId());
    root.addProperty("uri", String.format("/transactions/merchant/%d", merchant.getId()));
    return root;
  }
}
View Full Code Here

public class MerchantReferencePresenter {
  public XmlsonObject present(Merchant merchant) {
    final XmlsonObject root = new XmlsonObject("merchant");
    root.addProperty("name", merchant.getName());
    root.addProperty("id", merchant.getId());
    root.addProperty("uri", String.format("/transactions/merchant/%d", merchant.getId()));
    return root;
  }
}
View Full Code Here

  }
 
  public XmlsonObject present(AccountBalance accountBalance, Locale locale) {
    final XmlsonObject result = new XmlsonObject("account-balance");
   
    result.addProperty("uri", String.format("/accounts/%d/balances/%d", accountBalance.getAccount().getRelativeId(), accountBalance.getId()));
    result.add(moneyPresenter.present("balance", accountBalance.getBalance(), locale));
    result.addProperty("date", ISODateTimeFormat.basicDate().print(accountBalance.getDate()));
   
    return result;
  }
View Full Code Here

  public XmlsonObject present(AccountBalance accountBalance, Locale locale) {
    final XmlsonObject result = new XmlsonObject("account-balance");
   
    result.addProperty("uri", String.format("/accounts/%d/balances/%d", accountBalance.getAccount().getRelativeId(), accountBalance.getId()));
    result.add(moneyPresenter.present("balance", accountBalance.getBalance(), locale));
    result.addProperty("date", ISODateTimeFormat.basicDate().print(accountBalance.getDate()));
   
    return result;
  }
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.