Package com.wesabe.xmlson

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


*
*/
public class AttachmentPresenter {
  public XmlsonObject present(Attachment attachment) {
    final XmlsonObject root = new XmlsonObject("attachment");
    root.addProperty("guid", attachment.getGuid());
    root.addProperty("filename", attachment.getFilename());
    root.addProperty("content-type", attachment.getContentType());
    root.addProperty("size", attachment.getSize());
    root.addProperty("description", attachment.getDescription());
    return root;
View Full Code Here


*/
public class AttachmentPresenter {
  public XmlsonObject present(Attachment attachment) {
    final XmlsonObject root = new XmlsonObject("attachment");
    root.addProperty("guid", attachment.getGuid());
    root.addProperty("filename", attachment.getFilename());
    root.addProperty("content-type", attachment.getContentType());
    root.addProperty("size", attachment.getSize());
    root.addProperty("description", attachment.getDescription());
    return root;
  }
View Full Code Here

public class AttachmentPresenter {
  public XmlsonObject present(Attachment attachment) {
    final XmlsonObject root = new XmlsonObject("attachment");
    root.addProperty("guid", attachment.getGuid());
    root.addProperty("filename", attachment.getFilename());
    root.addProperty("content-type", attachment.getContentType());
    root.addProperty("size", attachment.getSize());
    root.addProperty("description", attachment.getDescription());
    return root;
  }
}
View Full Code Here

  public XmlsonObject present(Attachment attachment) {
    final XmlsonObject root = new XmlsonObject("attachment");
    root.addProperty("guid", attachment.getGuid());
    root.addProperty("filename", attachment.getFilename());
    root.addProperty("content-type", attachment.getContentType());
    root.addProperty("size", attachment.getSize());
    root.addProperty("description", attachment.getDescription());
    return root;
  }
}
View Full Code Here

    final XmlsonObject root = new XmlsonObject("attachment");
    root.addProperty("guid", attachment.getGuid());
    root.addProperty("filename", attachment.getFilename());
    root.addProperty("content-type", attachment.getContentType());
    root.addProperty("size", attachment.getSize());
    root.addProperty("description", attachment.getDescription());
    return root;
  }
}
View Full Code Here

    this.moneyPresenter = moneyPresenter;
  }
 
  public XmlsonObject present(String name, SumOfMoney sum, Locale locale) {
    final XmlsonObject root = moneyPresenter.present(name, sum.getAmount(), locale);
    root.addProperty("count", sum.getCount());
    return root;
  }
}
View Full Code Here

public class InvalidStateExceptionPresenter {

  public XmlsonObject present(InvalidStateException exception) {
    final XmlsonObject error = new XmlsonObject("error");
    error.addProperty("type", "validation");
   
    final XmlsonArray invalidValues = new XmlsonArray("invalid-values");
    for (InvalidValue invalidValue : exception.getInvalidValues()) {
      final XmlsonObject value = new XmlsonObject("invalid-value");
      value.addProperty("class", invalidValue.getBeanClass().getName());
View Full Code Here

    error.addProperty("type", "validation");
   
    final XmlsonArray invalidValues = new XmlsonArray("invalid-values");
    for (InvalidValue invalidValue : exception.getInvalidValues()) {
      final XmlsonObject value = new XmlsonObject("invalid-value");
      value.addProperty("class", invalidValue.getBeanClass().getName());
      value.addProperty("field", invalidValue.getPropertyName());
      value.addProperty("message", invalidValue.getMessage());
      invalidValues.add(value);
    }
    error.add(invalidValues);
View Full Code Here

   
    final XmlsonArray invalidValues = new XmlsonArray("invalid-values");
    for (InvalidValue invalidValue : exception.getInvalidValues()) {
      final XmlsonObject value = new XmlsonObject("invalid-value");
      value.addProperty("class", invalidValue.getBeanClass().getName());
      value.addProperty("field", invalidValue.getPropertyName());
      value.addProperty("message", invalidValue.getMessage());
      invalidValues.add(value);
    }
    error.add(invalidValues);
   
View Full Code Here

    final XmlsonArray invalidValues = new XmlsonArray("invalid-values");
    for (InvalidValue invalidValue : exception.getInvalidValues()) {
      final XmlsonObject value = new XmlsonObject("invalid-value");
      value.addProperty("class", invalidValue.getBeanClass().getName());
      value.addProperty("field", invalidValue.getPropertyName());
      value.addProperty("message", invalidValue.getMessage());
      invalidValues.add(value);
    }
    error.add(invalidValues);
   
    return error;
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.