Not sure about your first question, to be honest, as I don't know
anything about xfire and how it internally makes use of Castor. But lewt
me try to address the second question.

The isValid() method is a convenience method to 'ask' Castor to verify
whether a given domain class (a POJO in your speak) can be successfully
validated. Internally, this calls the Validator class, and I honestly
would not want to add a setter for this (convenience one-way) method, as
it would be semantically dead wrong. What I could offer is that no such
method be generated during code generation, but you'd have to raise a
feature request first (as no such functionality exists right now).

abangkis wrote:
> Hello,
> 
> I'm currently implementing xfire with castor in my project. my xml
> schema look like this
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <xs:schema targetNamespace=" http://xfire.codehaus.org/CastorService";
> xmlns:tns="http://xfire.codehaus.org/CastorService"; xmlns:xs="
> http://www.w3.org/2001/XMLSchema"; elementFormDefault="qualified"
> attributeFormDefault="unqualified">
>     <xs:element name="MReunionProtocol">
>         <xs:annotation>
>             <xs:documentation>Comment describing your root
> element</xs:documentation>
>         </xs:annotation>
>         <xs:complexType>
>             <xs:sequence>
>                 <xs:element name="ToR" type="xs:int"/>
>                 <xs:element name="Messages" type="xs:string"
> minOccurs="0" maxOccurs="unbounded"/>
>                 <xs:element name="Data" minOccurs="0">
>                     <xs:complexType>
>                         <xs:choice>
>                             <xs:element name="Contact"
> maxOccurs="unbounded">
>                                 <xs:complexType>
>                                     <xs:all>
>                                         <xs:element name="contactId"
> type="xs:int"/>
>                                         <xs:element name="User">
>                                             <xs:complexType>
>                                                 <xs:all>
>                                                     <xs:element
> name="userId" type="xs:int"/>
>                                                     <xs:element
> name="userProfile" type="xs:string"/>
>                                                 </xs:all>
>                                             </xs:complexType>
>                                         </xs:element>
>                                         <xs:element name="firstName"
> type="xs:string"/>
>                                         <xs:element name="lastName"
> type="xs:string"/>
>                                     </xs:all>
>                                 </xs:complexType>
>                             </xs:element>
>                             <xs:element name="SynchRequest">
>                                 <xs:complexType>
>                                     <xs:sequence>
>                                         <xs:element name="Contact"
> maxOccurs="unbounded">
>                                             <xs:complexType>
>                                                 <xs:all>
>                                                     <xs:element
> name="contactId" type="xs:int"/>
>                                                     <xs:element name="User">
>                                                         <xs:complexType>
>                                                             <xs:all>
>                                                                
> <xs:element name="userId" type="xs:int"/>
>                                                                
> <xs:element name="userProfile" type="xs:string"/>
>                                                             </xs:all>
>                                                         </xs:complexType>
>                                                     </xs:element>
>                                                     <xs:element
> name="firstName" type="xs:string"/>
>                                                     <xs:element
> name="lastName" type="xs:string"/>
>                                                 </xs:all>
>                                             </xs:complexType>
>                                         </xs:element>
>                                     </xs:sequence>
>                                 </xs:complexType>
>                             </xs:element>
>                         </xs:choice>
>                     </xs:complexType>
>                 </xs:element>
>                 <xs:element name="Version" type="xs:string"/>
>             </xs:sequence>
>         </xs:complexType>
>     </xs:element>
> </xs:schema>
> 
> and i use Castor to generate the java class.
> 
> My first problem is, the Contact element from my schema is a hibernate
> generated POJO class. How can i make generated class to use this class,
> instead generating a new contact class?
> 
> My second problem is Castor generated an isValid() method for each java
> class. Somehow xfire need both getter/setter for each property of a
> class. I've managed to hack this by creating a setValid(boolean valid)
> for each class. I was wondering whether there any other way i can avoid
> this without have to manually add setValid method for each class.
> 
> 
> Thanks in Advance
> - abangkis -


---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply via email to