Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-55336

Make existing methods in constants class part of constants bean generated by ConstantsBeanFactoryUtil

    Details

      Description

      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);
      	}
      }
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                brian.chan Brian Chan
                Reporter:
                eddie.olson Eddie Olson
                Recent user:
                Csaba Turcsan
                Participants of an Issue:
              • Votes:
                1 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Packages

                  Version Package
                  7.0.0 DXP FP5
                  7.0.0 DXP SP1
                  7.0.3 CE GA4
                  Master