-
Type:
Story
-
Status: Closed
-
Priority:
Minor
-
Resolution: Completed
-
Affects Version/s: 6.2.X EE, 7.0.0 DXP FP4
-
Fix Version/s: 7.0.0 DXP FP5, 7.0.0 DXP SP1, 7.0.3 CE GA4, Master
-
Component/s: Legacy, Legacy > API
-
Branch Version/s:7.0.x
-
Backported to Branch:Committed
-
Git Pull Request:
ConstantsBeanFactoryUtil generates a bean from a class (see LPS-34323), but existing methods on the class aren't generated on the bean.
We'd like existing methods in a constants class part of the generated bean.
For a class like
class Constants { public static String STRING_VALUE = "Some string content"; public static int INT_VALUE = 100; public static String getIntString(int value) { if (value == INT_VALUE) { return STRING_VALUE; } } }
Once the following statement is run:
Object constantsBean = ConstantsBeanFactoryUtil.getConstantsBean(Constants.class);
constantsBean might be an instance of the following runtime generated class:
class ConstantsBean { public String getSTRING_VALUE() { return Constants.STRING_VALUE; } public int getINT_VALUE() { return Constants.INT_VALUE; } public static String getIntString(int value) { return Constants.getIntString(value); } }