JAXB
JAXB(Java Architecture for XML Binding)는 자바 클래스를 XML로 표현하는 자바 API이다. JAXB는 주로 2가지 기능이 있다. 자바 객체를 XML로 직렬화하는 것이고 반대로 XML에서 자바 객체로 역직렬화하는 것이다. 즉, JAXB는 메모리의 데이터를 XML 형식으로 변환하여 저장할 수 있고, 이 과정을 위해 프로그램의 각 클래스에서 XML을 읽고 저장하는 일을 구현해야 한다.
기본 자료형 바인딩
다음 표는 XML 스키마(XSD) 자료형을 JAXB의 자바 자료형과 매핑한 것을 나열한 것이다.[1]
| XML 스키마 타입 | 자바 자료형 |
|---|---|
xsd:string
|
java.lang.String
|
xsd:integer
|
java.math.BigInteger
|
xsd:positiveInteger
|
java.math.BigInteger
|
xsd:int
|
int
|
xsd:long
|
long
|
xsd:short
|
short
|
xsd:decimal
|
java.math.BigDecimal
|
xsd:float
|
float
|
xsd:double
|
double
|
xsd:boolean
|
boolean
|
xsd:byte
|
byte
|
xsd:QName
|
javax.xml.namespace.QName
|
xsd:dateTime
|
javax.xml.datatype.XMLGregorianCalendar
|
xsd:base64Binary
|
byte[]
|
xsd:hexBinary
|
byte[]
|
xsd:unsignedInt
|
long
|
xsd:unsignedShort
|
int
|
xsd:unsignedByte
|
short
|
xsd:unsignedLong
|
java.math.BigDecimal
|
xsd:time
|
javax.xml.datatype.XMLGregorianCalendar
|
xsd:date
|
javax.xml.datatype.XMLGregorianCalendar
|
xsd:g
|
javax.xml.datatype.XMLGregorianCalendar
|
xsd:anySimpleType[2]
|
java.lang.Object
|
xsd:anySimpleType[3]
|
java.lang.String
|
xsd:duration
|
javax.xml.datatype.Duration
|
xsd:NOTATION
|
javax.xml.namespace.QName
|
버전 역사
| JAXB version | 발표 | 자바 플랫폼 | 중요한 변화 |
|---|---|---|---|
| JAXB 2.0 | Java EE 5 | JSR 222 | |
| JAXB 1.0 | JSR 31 |
같이 보기
각주
- ↑ “Using JAXB Data Binding: Standard Data Type Mapping”.
- ↑ for
xsd:elementof this type - ↑ for
xsd:attributeof this type
외부 링크
- JAXB home page 보관됨 2017-05-04 - 웨이백 머신 Reference Implementation on Project GlassFish
- previous JAXB home page
| 이 글은 소프트웨어에 관한 토막글입니다. 여러분의 지식으로 알차게 문서를 완성해 갑시다. |
Content Disclaimer
Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.
- The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
- There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
- It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
- Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
- Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.