Apache Commons Bean Utils
Apache Commons BeanUtils| 개발자 | Apache 소프트웨어 재단 |
|---|---|
| 안정된 릴리스 | 1.9.4 |
| 저장소 | https://github.com/apache/commons-beanutils |
| 기입처 | 자바 |
| 운영 체제 | 크로스 플랫폼 |
| 면허증. | Apache 라이센스 2.0 |
| 웹 사이트 | commons |
Apache Commons BeanUtils는 컴포넌트 기반 [1][2][3]아키텍처를 제공하는 Java 기반 유틸리티입니다.
모듈
라이브러리는 3개의 jar 파일로 배포됩니다.
- commons-beanutils.jar - 모든 것을 포함합니다.
- commons-beanutils-core.jar - Bean Collections 클래스 제외
- commons-beanutils-bean-collections.jar - 빈 컬렉션 [1]클래스만.
예
샘플 코드는 다음과 같습니다.
/** * 새로운 디폴트 동작을 표시하는 예: * 를 사용하여 클래스 수준 속성에 액세스할 수 없습니다. * BeanUtilsBean - PropertyUtilsBean을 사용합니다. */ 일반의 무효 test Suppress Class Property By Default() 던지다 예외. { 최종 Bean Utils Bean 거품이 일다 = 신규 Bean Utils Bean(); 최종 알파빈 콩 = 신규 알파빈(); 해라 { 거품이 일다.getProperty(콩, "클래스"); 실패하다("클래스 속성에 액세스할 수 있습니다!"); } 또 만나 (최종 No Such Method Exception(No Such Method Exception) ex) { // OK(확인) } } /** * 를 사용하여 로 되돌리는 예를 나타냅니다. * 클래스 레벨 속성에 액세스 할 수 있었던 1.9.4 릴리스 이전의 동작 * BeanUtilsBean 및 PropertyUtilsBean. */ 일반의 무효 testAllowAccessToClassProperty() 던지다 예외. { 최종 Bean Utils Bean 거품이 일다 = 신규 Bean Utils Bean(); 거품이 일다.getPropertyUtils().removeBeanIntrospector(Suppress Properties Bean인스펙터.억제_클래스); 최종 알파빈 콩 = 신규 알파빈(); 스트링 결과 = 거품이 일다.getProperty(콩, "클래스"); assert Equals(동일)("클래스 속성에 액세스해야 합니다.", "class org.gl.beanutils2.알파빈", 결과); } 「 」를 참조해 주세요.
레퍼런스
- ^ a b c "BeanUtils – Commons". commons.apache.org. Retrieved 2019-08-20.
- ^ Berglund, Tim; McCullough, Matthew (2011-07-13). Building and Testing with Gradle. "O'Reilly Media, Inc.". p. 57. ISBN 9781449304638.
- ^ Company, Sonatype (2008-09-24). Maven: The Definitive Guide: The Definitive Guide. "O'Reilly Media, Inc.". p. 136. ISBN 9780596551780.