Brian Stansberry created WFCORE-3265:
----------------------------------------
Summary: Transformer ValueConverter utilities for complex attributes
Key: WFCORE-3265
URL:
https://issues.jboss.org/browse/WFCORE-3265
Project: WildFly Core
Issue Type: Enhancement
Components: Domain Management
Reporter: Brian Stansberry
As we start to have more complex attributes in our model, we need better facilities for
doing transformer work with the internals of those attributes, rather than just with the
top level attribute.
For rejects we have a decent start with RejectAttributeChecker.ListRejectAttributeChecker
and RejectAttributeChecker.ObjectFieldsRejectAttributeChecker. Maybe that is all that is
needed. For discards, I don't think there is anything to do, or at least not as a
priority, as discards are about the kernel deciding to toss the attribute as a whole.
(Perhaps for some case would want to toss an entire attribute based on a value of a field,
but that seems like a real edge case.)
Where we are lacking is with AttributeConverters. For a complex attribute, a
AttributeConverter could do something much like what a discard does -- remove a new field
if it is set to some value that the legacy slave would do without configuration. (See
WFCORE-3260 for why this kind of removal is important.)
We should have
AttributeConverter.ListAttributeConverter -- takes an AttributeConverter as a constructor
param and applies it to elements, removing elements if the converter returns an undefined
node.
AttributeConverter.ObjectFieldsConverter -- takes a Map<AD, AttributeConverter> as a
constructor param and for each item in the map applies the converter to the corresponding
field value, removing the field altogether if the converter returns an undefined node.
AttributeConverter.ObjectFieldsDiscarder -- takes a Map<AD, DiscardAttributeChecker>
as a constructor param and for each item in the map applies the discard checker to the
corresponding field value, removing the field altogether if the discarder says its
discardable.
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)