Hmm, there's two options I can think of, both of them relying on the use of a binding file.
A) Make your class extend a custom base class, which happens to have a private member of the desired type. The problem with this might be how to make Castor realize that it should include this member with (un)marshalling. B) Simply add a new attribute named 'test' with some type (it simply does not matter), and override the type of this attribute with a custom type within a component binding for that attribute. I think option B) should meet your requirements. Regards Werner > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Sent: Dienstag, 30. Jänner 2007 13:40 > To: [email protected] > Subject: [castor-user] Possible to use a user defined class > as attribute type? > > Hi, > > Is it possible to use a user defined class as attribute type? > For instance, if I have this element: > > <xsd:element name="query"> > <xsd:complexType> > <xsd:attribute name="name" type="xsd:string"/> > <xsd:attribute name="factory" type="xsd:string"/> > </xsd:complexType> > </xsd:element> > > Now I want to add an attribute named test, but I don't want > the type to be one of the predefined ones. Instead I wan't it > to be, for instance, com.somethirdparty.package.SomeClass, > how can I do this? Neighter > type="com.somethirdparty.package.SomeClass" nor > type="xsd:com.somethirdparty.package.SomeClass" works. All I > want is that the generated code imports > com.somethirdparty.package.SomeClass and has a private field > test of the type SomeClass, with a getter- and setter-method. > > I have read the FAQ and the examples, but I can't find > anything like this. There must be many people who need > something like this, right? > > Regards > /Jimi > > --------------------------------------------------------------------- > To unsubscribe from this list please visit: > > http://xircles.codehaus.org/manage_email > --------------------------------------------------------------------- To unsubscribe from this list please visit: http://xircles.codehaus.org/manage_email

