1. 기본 사용법

https://howtodoinjava.com/jaxb/jaxb-annotations/

 

A Guide to JAXB Annotations - HowToDoInJava

Learn about JAXB annotations in detail along with their usage during marshalling and unmarshalling operations eg. @XmlRootElement, @XmlElement and @XmlList,

howtodoinjava.com

 

2. 작스비를 효율적으로 사용하는 법

https://knight76.tistory.com/entry/JAXB-%EC%9E%98-%EC%82%AC%EC%9A%A9%ED%95%98%EA%B8%B0

 

JAXB 잘 사용하기

2010년 초에 정리한 줄 알았는데, 과거 메일을 참조로 정리한다. 이 내용은 현재 JAXB 버전과 다를 수 있다. JAXB에 대해서.. java XML 파서중에 Xstream, JAXB 가 있다. 취향에 따라서 다양하게 쓰기는 하는데....

knight76.tistory.com

 

 

 

 

Class<?> cls = Class.forName("패키지명" + "class 이름");//클래스의 메타정보 불러오기
Object obj = cls.newInstance();//메타정보로 인스턴스 생성해서 메모리에 올리기
//여기까지는 new class
Class<?> dtoCls = obj.getClass();//생성한 인스턴스로 클래스 형태로 불러오기

//Field 가져오기
Field field[]= dtoCls.getDeclaredFields(); //public으로 지정한 field명 가져오기

//Method 사용법
//생성자 있는 경우
Method setMethod = dtoCls.getMethod("set" + column, String.class); //method 불러오기
setMethod.invoke(obj, data); // method 실행

//return 있는 경우
Method getMethod = dtoCls.getMethod("get" + column); //method 불러오기
String result=getMethod.invoke(obj); // method 실행

 

 

 

 

 

[Java] 자바 - 리플렉션(Reflection)

* 리플렉션에 관한 소스코드가 있어 담아왔습니다 ~ - 리플렉션이란 컴파일시간에 클래스 정보를 분석하는 ...

blog.naver.com

 

https://javacan.tistory.com/tag/Method.invoke%28%29

 

'Method.invoke()' 태그의 글 목록

최범균이 운영하는 자바 및 웹 관련 컨텐츠 제공 블로그

javacan.tistory.com

 

https://pupustory.tistory.com/192

 

자바 리플랙션 필드값 수정(Java Reflection field value edit)

메소드 호출에 이어 이번엔 필드값을 수정해 보자. 이번에도 바로 코드부터 살펴보자. Exam_ReflectionField.java package pupustory.reflection.exam; import java.lang.reflect.*; public class Exam_Reflection..

pupustory.tistory.com

 

https://futurists.tistory.com/43

 

자바 동적로딩 이해(델리게이션 모델)

자바 프로그램은 한 개 혹은 그 이상의 클래스들의 조합으로 실핸된다. 그리고 실행 시 모든 클래스 파일드이 한 번에 JVM 메모리에 로딩되지 않고 요청되는 순간 로딩된다. 자바의 클래스 로더가 이런 역할을 수..

futurists.tistory.com

 

 

java.lang.indexoutofboundsexception: index: 1, size: 0 

at java.util.arraylist.rangecheckforadd(unknown source)

 

이런 에러를 만남.
이유는 for문을 돌리면서 list.add(index,object)를 써서 dto를 추가하는데

0번째에 null이 들어간 경우에는 1번에 데이터를 넣을 수 없기 때문이다.

list.add(object)를 써주면 자동으로 알아서 들어간다.

'Java' 카테고리의 다른 글

jaxb 관련 자료 모음  (0) 2020.01.21
JAVA Reflection 사용법 및 관련 자료 정리  (0) 2019.12.23

+ Recent posts