You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@xmlbeans.apache.org by Radu Preotiuc-Pietro <ra...@bea.com> on 2005/10/28 20:45:40 UTC

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 [mailto: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



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org