juneau-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Bognar (Jira)" <j...@apache.org>
Subject [jira] [Created] (JUNEAU-210) SerializerSession should provide access to currently serializing bean.
Date Mon, 30 Mar 2020 21:15:00 GMT
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)

Mime
View raw message