Java Architecture for XML Binding: differenze tra le versioni

Contenuto cancellato Contenuto aggiunto
Fripp (discussione | contributi)
Nessun oggetto della modifica
Fripp (discussione | contributi)
Nessun oggetto della modifica
Riga 5:
JAXB 1.0 fu sviluppato nell'ambita del [[Java Community Process]] come JSR 31. Dal 2006, JAXB 2.0 viene sviluppata come JSR 222. L'implementazione delle specifiche dj JAXB è rilasciata sotto licenza [[Common Development and Distribution License|CDDL]].
==Utilizzo==
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], XML [[Document Type Definition|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.binf.annotation. Ad esempio @XmlRootElement e @XmlElemente 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'', ovvero la generazione di un file [[XML Schema]] a partire da un insieme di classi Java annotate secondo le specifiche di JAXB.
<!--
== Usage ==
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.