This is a pretty simple request, but I just didn't find a way to do it.
I'm basically trying to set up a role in JAXB which says that whenever an null ... |
I have
@XmlAttribute(required=true)
in hundreds places in a projects.
Can I make this default?...
...So that I then only need to specify
@XmlAttribute(required=false)
when needed.
|
I'm trying to figure out what bits I need to plug together to marshal a JAXB POJO to a XOM document, and vice versa.
The JAXB Marshaller interface's marshal methods take various ... |
I have a basic JavaBean in my service layer and originally it was not designed for marshalling. This object is used by both JAX-WS, JAX-RS, and Servlets in other layers ... |
I'm using JAXB for quick-and-dirty XML generation. I have a class that represents a tree structure:
@XmlRootElement(name = "element")
public class Element {
// [...]
@XmlElementWrapper(name="childs")
@XmlElementRef
public List<Element> ...
|
Not sure if the title makes any sense.
I have an object that I want to marshal using JAXB that looks like this:
@XmlRootElement(name = "subscriptionRequest")
public class RegistrationRequest {
...
|
I'm trying to marshal an object that has an Object as one of its fields.
@XmlRootElement
public class TaskInstance implements Serializable {
...
private Object dataObject;
...
}
The ... |
|
I want to customize the marshalling of dates in JAXB. It's a variant of this already asked question. I would think I would use an XMLAdapter, as this answer ... |
I've got a fairly simple, but potentially large structure to serialize. Basically the structure of the XML will be:
<simple_wrapper>
<main_object_type>
<sub_objects>
</main_object_type>
...
|
I am marshalling (serializing) JAXB beans to output stream. How can I add DOCTYPE declaration and xml processing instructions to ouput?
I am doing currently marshalling like this:
JAXBContext jaxbContext = JAXBContext.newInstance("com.example.package");
Marshaller ...
|
The JAXB documentation is like a text-book, and I simply don't have to time to learn everything JAXB before I need to use it.
I have an XSD, if I want to ... |
I have an object value, which is of some type, either @XmlRootElement-annotated, or not. I want to marshal it into XML:
String value1 = "test";
assertEquals("<foo>test</foo>", toXml("foo", value1));
// ...
@XmlRootElement
class Bar {
public ...
|
Is it possible to marshal a JAXB annotated class instance as its superclass (which is also a JAXB annotated class)?
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "BenamningTYPE", propOrder = {"benamningId"})
@XmlSeeAlso({MoreDetailedBenamningTYPE.class})
public class BenamningTYPE {
...
|
When marshaling some objects into XML, I need to insert an additional field in each of the resulting XML objects - sort of flag. The purpose is not modifying the source ... |
I'm trying to marshal/unmarshal Java ValueObject class through JAXB.
To do it, I found that it requires XML Schema file and ObjectFactory class
that can be automatically created by ant.
If so, it seems ... |
I can marshal and unmarshal 1 object with no problems (in netbeans); I need to know how to do this with multiple objects? I can't generate anything but null pointer exceptions ... |
my class is like below.
class Employee {
private String Code;
//getter and setter below
}
using jaxb when i marshal i am getting below elements
<employee><code>some value</code></employee>
but i ... |
I have a hierarchy of JAXB-generated classes. I would like to marshal a child class as a base class element (but with all the child class attributes), using xsi:type to indicate ... |
I would like to marshall an object using JAXB, the problems is that I would like to marshall just some fields depending on some business logic. For example I have an ... |
I am trying to marshall a message using the following snippet:
JAXBContext jContext = JAXBContext.newInstance(Iq.class);
Marshaller m ...
|
I have tried in many different ways to send my xml document over a socket connection between a server and a client without closing the socket after sending (keep the outputstream ... |
I have an object similar to this:
public class Obj {
@XmlElement(name="value")
public Set<Object> values;
}
When marshaling, this is generating an xml like:
<Obj>
...
|
I have a Document element with comment node in it. I tried to marshall the document using Transformer, the comment node is not ignored but when marshalling using JAXB, the comment ... |
I tried hello world example from here and I can't see any output in my program (in console when using "java" command). Is it something wrong I do? The ... |
Im wondering is there any RUNTIME possibility how to select which fields should be omitted during marshalling. I know that there is @XmlTransient annotation, but that is not runtime.
E.g.
@XmlRootElement
public class Person ...
|
I have 2 XML schema, called Banner-2.2.xsd and BatchBanner-2.2.xsd.
BatchBanner-2.2.xsd contains
<xs:redefine schemaLocation="BannerXml-2.2.xsd" >
The jaxb generates from it the classes as expected, there is a class called OriginalBanner according to Banner-2.2.xsd and ... |
A buddy of mine asked me to post this question:
EDIT: He decided to post the question on his own here: JAXB Unmarshalls XML Incorrectly I tried to delete this ... |
I would like to add a processing instruction whenever a collection/array property is serialized to get something like
<alice>
<? array bob ?>
<bob>edgar</bob>
<bob>david</bob>
</alice>
Is this possible with JAXB? ... |
I have few XSD files and corresponding XJC files. The version number of all the generated XML files using JAXB should be uniform and should be picked up from either XJC ... |
I have a class that looks like this:
public class Word {
String text;
String root;
int ...
|
I have no problem to marshal Job objects but when i try to marhsal an array of Job i am getting a bad XML. It seems like i need to create ... |
The question is a bit theoretical, what is the cost of creating JAXB context, marshaller and unmarshaller?
I've found that my code could benefit from keeping the same JAXB context and possibly ... |
I have a requirement in which i have XML like this
<programs>
<program>
<name>test1</name>
<instr><![CDATA[ some string ]]></instr>
...
|
I have a class with an @XmlRootElement(name="objectName",namespace="https:blahblah") and some attributes in the class all with @XmlElement(namespace="https:blahblah")
But now I have some element without an XmlElement annotation. Why is it also marshalled?
I only ... |
Employee.xsd
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:jxb="http://java.sun.com/xml/ns/jaxb" jxb:version="1.0" elementFormDefault="qualified">
<xsd:include schemaLocation="Family.xsd"/>
<xsd:element name="NewFields">
<xsd:complexType>
...
|
I have a requirement to produce different JSON from one of my domain classes without changing the current JAXB annotations. The only way that comes to mind is to extend my ... |
In JAXB 2.0 if you compile a schema to java classes and a class contains an inner class, are you required to do anything different while building your content tree from ... |
I followed the following tutorial on JAXB http://blog.adamsbros.org/2010/02/07/jaxb-example-code/, and wanted to modify it to include the class I want to as an nested (inner) class as follows:
import javax.xml.bind.JAXBContext;
import ...
|