Yes, uncomment the last line in the following snippet in your Castor
Properties file (or you can set it programmatically):

# Defines the Naming "style" or conventions to use when creating XML names
# from Java class or field names.
# Valid values are as follows:
# -----------------------------------------------------------------
# lower (default)  |  All names are lowercase with hyphens
#                  |  separating words.
#                  |
#                  |  Example: personInfo = person-info
# -----------------------------------------------------------------
# mixed            |  All names are mixed case, with Uppercase
#                  |  character as the first letter of a new word.
#                  |
#                  |  Example: personInfo = personInfo
#                  |  Example: FooBar     = fooBar
# -----------------------------------------------------------------
# {Any ClassName}  |  Any Class which implements
#                  |  org.exolab.castor.xml.XMLNaming
# -----------------------------------------------------------------
#
# By default, all names are treated as the "lower" option.  To preserve the
# Java mixed-case conventions, uncomment the following line.
#
#org.exolab.castor.xml.naming=mixed-----Original Message-----
  From: Jay Goldman [mailto:[EMAIL PROTECTED]
  Sent: Friday, January 19, 2007 7:26 AM
  To: [email protected]
  Subject: RE: [castor-user] How to change Castor default binding behavior


  The castor.properties file it tells you how to do this. you need to
uncomment the
  org.exolab.castor.xml.naming=mixed



----------------------------------------------------------------------------
--
  From: Xinjun Chen [mailto:[EMAIL PROTECTED]
  Sent: Friday, January 19, 2007 4:31 AM
  To: [email protected]
  Subject: [castor-user] How to change Castor default binding behavior


  Hi,

  I am using Castor-xml-1.0.5 to do data binding.
  My class file is similar to the following

  public class HearingDetailsVO {
  private String caseNo;
  private String docNo;
  private int hearings;
  }

  When I use default Marshalling behavior, the xml generated is as <case-no>
<doc-no>, and etc.
  Can I modify some property so that Castor by default will use exactly the
attribute name "caseNo" as xml name instead of "case-no"?
  Currently I am writing customized mapping file to solve the problem, but I
am wondering whether I can do it without mapping file.


  Regards,
  Xinjun

Reply via email to