Die meistgefragten Interviewfragen und Antworten sowie Online-Tests
Lernplattform fur Interviewvorbereitung, Online-Tests, Tutorials und Live-Ubungen

Baue deine Fahigkeiten mit fokussierten Lernpfaden, Probetests und interviewreifem Inhalt aus.

WithoutBook vereint themenbezogene Interviewfragen, Online-Ubungstests, Tutorials und Vergleichsleitfaden in einem responsiven Lernbereich.

Interview vorbereiten

JAXB Interviewfragen und Antworten

Question: Java code for marshalling Java objects into XML.
Answer: β€’ Example
Marshaller m = factory.createMarshaller();
m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
Writer fw = new FileWriter("newCars.xml");
m.marshal(cars, fw);
β€’ marshal method accepts
– java.io.OutputStream
– java.io.Writer
– javax.xml.transform.Result
β€’ related to XSLT
– org.w3c.dom.Node
β€’ related to DOM
– org.xml.sax.ContentHandler
β€’ related to SAX

β€’ Other Marshaller methods
– boolean setEventHandler(ValidationEventHandler handler)
β€’ same as use with Unmarshaller, but validation events
are delivered during marshalling
– void setProperty(String name, Object value)
β€’ supported properties are
– jaxb.encoding - value is a String
Β» the encoding to use when marshalling; defaults to β€œUTF-8”
– jaxb.formatted.output - value is a Boolean
Β» true to output line breaks and indentation; false to omit (the default)
– jaxb.schemaLocation - value is a String
Β» to specify xsi:schemaLocation attribute in generated XML
– jaxb.noNamespaceSchemaLocation - value is a String
Β» to specify xsi:noNamespaceSchemaLocation attribute in generated XML

Zum Wiederholen speichern

Speichere diesen Eintrag als Lesezeichen, markiere ihn als schwierig oder lege ihn in einem Wiederholungsset ab.

Meine Lernbibliothek offnen
Ist das hilfreich? Ja Nein

Am hilfreichsten laut Nutzern:

Copyright Β© 2026, WithoutBook.