how to obtain the user code style preferences? Follow ANONYMOUS Created September 30, 2003 10:28 I need to know the member chosen prefix and suffix, to recognize setters, and getters.Alain
Again, sorry for suggesting something that I haven't tried, but does CodeStyleManager.propertyNameToVariableName do what you need?
Thanks a lot, Kirk.
It's exactly what I needed.
Summary :
-
If you prepend all your fields with "m_",
1/ 'age' is the property name,
2/ getAge() is the getter ,
3/ the following test will pass :
CodeStyleManager csm = CodeStyleManager.getInstance(__project);
String propertyName = "age";
String varName =
csm.propertyNameToVariableName(propertyName,VariableKind.FIELD);
assertEquals ( "m_age", varName);