Loading...
Spring Framework Reference Documentation 7.0.2의 Classes Used in the Examples의 한국어 번역본입니다.
아래의 경우에 피드백에서 신고해주신다면 반영하겠습니다.
감사합니다 :)
이 섹션에서는 이 장 전체의 예제에서 사용되는 클래스들을 나열합니다.
Inventor1package org.spring.samples.spel.inventor; 2 3import java.util.Date; 4import java.util.GregorianCalendar; 5 6public class Inventor { 7 8 private String name; 9 private String nationality; 10 private String[] inventions; 11 private Date birthdate; 12 private PlaceOfBirth placeOfBirth; 13 14 public Inventor(String name, String nationality) { 15 GregorianCalendar c= new GregorianCalendar(); 16 this.name = name; 17 this.nationality = nationality; 18 this.birthdate = c.getTime(); 19 } 20 21 public Inventor(String name, Date birthdate, String nationality) { 22 this.name = name; 23 this.nationality = nationality; 24 this.birthdate = birthdate; 25 } 26 27 public Inventor() { 28 } 29 30 public String getName() { 31 return name; 32 } 33 34 public void setName(String name) { 35 this.name = name; 36 } 37 38 public String getNationality() { 39 return nationality; 40 } 41 42 public void setNationality(String nationality) { 43 this.nationality = nationality; 44 } 45 46 public Date getBirthdate() { 47 return birthdate; 48 } 49 50 public void setBirthdate(Date birthdate) { 51 this.birthdate = birthdate; 52 } 53 54 public PlaceOfBirth getPlaceOfBirth() { 55 return placeOfBirth; 56 } 57 58 public void setPlaceOfBirth(PlaceOfBirth placeOfBirth) { 59 this.placeOfBirth = placeOfBirth; 60 } 61 62 public void setInventions(String[] inventions) { 63 this.inventions = inventions; 64 } 65 66 public String[] getInventions() { 67 return inventions; 68 } 69}
1package org.spring.samples.spel.inventor 2 3import java.util.Date 4import java.util.GregorianCalendar 5 6class Inventor( 7 var name: String, 8 var nationality: String, 9 var inventions: Array<String>? = null, 10 var birthdate: Date = GregorianCalendar().time, 11 var placeOfBirth: PlaceOfBirth? = null 12)
PlaceOfBirth1package org.spring.samples.spel.inventor; 2 3public class PlaceOfBirth { 4 5 private String city; 6 private String country; 7 8 public PlaceOfBirth(String city) { 9 this.city=city; 10 } 11 12 public PlaceOfBirth(String city, String country) { 13 this(city); 14 this.country = country; 15 } 16 17 public String getCity() { 18 return city; 19 } 20 21 public void setCity(String s) { 22 this.city = s; 23 } 24 25 public String getCountry() { 26 return country; 27 } 28 29 public void setCountry(String country) { 30 this.country = country; 31 } 32}
1package org.spring.samples.spel.inventor 2 3class PlaceOfBirth(var city: String, var country: String? = null)
Society1package org.spring.samples.spel.inventor; 2 3import java.util.*; 4 5public class Society { 6 7 private String name; 8 9 public static String Advisors = "advisors"; 10 public static String President = "president"; 11 12 private List<Inventor> members = new ArrayList<>(); 13 private Map officers = new HashMap(); 14 15 public List getMembers() { 16 return members; 17 } 18 19 public Map getOfficers() { 20 return officers; 21 } 22 23 public String getName() { 24 return name; 25 } 26 27 public void setName(String name) { 28 this.name = name; 29 } 30 31 public boolean isMember(String name) { 32 for (Inventor inventor : members) { 33 if (inventor.getName().equals(name)) { 34 return true; 35 } 36 } 37 return false; 38 } 39}
1package org.spring.samples.spel.inventor 2 3import java.util.* 4 5class Society { 6 7 val Advisors = "advisors" 8 val President = "president" 9 10 var name: String? = null 11 12 val members = ArrayList<Inventor>() 13 val officers = mapOf<Any, Any>() 14 15 fun isMember(name: String): Boolean { 16 for (inventor in members) { 17 if (inventor.name == name) { 18 return true 19 } 20 } 21 return false 22 } 23}
Expression Templating
Aspect Oriented Programming with Spring