Loading...
Spring Framework Reference Documentation 7.0.2의 Constructors의 한국어 번역본입니다.
아래의 경우에 피드백에서 신고해주신다면 반영하겠습니다.
감사합니다 :)
new 연산자를 사용하여 생성자를 호출할 수 있습니다. java.lang 패키지
(Integer, Float, String 등)에 위치한 타입을 제외한 모든 타입에 대해 완전
한정 클래스 이름을 사용해야 합니다.
Varargs도 지원됩니다.
다음 예제는 생성자를 호출하기 위해 new 연산자를 사용하는 방법을 보여 줍니다.
1Inventor einstein = parser.parseExpression( 2 "new org.spring.samples.spel.inventor.Inventor('Albert Einstein', 'German')") 3 .getValue(Inventor.class); 4 5// create new Inventor instance within the add() method of List 6parser.parseExpression( 7 "Members.add(new org.spring.samples.spel.inventor.Inventor('Albert Einstein', 'German'))") 8 .getValue(societyContext);
1val einstein = parser.parseExpression( 2 "new org.spring.samples.spel.inventor.Inventor('Albert Einstein', 'German')") 3 .getValue(Inventor::class.java) 4 5// create new Inventor instance within the add() method of List 6parser.parseExpression( 7 "Members.add(new org.spring.samples.spel.inventor.Inventor('Albert Einstein', 'German'))") 8 .getValue(societyContext)
Types
Variables