Java Architecture for XML Binding: differenze tra le versioni

Contenuto cancellato Contenuto aggiunto
Fripp (discussione | contributi)
Nessun oggetto della modifica
Recupero di 1 fonte/i e segnalazione di 0 link interrotto/i.) #IABot (v2.0.9.5
 
(54 versioni intermedie di 29 utenti non mostrate)
Riga 1:
'''Java Architecture for XML Binding''' ('''JAXB''') è una delle [[Application programming interface|API]] della [[Java EE|Java Enterprise Edition]], fa parte del [[Java Web Services Development Pack]] (JWSDP) ed è una delle tecnologie di base del progetto [[Web Services Interoperability Technology]] (WSIT) promosso dalla [[Sun Microsystems]]; inoltre, a partire dalla versione 1.6, JAXB è inclusa anche in Java SE.
'''Java Architecture for XML Binding''' ('''JAXB''') permette agli sviluppatori [[Java (linguaggio)|Java]] di effettuare il mapping tra [[|Classe (informatica)|classi]] e una loro corrispondente rappresentazione [[XML]]. JAXB fornisce la possibilità di [[serializzazione|serializzare]] [[Oggetto (informatica)|oggetti]] Java in XML (''marshalling'') e di effettuare l'operazione inversa (''unmarshalling''), ovvero permette di ottenere a partire da un file XML la corrispondente rappresentazione a oggetti Java.
 
JAXB permette agli sviluppatori [[Java (linguaggio di programmazione)|Java]] di effettuare il mapping tra [[Classe (informatica)|classi]] e una loro corrispondente rappresentazione [[XML]]. JAXB fornisce la possibilità di [[serializzazione|serializzare]] [[Oggetto (informatica)|oggetti]] Java in XML (''marshalling'') e di effettuare l'operazione inversa (''unmarshalling''), cioè permette di ottenere a partire da un file XML la corrispondente rappresentazione a oggetti Java. JAXB permette quindi di manipolare file XML senza la necessità di implementare alcuna routine specifica per il salvataggio e la lettura di dati.
<!--'''Java Architecture for XML Binding''' ('''JAXB''') allows [[Java (programming language)|Java]] developers to map Java [[class (computer science)|classes]] to [[XML]] representations. JAXB provides two main features: the ability to [[serialization|''marshal'']] Java [[object (computer science)|objects]] into XML and the inverse, i.e. to ''unmarshal'' XML back into Java objects. In other words, JAXB allows storing and retrieving data in memory in any XML format, without the need to implement a specific set of XML loading and saving routines for the program's class structure.
 
JAXB 1.0 fu sviluppato nell'ambito del [[Java Community Process]] come JSR 31. Dal 2006, JAXB 2.0 viene sviluppata come JSR 222. L'implementazione delle specifiche di JAXB è disponibile sotto licenza [[Common Development and Distribution License|CDDL]].
JAXB is particularly useful when the specification is complex and changing. In such a case, regularly changing the [[XML Schema (W3C)|XML Schema]] definitions to keep them synchronised with the Java definitions can be time consuming and error prone.
 
== ArticlesUtilizzo ==
JAXB is one of the [[Application programming interface|APIs]] in [[Java Platform, Enterprise Edition|the Java EE platform]], and is part of the [[Java Web Services Development Pack]] (JWSDP). It is also one of the foundations for [[Web Services Interoperability Technology|WSIT]]. JAXB is part of SE version 1.6.
Il pacchetto JAXB include il compilatore ''xjc'', che viene usato per convertire [[XML Schema]] e altri formati di descrizione XML (a partire da Java 1.6, il supporto a [[RELAX NG]], [[Document Type Definition|XML DTD]] e [[Web Services Description Language|WSDL]] è in fase di sperimentazione) in classi Java. Il meccanismo di ''mapping'' tra XML Schema e Java viene implementato mediante l'uso delle [[Annotazione (Java)|annotazioni]] definite nel [[Package (Java)|package]] javax.xml.bind.annotation. Ad esempio @XmlRootElement e @XmlElement annotano le classi Java che rappresentano, rispettivamente, l'elemento radice del file XML e un elemento generico.
 
In aggiunta a ''xjc'', JAXB fornisce anche ''schemagen'', un [[compilatore]] che effettua l'operazione inversa di ''xjc'', cioè la generazione di un file [[XML Schema]] a partire da un insieme di classi Java annotate secondo le specifiche di JAXB.
JAXB 1.0 was developed under the [[Java Community Process]] as JSR 31. {{As of|2006}}, JAXB 2.0 is being developed under JSR 222. Reference implementations for these specifications are available under the [[CDDL|CDDL open source license]] at java.net.
 
== UsageBinding predefiniti ==
La tabella seguente elenca il ''mapping'' di alcuni dei principali tipi definiti in XML Schema in [[Tipo di dato|tipi di dato]] Java.
The tool "xjc" can be used to convert [[XML Schema (W3C)|XML Schema]] and other schema file types (as of Java 1.6, [[RELAX NG]], XML [[Document Type Definition|DTD]], and [[Web Services Description Language|WSDL]] are supported experimentally) to class representations. Classes are marked up using [[Java annotation|annotations]] from javax.xml.bind.annotation.* namespace, for example, @XmlRootElement and @XmlElement. XML list sequences are represented by attributes of type java.util.List. Marshallers and Unmarshallers are created through an instance of JAXBContext.
 
