Package org.openrewrite.java.marker
Interface JavaSourceSet.ClasspathIndex
- Enclosing class:
JavaSourceSet
public static interface JavaSourceSet.ClasspathIndex
SPI for
JavaSourceSet.classpath backings that can resolve a fully-qualified name
without scanning the entire list. The default ArrayList backing does
not implement this; lazy partition-backed implementations (e.g., V4 LST
deserialization) do, allowing recipes to query the classpath in
O(log n) per partition rather than forcing materialization of every entry.
Implementations must accept the FQN in .-separated form (nested
classes use ., not $); JavaSourceSet.findClasspathType(String)
normalizes input before delegating.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceLazy-aware result ofwithGavsRemoved(java.util.Set<java.lang.String>): a paired(classpath, gavToTypes)view onto the surviving partitions. -
Method Summary
Modifier and TypeMethodDescriptionfindFullyQualified(String fqn) typesInPackage(String packageName) Stream the types whose package name equalspackageName(i.e., top-level types in the package — sub-package types and nested-class entries do not match).default @Nullable JavaSourceSet.ClasspathIndex.SubsetwithGavsRemoved(Set<String> gavKeysToRemove) Return the(classpath, gavToTypes)subset with the given GAV keys removed, preserving lazy semantics where the implementation supports it.
-
Method Details
-
findFullyQualified
-
typesInPackage
Stream the types whose package name equalspackageName(i.e., top-level types in the package — sub-package types and nested-class entries do not match). Stream-based to allow short-circuit operations likeStream.anyMatch(java.util.function.Predicate<? super T>)to terminate before all partitions are scanned. -
withGavsRemoved
Return the(classpath, gavToTypes)subset with the given GAV keys removed, preserving lazy semantics where the implementation supports it. Default returnsnull, signalling the caller to fall back to identity-based filtering. Lazy backings that track GAV provenance can implement this to skip materialization of the entire classpath when recipes callJavaSourceSet.removeTypesMatching(String, String)orJavaSourceSet.removeTypesForGav(String).
-