You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@juneau.apache.org by "James Bognar (Jira)" <ji...@apache.org> on 2020/03/30 21:15:00 UTC

[jira] [Created] (JUNEAU-210) SerializerSession should provide access to currently serializing bean.

James Bognar created JUNEAU-210:
-----------------------------------

             Summary: SerializerSession should provide access to currently serializing bean.
                 Key: JUNEAU-210
                 URL: https://issues.apache.org/jira/browse/JUNEAU-210
             Project: Juneau
          Issue Type: Improvement
          Components: Code
    Affects Versions: 8.1.3
            Reporter: James Bognar


It would be helpful in HtmlRender instance to have access to the outer bean when serializing a field so that you can alter contents based on other bean properties.

e.g.
{code:java}
	public static class BeanPropertyRender extends HtmlRender<String> {
		@Override
		public String getStyle(SerializerSession session, String value) {
			return "color:"+session.getCurrentBean(Bean.class).getColor()+";";
		}
	}
{code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)