Keine Cache-Version

Caching deaktiviert Standardeinstellung für diese Seite:aktiviert (code LNG204)
Wenn die Anzeige zu langsam ist, können Sie den Benutzermodus deaktivieren, um die zwischengespeicherte Version anzuzeigen.
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.

Deutsche Übersetzung

Sie haben gebeten, diese Seite auf Deutsch zu besuchen. Momentan ist nur die Oberfläche übersetzt, aber noch nicht der gesamte Inhalt.

Wenn Sie mir bei Übersetzungen helfen wollen, ist Ihr Beitrag willkommen. Alles, was Sie tun müssen, ist, sich auf der Website zu registrieren und mir eine Nachricht zu schicken, in der Sie gebeten werden, Sie der Gruppe der Übersetzer hinzuzufügen, die Ihnen die Möglichkeit gibt, die gewünschten Seiten zu übersetzen. Ein Link am Ende jeder übersetzten Seite zeigt an, dass Sie der Übersetzer sind und einen Link zu Ihrem Profil haben.

Vielen Dank im Voraus.

Dokument erstellt 11/06/2005, zuletzt geändert 04/03/2020
Quelle des gedruckten Dokuments:https://www.gaudry.be/de/java-api-rf-javax/xml/bind/util/jaxbsource.html/

Die Infobro ist eine persönliche Seite, deren Inhalt in meiner alleinigen Verantwortung liegt. Der Text ist unter der CreativeCommons-Lizenz (BY-NC-SA) verfügbar. Weitere Informationen auf die Nutzungsbedingungen und dem Autor.

Referenzen

  1. Zeigen Sie - html-Dokument Sprache des Dokuments:fr Manuel PHP : https://docs.oracle.com

Diese Verweise und Links verweisen auf Dokumente, die während des Schreibens dieser Seite konsultiert wurden, oder die zusätzliche Informationen liefern können, aber die Autoren dieser Quellen können nicht für den Inhalt dieser Seite verantwortlich gemacht werden.
Der Autor Diese Website ist allein dafür verantwortlich, wie die verschiedenen Konzepte und Freiheiten, die mit den Nachschlagewerken gemacht werden, hier dargestellt werden. Denken Sie daran, dass Sie mehrere Quellinformationen austauschen müssen, um das Risiko von Fehlern zu reduzieren.

Inhaltsverzeichnis Haut