axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "charles SOUILLARD (JIRA)" <axis-...@ws.apache.org>
Subject [jira] Created: (AXIS-2622) Java Property Naming Convention
Date Fri, 02 Feb 2007 15:42:05 GMT
Java Property Naming Convention
-------------------------------

                 Key: AXIS-2622
                 URL: https://issues.apache.org/jira/browse/AXIS-2622
             Project: Axis
          Issue Type: Bug
          Components: Deployment / Registries
    Affects Versions: 1.4
         Environment: Linux, jdk1.5
            Reporter: charles SOUILLARD


In class org.apache.axis.wsdl.toJava.JavaBeanHelperWriter, there is method that try to conform
javabeans spec about java properties naming convention.

The method : 
private String getAsFieldName(String fieldName)

I have made some comparaison and build a tab which summarize that :
XML Name              Axis Generated JavaBean              ElementDesc elemField.setFieldName
     al                                 al                                               
   al
     aL                                aL                                                
  AL
     Al                                 al                                               
   al
     AL                                AL                                                
  AL


You can see that there is a problem on the second line... ElementDescriptor will use AL and
aL is defined in the bean...

SPECIFICATION JavaBeans 1.01   :   8.8 Capitalization of inferred names.

When we use design patterns to infer a property or event name, we need to decide what rules
to follow for capitalizing the inferred name. If we extract the name from the middle of a
normal
mixedCase style Java name then the name will, by default, begin with a capital letter.
Java programmers are accustomed to having normal identifiers start with lower case letters.
Vigorous reviewer input has convinced us that we should follow this same conventional rule
for property and event names.

Thus when we extract a property or event name from the middle of an existing Java name, we
normally convert the first character to lower case. However to support the occasional use
of all
upper-case names, we check if the first two characters of the name are both upper case and
if
so leave it alone. So for example,
"FooBah" becomes "fooBah"
"Z" becomes "z"
"URL" becomes "URL"
We provide a method Introspector.decapitalize which implements this conversion rule.


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


Mime
View raw message