Class AttachPoint
java.lang.Object
org.moeaframework.analysis.collector.AttachPoint
Identifies objects in an object graph (all public and private fields contained within an object and those it
references). For instance,
AttachPoint.isClass(TypeA.class).and(AttachPoint.isNestedIn(TypeB.class)will match any objects of type
TypeA
that are referenced (or accessible through) an object of type
TypeB
.-
Constructor Summary
ModifierConstructorDescriptionprotected
Protected constructor to prevent instantiation, but allow subclassing. -
Method Summary
Modifier and TypeMethodDescriptionand
(AttachPoint that) Returns an attach point which performs the logical AND between two attach points, matching an object only if both attach points match the object.static AttachPoint
Returns an attach point that matches an object if its type is equal to the specified type.static AttachPoint
isDeclaredIn
(Class<?> parentType) Returns an attach point that matches an object if it is a declared field of the specified type.static AttachPoint
isNestedIn
(Class<?> ancestorType) Returns an attach point that matches an object if it is nested inside a class of the specified type.static AttachPoint
isSubclass
(Class<?> type) Returns an attach point that matches an object if it is an instance of the specified type.abstract boolean
Returnstrue
if the specified object in the object graph matches some criteria; andfalse
otherwise.static AttachPoint
not
(AttachPoint that) Returns an attach point which performs the logical NOT on the given attach point, matching an object only if the attach point does not match the object.or
(AttachPoint that) Returns an attach point which performs the logical OR between two attach points, matching an object if either or both of the attach points match the object.
-
Constructor Details
-
AttachPoint
protected AttachPoint()Protected constructor to prevent instantiation, but allow subclassing.
-
-
Method Details
-
and
Returns an attach point which performs the logical AND between two attach points, matching an object only if both attach points match the object.- Parameters:
that
- the second attach point- Returns:
- an attach point which performs the logical AND between two attach points
-
or
Returns an attach point which performs the logical OR between two attach points, matching an object if either or both of the attach points match the object.- Parameters:
that
- the second attach point- Returns:
- an attach point which performs the logical OR between two attach points
-
not
Returns an attach point which performs the logical NOT on the given attach point, matching an object only if the attach point does not match the object.- Parameters:
that
- the original attach point- Returns:
- an attach point which performs the logical NOT on the given attach point
-
isClass
Returns an attach point that matches an object if its type is equal to the specified type. Note that subclasses of the type will not match.- Parameters:
type
- the required type of the object- Returns:
- an attach point that matches an object if its type is equal to the specified type
-
isSubclass
Returns an attach point that matches an object if it is an instance of the specified type. The specified type and all subclasses will match.- Parameters:
type
- the required type/supertype of the object- Returns:
- an attach point that matches an object if it is an instance of the specified type
-
isDeclaredIn
Returns an attach point that matches an object if it is a declared field of the specified type.- Parameters:
parentType
- the parent type- Returns:
- an attach point that matches an object if it is a declared field of the specified type
-
isNestedIn
Returns an attach point that matches an object if it is nested inside a class of the specified type. This includes both declared fields of the specified type and all fields accessible by recursively following all references.- Parameters:
ancestorType
- the ancestor type- Returns:
- an attach point that matches an object if it is nested inside a class of the specified type
-
matches
Returnstrue
if the specified object in the object graph matches some criteria; andfalse
otherwise.- Parameters:
parents
- the path from the root (starting) object to the current objectobject
- the current object- Returns:
true
if the specified object in the object graph matches some criteria; andfalse
otherwise
-