BVB Source Codes

spring-mvc-showcase Show JavaBean.java Source code

Return Download spring-mvc-showcase: download JavaBean.java Source code - Download spring-mvc-showcase Source code - Type:.java
  1. package org.springframework.samples.mvc.convert;
  2.  
  3. import java.util.Date;
  4. import java.util.List;
  5. import java.util.Map;
  6.  
  7. import org.springframework.format.annotation.DateTimeFormat;
  8. import org.springframework.format.annotation.DateTimeFormat.ISO;
  9.  
  10. public class JavaBean {
  11.        
  12.         private Integer primitive;
  13.        
  14.         @DateTimeFormat(iso=ISO.DATE)
  15.         private Date date;
  16.  
  17.         @MaskFormat("(###) ###-####")
  18.         private String masked;
  19.  
  20.         // list will auto-grow as its dereferenced e.g. list[0]=value
  21.         private List<Integer> list;
  22.  
  23.         // annotation type conversion rule will be applied to each list element
  24.         @DateTimeFormat(iso=ISO.DATE)
  25.         private List<Date> formattedList;
  26.  
  27.         // map will auto-grow as its dereferenced e.g. map[key]=value
  28.         private Map<Integer, String> map;
  29.  
  30.         // nested will be set when it is referenced e.g. nested.foo=value
  31.         private NestedBean nested;
  32.  
  33.     public Integer getPrimitive() {
  34.                 return primitive;
  35.         }
  36.  
  37.         public void setPrimitive(Integer primitive) {
  38.                 this.primitive = primitive;
  39.         }
  40.  
  41.         public Date getDate() {
  42.                 return date;
  43.         }
  44.  
  45.         public void setDate(Date date) {
  46.                 this.date = date;
  47.         }
  48.  
  49.         public String getMasked() {
  50.                 return masked;
  51.         }
  52.  
  53.         public void setMasked(String masked) {
  54.                 this.masked = masked;
  55.         }
  56.  
  57.         public List<Integer> getList() {
  58.                 return list;
  59.         }
  60.  
  61.         public void setList(List<Integer> list) {
  62.                 this.list = list;
  63.         }
  64.  
  65.         public List<Date> getFormattedList() {
  66.                 return formattedList;
  67.         }
  68.  
  69.         public void setFormattedList(List<Date> formattedList) {
  70.                 this.formattedList = formattedList;
  71.         }
  72.  
  73.         public Map<Integer, String> getMap() {
  74.                 return map;
  75.         }
  76.  
  77.         public void setMap(Map<Integer, String> map) {
  78.                 this.map = map;
  79.         }
  80.  
  81.         public NestedBean getNested() {
  82.                 return nested;
  83.         }
  84.  
  85.         public void setNested(NestedBean nested) {
  86.                 this.nested = nested;
  87.         }
  88.  
  89.         public String toString() {
  90.         StringBuilder sb = new StringBuilder();
  91.         sb.append("JavaBean");
  92.         if (primitive != null) {
  93.                 sb.append(" primitive=").append(primitive);
  94.         }
  95.         if (date != null) {
  96.             sb.append(" date=").append(date);          
  97.         }
  98.         if (masked != null) {
  99.                 sb.append(" masked=").append(masked);
  100.         }
  101.         if (list != null) {
  102.             sb.append(" list=").append(list);          
  103.         }
  104.         if (formattedList != null) {
  105.             sb.append(" formattedList=").append(formattedList);        
  106.         }
  107.         if (map != null) {
  108.             sb.append(" map=").append(map);            
  109.         }
  110.         if (nested != null) {          
  111.             sb.append(" nested=").append(nested);
  112.         }
  113.         return sb.toString();
  114.     }
  115. }
  116.  
downloadJavaBean.java Source code - Download spring-mvc-showcase Source code
Related Source Codes/Software:
tushare - TuShare is a utility for crawling historical data ... 2017-01-12
raml-spec - RAML Specification http://raml.... 2017-01-12
android-stackblur - Android StackBlur is a library that can perform a ... 2017-01-12
sound-redux - A Soundcloud client built with React / Redux ... 2017-01-12
httpstat - curl statistics made simple 2017-01-12
discover-flask - Full Stack Web Development with Flask. ... 2017-01-12
micro - Async HTTP microservices made easy ... 2017-01-12
gobot - Golang framework for robotics, drones, and the Int... 2017-01-11
mas - 2017-01-13
Zappa - Serverless Python Web Services ... 2017-01-12
FrameworkBenchmarks - Source code for the framework benchmarking project... 2017-02-22
buildbot - Python-based continuous integration testing framew... 2017-02-22
rufus - The Reliable USB Formatting Utility ... 2017-02-22
uiGradients - Beautiful colour gradients for design and code ... 2017-02-22
Haxl - A Haskell library that simplifies access to remote... 2017-02-21
duktape - Duktape - embeddable Javascript engine with a focu... 2017-02-21
scala-best-practices - A collection of Scala best practice 2017-02-21
hammerspoon - Staggeringly powerful OS X desktop automation with... 2017-02-21
DGElasticPullToRefresh - Elastic pull to refresh for iOS developed in Swift 2017-02-21
evercookie - evercookie is a javascript API that produces extre... 2017-02-21

 Back to top