You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jaxme-dev@ws.apache.org by Frederic Ahring <FA...@de.ibm.com> on 2005/07/27 20:53:42 UTC
JavaSource: bean property with void type?
Hello
I stumbled upon this piece of code in JavaSource:
public void newBeanProperty(JavaQName pType, String pName) {
String upperCaseName = Character.toUpperCase(pName.charAt(0)) +
pName.substring(1);
if (JavaQNameImpl.VOID.equals(pType)) {
newBeanProperty(pType, pName, "is" + upperCaseName, "set"
+ upperCaseName);
} else {
newBeanProperty(pType, pName, "get" + upperCaseName, "set"
+ upperCaseName);
}
}
and I'm a bit clueless as what this means. In which cases is it valid to
have 'void' as the type of a property? As bean properties are java fields,
i.e. instance variables and 'void' is an invalid type for a variable. So
how could this ever be?
Of course, the method could be fed with an invalid type, but then it
should throw an exception or silently ignore it, not generate a different
valid looking piece of code.
I can only assume boolean is meant here ?
Could you please give me a hint why it is made this way and in what case
it is used? It looks so much as being made on purpose.
Thanks.
:Frederic:
---------------------------------------------------------------------
To unsubscribe, e-mail: jaxme-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: jaxme-dev-help@ws.apache.org
Re: JavaSource: bean property with void type?
Posted by Jochen Wiedmann <jo...@gmail.com>.
Frederic Ahring wrote:
> I can only assume boolean is meant here ?
You are, of course, right. :-)
---------------------------------------------------------------------
To unsubscribe, e-mail: jaxme-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: jaxme-dev-help@ws.apache.org