You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jaxme-dev@ws.apache.org by Rudi Vankeirsbilck <ru...@objectsmith.be> on 2004/05/26 11:21:41 UTC

Another newbie question

Hi,

I have succesfully generated my first schema into a set of java
classes. One of the complex types contains a list of nested elements
(minOccurs="0" maxOccurs="unbounded"). See example XML below.

I noticed that the returntype of the method generated by jaxme to
access that list of nested elements is List. Is there any way to
instruct jaxme to use an array? I prefer that because it avoids me
having to cast the elements of the List to the actual class.
what about generics? Are there any plans to support that? (knowing that
under the hood, there would still be a cast).

Also, optional elements (minOccurs="0" maxOccurs="1") only get an
accessor that will probably return null if the element is not there. Is
there any way to instruct jaxme to generate a test method that returns
a boolean to test if the element was there or not.

Example XML:
<ENTITY>
	<ATTRIBUTES>
		<ATTRIBUTE>
			<NAME>attribute1</NAME>
			<COLUMNNAME>column1</NAME>
			<BINDER>tbd</BINDER>
		</ATTRIBUTE>
		<ATTRIBUTE>
			<NAME>attribute2</NAME>
			<COLUMNNAME>column2</NAME>
		</ATTRIBUTE>
	</ATTRIBUTES>
</ENTITY>

Thx,

Rudi.


---------------------------------------------------------------------
To unsubscribe, e-mail: jaxme-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: jaxme-dev-help@ws.apache.org


Re: Another newbie question

Posted by Jochen Wiedmann <jo...@freenet.de>.
Rudi Vankeirsbilck wrote:

> I noticed that the returntype of the method generated by jaxme to
> access that list of nested elements is List. Is there any way to
> instruct jaxme to use an array?

There are such plans, because the SPEC requires it. Implementation should 
not be overly complex. Basically one needs to copy the class 
MultiplePropertySG to a an ArrayPropertySG and edit that. Additionally one 
needs to sure, that the method JAXBParticleSG.newPropertySGChain() 
distinguishes between the cases and returns either of these SG's.

Wanna volunteer?


> Also, optional elements (minOccurs="0" maxOccurs="1") only get an
> accessor that will probably return null if the element is not there. Is
> there any way to instruct jaxme to generate a test method that returns
> a boolean to test if the element was there or not.

Yes, see the JAXB Spec for details. Don't have the exact section in mind, 
but you are able to request a method "isFooSet" being created. (Interesting 
question whether that works ... :-)


Jochen


---------------------------------------------------------------------
To unsubscribe, e-mail: jaxme-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: jaxme-dev-help@ws.apache.org