Package com.wesabe.xmlson

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


    final XmlsonObject root = new XmlsonObject(name);
    root.addProperty("id", txaction.getId());
    root.addProperty("uri", String.format("/transactions/%d", txaction.getId()));
    root.add(accountPresenter.present(txaction.getAccount()));
    root.addProperty("date", ISO_BASIC.print(txaction.getDatePosted()));
    root.addProperty("original-date", ISO_BASIC.print(txaction.getOriginalDatePosted()));
    root.add(moneyPresenter.present("amount", txaction.getAmount(), locale));

    if (txaction.getMerchant() != null) {
      root.add(merchantPresenter.present(txaction.getMerchant()));
    } else {
View Full Code Here


    } else {
      root.addNullProperty("merchant");
    }
   
    if (txaction.getCheckNumber() != null) {
      root.addProperty("check-number", txaction.getCheckNumber());
    } else {
      root.addNullProperty("check-number");
    }
   
    if (!txaction.getAttachments().isEmpty()) {
View Full Code Here

        attachments.add(attachmentPresenter.present(attachment));
      }
      root.add(attachments);
    }
   
    root.addProperty("unedited-name", txaction.getUneditedName());
    root.addProperty("note", txaction.getNote());
   
    final XmlsonArray taggedAmounts = new XmlsonArray("tags");
    for (TaggedAmount taggedAmount : txaction.getTaggedAmounts()) {
      taggedAmounts.add(taggedAmountPresenter.present(taggedAmount, locale));
View Full Code Here

      }
      root.add(attachments);
    }
   
    root.addProperty("unedited-name", txaction.getUneditedName());
    root.addProperty("note", txaction.getNote());
   
    final XmlsonArray taggedAmounts = new XmlsonArray("tags");
    for (TaggedAmount taggedAmount : txaction.getTaggedAmounts()) {
      taggedAmounts.add(taggedAmountPresenter.present(taggedAmount, locale));
    }
View Full Code Here

*
*/
public class AccountBriefPresenter {
  public XmlsonObject present(Account account) {
    final XmlsonObject root = new XmlsonObject("account");
    root.addProperty("id", account.getRelativeId());
    root.addProperty("uri", String.format("/accounts/%d", account.getRelativeId()));
    root.addProperty("type", account.getAccountType().toString());
    return root;
  }
}
View Full Code Here

*/
public class AccountBriefPresenter {
  public XmlsonObject present(Account account) {
    final XmlsonObject root = new XmlsonObject("account");
    root.addProperty("id", account.getRelativeId());
    root.addProperty("uri", String.format("/accounts/%d", account.getRelativeId()));
    root.addProperty("type", account.getAccountType().toString());
    return root;
  }
}
View Full Code Here

public class AccountBriefPresenter {
  public XmlsonObject present(Account account) {
    final XmlsonObject root = new XmlsonObject("account");
    root.addProperty("id", account.getRelativeId());
    root.addProperty("uri", String.format("/accounts/%d", account.getRelativeId()));
    root.addProperty("type", account.getAccountType().toString());
    return root;
  }
}
View Full Code Here

    this.financialInstPresenter = financialInstPresenter;
  }

  public XmlsonObject present(Account account, Locale locale) {
    final XmlsonObject result = new XmlsonObject("account");
    result.addProperty("name", account.getName());
    result.addProperty("position", account.getPosition());
    // REVIEW coda@wesabe.com -- May 21, 2009: Replace account URI building once AccountResource is written
    result.addProperty("uri", String.format("/accounts/%d", account.getRelativeId()));
    result.addProperty("type", account.getAccountType().toString());
    result.addProperty("currency", account.getCurrency().getCurrencyCode());
View Full Code Here

  }

  public XmlsonObject present(Account account, Locale locale) {
    final XmlsonObject result = new XmlsonObject("account");
    result.addProperty("name", account.getName());
    result.addProperty("position", account.getPosition());
    // REVIEW coda@wesabe.com -- May 21, 2009: Replace account URI building once AccountResource is written
    result.addProperty("uri", String.format("/accounts/%d", account.getRelativeId()));
    result.addProperty("type", account.getAccountType().toString());
    result.addProperty("currency", account.getCurrency().getCurrencyCode());
    result.addProperty("status", account.getStatus().toString().toLowerCase(Locale.US));
View Full Code Here

  public XmlsonObject present(Account account, Locale locale) {
    final XmlsonObject result = new XmlsonObject("account");
    result.addProperty("name", account.getName());
    result.addProperty("position", account.getPosition());
    // REVIEW coda@wesabe.com -- May 21, 2009: Replace account URI building once AccountResource is written
    result.addProperty("uri", String.format("/accounts/%d", account.getRelativeId()));
    result.addProperty("type", account.getAccountType().toString());
    result.addProperty("currency", account.getCurrency().getCurrencyCode());
    result.addProperty("status", account.getStatus().toString().toLowerCase(Locale.US));
    if (account.hasBalance()) {
      final Money balance = account.getBalance();
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.