Uploaded image for project: 'XMLBeans'
  1. XMLBeans
  2. XMLBEANS-219

Generated Method Names are Not Using Customized Class Names in xsdconfig File

    XMLWordPrintableJSON

    Details

    • Type: New Feature
    • Status: Resolved
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: Version 2
    • Fix Version/s: None
    • Component/s: Compiler
    • Labels:
      None

      Description

      ----Original Message----
      From: Radu Preotiuc-Pietro radup@bea.com
      Sent: Friday, October 28, 2005 11:46 AM
      To: user@xmlbeans.apache.org
      Subject: RE: Generated Method Names are using Customized Class Names in xsdconfig File

      Hm, that's an interesting idea, never thought of that. Could you log it
      in JIRA, so we can keep track of it?

      Radu

      ----Original Message----
      From: tran, phong tran_phong@emc.com
      Sent: Friday, October 21, 2005 2:43 PM
      To: user@xmlbeans.apache.org
      Subject: Generated Method Names are using Customized Class Names in
      xsdconfig File

      Hi All,
      I'm just starting to use XmlBeans to generate Java classes from a
      XML schema. I'm using xsdconfig file to customize the class names for
      some of our "awkward" element names. It works perfectly as intended, but
      I notice that names for generated methods do not use new binding class
      names, but element names (Schema type names) are still used instead.
      Here is the
      example:

      <xb:config
      xmlns:xb="http://xml.apache.org/xmlbeans/2004/02/xbean/config">

      <!--<qname> specifies a Java class name for a Qualified name -->
      <xb:qname name="EdStorageType" javaname="StorageSystem" />

      </xb:config>

      I changed "EdStorageType" type name to "StorageSystem" class name in the
      xsdconfig file, but the mapped class names are not used as part of
      method names generated. Instead the schema type names with the "Type"
      postfix removed are used .

      Here some generated methods:
      -----------------------------
      StorageSystem[] getEdStorageArray();
      StorageSystem getEdStorageArray(int i);
      StorageSystem insertNewEdStorage(int i);
      StorageSystem addNewEdStorage();

      Functionally those methods are working properly. However their names are
      not consistent with the class names (objects) that they are supposed to
      work with. If I want to add a new StorageSystem object, it's natural and
      consistent if I call

      addNewStorageSystem();

      Instead of

      addNewEdStorage();

      Why can XBeans use the mapped class names when it generates the method
      names associated with these classes? Is there a way to configure the
      XBeans to use the mapped class names as part of the generated method
      names?

      Thanks a lot in advance,
      Phong

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              tran_phong Phong Tran
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: