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 Robert Eric Reeves <ro...@phurnace.com> on 2007/04/17 22:17:14 UTC
java.util.Properties and byte[] as attribute values
Hi!
I'm having a tough ol' time determining if I can even have these complex
types as my attribute vales.
I have seen in the mailing list archives where I can have complex Java types
as my element types or primitive arrays as my element types. But, I have yet
to see how I can have my attributes be set to these types.
Would something like this work?
<annotation>
<appinfo>
<jaxb:globalBindings>
<jaxb:javaType name="java.lang.Properties"
xmlType="properties"
parseMethod="com.phurnace.util.Properties.parse"
printMethod=" com.phurnace.util.Properties.print"/>
</jaxb:globalBindings>
</appinfo>
</annotation>
Where my com.phurnace.util.Properties methods parse and print would convert
a Properties object back and forth between delimited text and a Properties
object.
<xsd:attribute name="Properties" type="properties"/>
I guess I could do the same thing with arrays, too.
<annotation>
<appinfo>
<jaxb:globalBindings>
<jaxb:javaType name="java.lang.Byte[]"
xmlType="byteArray"
parseMethod="com.phurnace.util.Byte.parse"
printMethod=" com.phurnace.util. Byte.print"/>
</jaxb:globalBindings>
</appinfo>
</annotation>
Thanks!
Robert