private boolean pathMatches ( Path path , SquigglyContext context ) { List < SquigglyNode > nodes = context . getNodes ( ) ; Set < String > viewStack = null ; SquigglyNode viewNode = null ; int pathSize = path . getElements ( ) . size ( ) ; int lastIdx = pathSize - 1 ; for ( int i = 0 ; i < pathSize ; i ++ ) { PathElement element = path . getElements ( ) . get ( i ) ; if ( viewNode != null && ! viewNode . isSquiggly ( ) ) { Class beanClass = element . getBeanClass ( ) ; if ( beanClass != null && ! Map . class . isAssignableFrom ( beanClass ) ) { Set < String > propertyNames = getPropertyNamesFromViewStack ( element , viewStack ) ; if ( ! propertyNames . contains ( element . getName ( ) ) ) { return false ; } } } else if ( nodes . isEmpty ( ) ) { return false ; } else { SquigglyNode match = findBestSimpleNode ( element , nodes ) ; if ( match == null ) { match = findBestViewNode ( element , nodes ) ; if ( match != null ) { viewNode = match ; viewStack = addToViewStack ( viewStack , viewNode ) ; } } else if ( match . isAnyShallow ( ) ) { viewNode = match ; } else if ( match . isAnyDeep ( ) ) { return true ; } if ( match == null ) { if ( isJsonUnwrapped ( element ) ) { continue ; } return false ; } if ( match . isNegated ( ) ) { return false ; } nodes = match . getChildren ( ) ; if ( i < lastIdx && nodes . isEmpty ( ) && ! match . isEmptyNested ( ) && SquigglyConfig . isFilterImplicitlyIncludeBaseFields ( ) ) { nodes = BASE_VIEW_NODES ; } } } return true ; }
perform the actual matching