subclass « jaxb « Java XML Q&A

Home
Java XML Q&A
1.convert
2.Development
3.document
4.dom
5.dom4j
6.dtd
7.element
8.jaxb
9.jaxp
10.jdom
11.jsoup
12.namespace
13.Node
14.parse
15.parser
16.pdf
17.sax
18.schema
19.stax
20.tag
21.transform
22.Validation
23.xalan
24.xmlbeans
25.xpath
26.xsd
27.xslt
28.xstream
Java XML Q&A » jaxb » subclass 

1. JAXB inheritance, unmarshal to subclass of marshaled class    stackoverflow.com

I'm using JAXB to read and write XML. What I want is to use a base JAXB class for marshalling and an inherited JAXB class for unmarshalling. This is to allow ...

2. JAXB, marshalling sub-class that has the same rootNode name as the superclass    stackoverflow.com

Let's say I have this:

public class Foo {
  private String value;

  // <snip> getters and setters, constructors etc
}
And I also have this:
public class Bar extends Foo {
  private ...

3. JAXB marshalling declared parent class vs. actual runtime subclass    stackoverflow.com

I'm using JAXB to marshal a class that has an instance variable that's declared as class Foo. At runtime that instance variable is set to an instance of a subclass ...

4. JAXB 2 annotation and subclasses headache    stackoverflow.com

I am currently stuck on a awkward problem on JAXB. So I have the following class structure in place:

@XmlType
public abstract class MySuperClass
{
    ...
    ...
  ...

5. Unmarshalling to a subclass with JAXB    stackoverflow.com

I've a JSON something like this:

objects:[{
   id:"p452365",
   type:"photo",
   link:"http://xxx.zz"
},
{
   id:"v7833",
   type:"video",
   link:"http://xxx.yy",
   length:"4.12"
}
]
In superclass Entity, there're 2 ...

6. Overwriting attributes in subclasses with jaxb    stackoverflow.com

I have the following XML code:

<stereotypes>
  <stereotype1/>
  <stereotype2/>
</stereotypes>
The problem is that I need a general attribute for each stereotype that has a different value for each stereotype ...

7. JAXB Marshal Field that is a subclass    stackoverflow.com

I have a wrapper class with a property whose type is a superclass of several subclasses. I want to marshal to JSON and have the subclass marshalled for that field. When ...

8. pass subclass instances as superclass with Jaxb    stackoverflow.com

I need to send/receive polymorphic objects from/to server while invoking my spring enabled restful service. Please let me know if xmlseealso annotation can be useful even when there are more than 1 ...

9. How do I use JAXB @XmlValue on a subclass?    stackoverflow.com

I want XML like this:

<simple>Foo</simple>
I can do this successfully via a JAXB class that looks like this:
@XmlRootElement(name="simple")
class Simple {
    @XmlValue
    public String contents;
}
But now I ...

java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.