33import lombok .AccessLevel ;
44import lombok .RequiredArgsConstructor ;
55import pl .wavesoftware .utils .stringify .configuration .AlwaysTruePredicate ;
6+ import pl .wavesoftware .utils .stringify .configuration .BeanFactory ;
67import pl .wavesoftware .utils .stringify .configuration .DoNotInspect ;
78import pl .wavesoftware .utils .stringify .configuration .Inspect ;
8- import pl .wavesoftware .utils .stringify .configuration .Predicate ;
9- import pl .wavesoftware .utils .stringify .configuration .BeanFactory ;
10-
11- import java .lang .reflect .Field ;
9+ import pl .wavesoftware .utils .stringify .configuration .InspectionPoint ;
10+ import pl .wavesoftware .utils .stringify .lang .Predicate ;
1211
1312/**
1413 * @author <a href="mailto:krzysztof.suszynski@coi.gov.pl">Krzysztof Suszynski</a>
@@ -19,28 +18,30 @@ final class PromiscuousInspectFieldPredicate implements InspectFieldPredicate {
1918 private final BeanFactory beanFactory ;
2019
2120 @ Override
22- public boolean shouldInspect (Field field ) {
23- DoNotInspect doNotInspect = field .getAnnotation (DoNotInspect .class );
21+ public boolean shouldInspect (InspectionPoint inspectionPoint ) {
22+ DoNotInspect doNotInspect = inspectionPoint .getField ()
23+ .getAnnotation (DoNotInspect .class );
2424 if (doNotInspect != null ) {
25- return shouldInspect (field , doNotInspect );
25+ return shouldInspect (inspectionPoint , doNotInspect );
2626 } else {
27- Inspect inspect = field .getAnnotation (Inspect .class );
27+ Inspect inspect = inspectionPoint .getField ()
28+ .getAnnotation (Inspect .class );
2829 if (inspect != null && inspect .conditionally () != AlwaysTruePredicate .class ) {
29- Predicate <Field > predicate = beanFactory .create (inspect .conditionally ());
30- return predicate .test (field );
30+ Predicate <InspectionPoint > predicate = beanFactory .create (inspect .conditionally ());
31+ return predicate .test (inspectionPoint );
3132 } else {
3233 return true ;
3334 }
3435 }
3536 }
3637
37- private boolean shouldInspect (Field field , DoNotInspect doNotInspect ) {
38- Class <? extends Predicate <Field >> predicateClass = doNotInspect .conditionally ();
38+ private boolean shouldInspect (InspectionPoint inspectionPoint , DoNotInspect doNotInspect ) {
39+ Class <? extends Predicate <InspectionPoint >> predicateClass = doNotInspect .conditionally ();
3940 if (predicateClass == AlwaysTruePredicate .class ) {
4041 return false ;
4142 } else {
42- Predicate <Field > predicate = beanFactory .create (predicateClass );
43- return !predicate .test (field );
43+ Predicate <InspectionPoint > predicate = beanFactory .create (predicateClass );
44+ return !predicate .test (inspectionPoint );
4445 }
4546 }
4647}
0 commit comments