public class OverridingJavaClassSource extends JavaSootClassSource
When replacing specific parts of a class by default, it delegates to the SootClassSource
delegate provided in the constructor.
To alter the results of invocations to e.g. resolveFields()
, simply call withFields(Collection)
to obtain a new OverridingJavaClassSource
. The new instance will
then use the supplied value instead of calling resolveFields()
on the delegate.
classSignature, classSource, sourcePath
Constructor and Description |
---|
OverridingJavaClassSource(AnalysisInputLocation<JavaSootClass> srcNamespace,
Path sourcePath,
ClassType classType,
ClassType superClass,
Set<ClassType> interfaces,
ClassType outerClass,
Set<SootField> sootFields,
Set<SootMethod> sootMethods,
Position position,
EnumSet<Modifier> modifiers,
Iterable<AnnotationUsage> annotations,
Iterable<AnnotationUsage> methodAnnotations,
Iterable<AnnotationUsage> fieldAnnotations)
Class source where all information already available
|
OverridingJavaClassSource(JavaSootClassSource delegate) |
buildClass
getClassSource, getClassType, getSourcePath
public OverridingJavaClassSource(@Nonnull JavaSootClassSource delegate)
public OverridingJavaClassSource(@Nonnull AnalysisInputLocation<JavaSootClass> srcNamespace, @Nonnull Path sourcePath, @Nonnull ClassType classType, @Nullable ClassType superClass, @Nonnull Set<ClassType> interfaces, @Nullable ClassType outerClass, @Nonnull Set<SootField> sootFields, @Nonnull Set<SootMethod> sootMethods, @Nonnull Position position, @Nonnull EnumSet<Modifier> modifiers, @Nonnull Iterable<AnnotationUsage> annotations, @Nonnull Iterable<AnnotationUsage> methodAnnotations, @Nullable Iterable<AnnotationUsage> fieldAnnotations)
@Nonnull public Collection<? extends SootMethod> resolveMethods() throws ResolveException
resolveMethods
in class SootClassSource<JavaSootClass>
ResolveException
@Nonnull public Collection<? extends SootField> resolveFields() throws ResolveException
resolveFields
in class SootClassSource<JavaSootClass>
ResolveException
@Nonnull public Set<Modifier> resolveModifiers()
resolveModifiers
in class SootClassSource<JavaSootClass>
@Nonnull public Set<? extends ClassType> resolveInterfaces()
resolveInterfaces
in class SootClassSource<JavaSootClass>
@Nonnull public Optional<? extends ClassType> resolveSuperclass()
resolveSuperclass
in class SootClassSource<JavaSootClass>
@Nonnull public Optional<? extends ClassType> resolveOuterClass()
resolveOuterClass
in class SootClassSource<JavaSootClass>
@Nonnull public Position resolvePosition()
resolvePosition
in class SootClassSource<JavaSootClass>
@Nonnull protected Iterable<AnnotationUsage> resolveAnnotations()
resolveAnnotations
in class JavaSootClassSource
public boolean equals(Object o)
equals
in class AbstractClassSource<JavaSootClass>
public int hashCode()
hashCode
in class AbstractClassSource<JavaSootClass>
@Nonnull public OverridingJavaClassSource withReplacedMethod(@Nonnull SootMethod toReplace, @Nonnull SootMethod replacement)
@Nonnull public OverridingJavaClassSource withMethods(@Nonnull Collection<SootMethod> overriddenSootMethods)
@Nonnull public OverridingJavaClassSource withReplacedField(@Nonnull SootField toReplace, @Nonnull SootField replacement)
@Nonnull public OverridingJavaClassSource withFields(@Nonnull Collection<SootField> overriddenSootFields)
@Nonnull public OverridingJavaClassSource withModifiers(@Nonnull Set<Modifier> overriddenModifiers)
@Nonnull public OverridingJavaClassSource withInterfaces(@Nonnull Set<ClassType> overriddenInterfaces)
@Nonnull public OverridingJavaClassSource withSuperclass(@Nonnull Optional<ClassType> overriddenSuperclass)
@Nonnull public OverridingJavaClassSource withOuterClass(@Nonnull Optional<ClassType> overriddenOuterClass)
@Nonnull public OverridingJavaClassSource withPosition(@Nullable Position position)
Copyright © 2023 Soot OSS. All rights reserved.