In addition, JAXB includes a "schemagen" tool which can essentially perform the inverse of "xjc", creating an XML Schema from a set of annotated classes.
 
== Default data type bindings ==
The table below lists the mappings of XML data types to Java data types in JAXB.
 
{| class="wikitable" style="font-size: 100%; text-align: left; width: 35%;"
Riga 88 ⟶ 83:
|xsd:anySimpleType
|java.lang.String
|-
|xsd:duration
|javax.xml.datatype.Duration
|-
|xsd:NOTATION
|javax.xml.namespace.QName
|-
|}
 
== SeeCollegamenti alsoesterni ==
* {{cita web | 1 = http://jaxb.java.net/ | 2 = Home page di JAXB | accesso = 22 febbraio 2013 | dataarchivio = 4 maggio 2017 | urlarchivio = https://web.archive.org/web/20170504080640/http://jaxb.java.net/ | urlmorto = sì }}
 
* [{{cita web|http://java.sun.com/xml/jaxb/index.jsp previous JAXB|vecchia home page] di JAXB}}
* [[XML data binding]]
* {{cita web | 1 = http://jaxb.java.net/tutorial/ | 2 = A JAXB Tutorial by Wolfgang Laun | accesso = 22 febbraio 2013 | urlarchivio = https://web.archive.org/web/20130323015034/http://jaxb.java.net/tutorial/ | dataarchivio = 23 marzo 2013 | urlmorto = sì }}
* [[XMLBeans]] &ndash; A similar and complementary technology to [[JAXB]] from [[Apache Software Foundation]]
* [https://web.archive.org/web/20100723202011/http://ws.apache.org/jaxme/ JaxMe] &ndash;– Implementazione [[Openopen source]] implementation ofdi JAXB undersotto thelicenza [[Apache Software Foundation]]
* [[TopLink]] &ndash; an object to relational and object to [[XML]] mapper from [[Oracle Corporation|Oracle]] that supports JAXB 1.0
* [httphttps://www.eclipse.org/eclipselink/ EclipseLink MOXy] &ndash;– Implementazione [[Openopen Sourcesource]] implementation ofdi JAXB anddi objectservizi XMLdi mapping servicesXML undera the [[Eclipse Foundation]]oggetti
 
* [httphttps://www.jcp.org/en/jsr/detail?id=222 JSR 222] (JAXB 2.0)
== Articles ==
* [httphttps://www.jcp.org/en/jsr/detail?id=31 JSR 31] (JAXB 1.0)
 
* [{{cita web|http://java.sun.com/javaee/5/docs/tutorial/doc/?wp405761&JAXB.html#wp100322 |JAXB chapter of the Java EE 5 Tutorial]}}
* [http://www.devx.com/Java/Article/34069 Generate an XML Document from an Object Model with JAXB 2]
* {{cita web |1=http://wiki.netbeans.org/wiki/view/JAXBWizard/ |2=JAXB Wizard |urlmorto=sì |accesso=20 luglio 2009 |urlarchivio=https://web.archive.org/web/20081201161415/http://wiki.netbeans.org/wiki/view/JAXBWizard/ |dataarchivio=1º dicembre 2008 }}
* [http://blogs.techrepublic.com.com/programming-and-development/?p=498 JAXB 2.0]
* {{cita web | 1 = http://www.devx.com/Java/Article/34069 | 2 = Generate an XML Document from an Object Model with JAXB 2 | accesso = 20 luglio 2009 | dataarchivio = 29 ottobre 2020 | urlarchivio = https://web.archive.org/web/20201029143620/http://www.devx.com/Java/Article/34069 | urlmorto = sì }}
 
* {{cita web|url=http://blogs.techrepublic.com.com/programming-and-development/?p=498|titolo=JAXB 2.0|urlmorto=sì|urlarchivio=https://web.archive.org/web/20121206043742/http://blogs.techrepublic.com.com/programming-and-development/?p=498|dataarchivio=6 dicembre 2012}}
== External links ==
 
{{portale|informatica}}
* [https://jaxb.dev.java.net/ JAXB home page] on Project [[GlassFish]]
* [http://java.sun.com/xml/jaxb/index.jsp previous JAXB home page]
* [https://jaxb.dev.java.net/tutorial/ A JAXB Tutorial] by Wolfgang Laun
* [http://ws.apache.org/jaxme/ JaxMe] &ndash; [[Open source]] implementation of JAXB under the [[Apache Software Foundation]]
* [http://www.eclipse.org/eclipselink/ EclipseLink MOXy] &ndash; [[Open Source]] implementation of JAXB and object XML mapping services under the [[Eclipse Foundation]]
* [http://www.jcp.org/en/jsr/detail?id=222 JSR 222] (JAXB 2.0)
* [http://www.jcp.org/en/jsr/detail?id=31 JSR 31] (JAXB 1.0)
* [http://java.sun.com/javaee/5/docs/tutorial/doc/?wp405761&JAXB.html#wp100322 JAXB chapter of the Java EE 5 Tutorial]
* [http://wiki.netbeans.org/wiki/view/JAXBWizard/ JAXB Wizard]
 
[[Categoria:Piattaforma Java]]
{{DEFAULTSORT:XML Binding Architecture}}
[[CategoryCategoria:Java API for XML]]
[[Category:Java specification requests]]
-->
[[de:JAXB]]
[[fr:Java Architecture for XML Binding]]
[[ko:JAXB]]
[[ja:Java Architecture for XML Binding]]