users@jaxb.java.net

Re: JAXB generated code is giving me a get method but NOT a set option

From: Malachi de Ælfweald <malachid_at_gmail.com>
Date: Fri, 12 Oct 2007 10:20:34 -0700

It appears in your schema that you are specifying maxOccurs="unbounded" with
the ref to the Body...
so you probably have a List<Body> getBody()
which would be a live list - changes to it are automatically updated

Malachi

On 10/12/07, DarVar <desmond.kirrane_at_gmail.com> wrote:
>
>
> I have the following schema:
> When generated using JAXB it only gives me Paragraph.getBody().
> It does not give me a Paragraph.setBody() method to add a new <body>
> element.
> How do I get a setter?
>
> Note a <paragraph> element can have multiple <body> elements.
> A <body> element simply includes text.
>
>
> <?xml version="1.0" encoding="UTF-8"?>
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
> elementFormDefault="qualified">
> <xs:element name="paragraph">
> <xs:complexType>
> <xs:sequence>
> <xs:element maxOccurs="unbounded" ref="Body"/>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> <xs:element name="Body" type="xs:string"/>
> </xs:schema>
>
>
>
> --
> View this message in context:
> http://www.nabble.com/JAXB-generated-code-is-giving-me-a-get-method-but-NOT-a-set-option-tf4614197.html#a13177056
> Sent from the java.net - jaxb users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>
>