// there is no need for further evaluation of mask, because this field
// was explicitly masked with positive mask
{
if (childValue instanceof DataComplex)
{
final DataMap composed = compose(name, complexWildCard, wildcard(1));
if (composed != null)
{
operation = composed;
}
}
// else
// data is of primitive type, and is selected with mask = 1, but there also
// exist
// a wildcard mask, in this case we don't report it as an error
}
}
else
{
// field was not explicitly masked
final Object opChild = opNode.get(Escaper.replaceAll(name, "$", "$$"));
// if item was not explicitly excluded nor included
if (opChild == null)
{
// 1. there was no filter for this item - in this case apply default filter
// and $* if it was defined and field was not filtered out
if (areFieldsExplicitlyRemoved(defaultMode)
|| areFieldsImplicitlyRemoved(defaultMode, complexWildCard))
{
operation = FilterConstants.NEGATIVE;
}
else if (complexWildCard != null)
{
if (childValue instanceof DataComplex)
{
operation = complexWildCard;
}
else if (needsRemoving(defaultMode, complexWildCard))
{
operation = FilterConstants.NEGATIVE;
}
}
}
else
{
// precondition:
assert (opChild.getClass() == DataMap.class) : opChild;
final Object rawWildcard = opNode.get(FilterConstants.WILDCARD);
final DataMap effectiveComplexWildcard =
((rawWildcard != null && rawWildcard.equals(POSITIVE)) ? wildcard(POSITIVE)
: (DataMap) rawWildcard);
// effectiveMask contains complex mask composed with wildcard if wildcard is
// defined
final DataMap effectiveMask =
((effectiveComplexWildcard == null) ? (DataMap) opChild
: compose(name, (DataMap) opChild, effectiveComplexWildcard));
// 2. filter was complex
if (needsRemoving(defaultMode, effectiveMask))