Geen cache-versie.

Caching uitgeschakeld. Standaardinstelling voor deze pagina:ingeschakeld (code LNG204)
Als het scherm te langzaam is, kunt u de gebruikersmodus uitschakelen om de cacheversie te bekijken.
javax.xml.bind.util

Class JAXBSource

  • All Implemented Interfaces:
    Source

    public class JAXBSource
    extends SAXSource
    JAXP Source implementation that marshals a JAXB-generated object.

    This utility class is useful to combine JAXB with other Java/XML technologies.

    The following example shows how to use JAXB to marshal a document for transformation by XSLT.

           MyObject o = // get JAXB content tree
    
           // jaxbContext is a JAXBContext object from which 'o' is created.
           JAXBSource source = new JAXBSource( jaxbContext, o );
    
           // set up XSLT transformation
           TransformerFactory tf = TransformerFactory.newInstance();
           Transformer t = tf.newTransformer(new StreamSource("test.xsl"));
    
           // run transformation
           t.transform(source,new StreamResult(System.out));
        

    The fact that JAXBSource derives from SAXSource is an implementation detail. Thus in general applications are strongly discouraged from accessing methods defined on SAXSource. In particular, the setXMLReader and setInputSource methods shall never be called. The XMLReader object obtained by the getXMLReader method shall be used only for parsing the InputSource object returned by the getInputSource method.

    Similarly the InputSource object obtained by the getInputSource method shall be used only for being parsed by the XMLReader object returned by the getXMLReader.

    • Constructor Detail

      • JAXBSource

        public JAXBSource(JAXBContext context,
                  Object contentObject)
                   throws JAXBException
        Creates a new Source for the given content object.
        Parameters:
        context - JAXBContext that was used to create contentObject. This context is used to create a new instance of marshaller and must not be null.
        contentObject - An instance of a JAXB-generated class, which will be used as a Source (by marshalling it into XML). It must not be null.
        Throws:
        JAXBException - if an error is encountered while creating the JAXBSource or if either of the parameters are null.
      • JAXBSource

        public JAXBSource(Marshaller marshaller,
                  Object contentObject)
                   throws JAXBException
        Creates a new Source for the given content object.
        Parameters:
        marshaller - A marshaller instance that will be used to marshal contentObject into XML. This must be created from a JAXBContext that was used to build contentObject and must not be null.
        contentObject - An instance of a JAXB-generated class, which will be used as a Source (by marshalling it into XML). It must not be null.
        Throws:
        JAXBException - if an error is encountered while creating the JAXBSource or if either of the parameters are null.

Nederlandse vertaling

U hebt gevraagd om deze site in het Nederlands te bezoeken. Voor nu wordt alleen de interface vertaald, maar nog niet alle inhoud.

Als je me wilt helpen met vertalingen, is je bijdrage welkom. Het enige dat u hoeft te doen, is u op de site registreren en mij een bericht sturen waarin u wordt gevraagd om u toe te voegen aan de groep vertalers, zodat u de gewenste pagina's kunt vertalen. Een link onderaan elke vertaalde pagina geeft aan dat u de vertaler bent en heeft een link naar uw profiel.

Bij voorbaat dank.

Document heeft de 11/06/2005 gemaakt, de laatste keer de 04/03/2020 gewijzigd
Bron van het afgedrukte document:https://www.gaudry.be/nl/java-api-rf-javax/xml/bind/util/jaxbsource.html

De infobrol is een persoonlijke site waarvan de inhoud uitsluitend mijn verantwoordelijkheid is. De tekst is beschikbaar onder CreativeCommons-licentie (BY-NC-SA). Meer info op de gebruiksvoorwaarden en de auteur.

Referenties

  1. Bekijk - html-document Taal van het document:fr Manuel PHP : https://docs.oracle.com

Deze verwijzingen en links verwijzen naar documenten die geraadpleegd zijn tijdens het schrijven van deze pagina, of die aanvullende informatie kunnen geven, maar de auteurs van deze bronnen kunnen niet verantwoordelijk worden gehouden voor de inhoud van deze pagina.
De auteur Deze site is als enige verantwoordelijk voor de manier waarop de verschillende concepten, en de vrijheden die met de referentiewerken worden genomen, hier worden gepresenteerd. Vergeet niet dat u meerdere broninformatie moet doorgeven om het risico op fouten te verkleinen.

Inhoudsopgave Haut