Class InstrumentationConfiguration
- java.lang.Object
-
- org.robolectric.internal.bytecode.InstrumentationConfiguration
-
public class InstrumentationConfiguration extends Object
Configuration rules forSandboxClassLoader.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classInstrumentationConfiguration.Builder
-
Constructor Summary
Constructors Modifier Constructor Description protectedInstrumentationConfiguration(Map<String,String> classNameTranslations, Collection<MethodRef> interceptedMethods, Collection<String> instrumentedPackages, Collection<String> instrumentedClasses, Collection<String> classesToNotAcquire, Collection<String> packagesToNotAquire, Collection<String> classesToNotInstrument, Collection<String> packagesToNotInstrument, String classesToNotInstrumentRegex)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<String,String>classNameTranslations()Map from a requested class to an alternate stand-in, or not.booleanequals(Object o)inthashCode()StringmappedTypeName(String internalName)Set<MethodRef>methodsToIntercept()static InstrumentationConfiguration.BuildernewBuilder()StringremapParams(String desc)StringremapParamType(String desc)booleanshouldAcquire(String name)Determine ifSandboxClassLoadershould load a given class.booleanshouldAcquireResource(String name)Determine ifSandboxClassLoadershould load a given resource.booleanshouldInstrument(ClassDetails classDetails)Determine ifSandboxClassLoadershould instrument a given class.
-
-
-
Constructor Detail
-
InstrumentationConfiguration
protected InstrumentationConfiguration(Map<String,String> classNameTranslations, Collection<MethodRef> interceptedMethods, Collection<String> instrumentedPackages, Collection<String> instrumentedClasses, Collection<String> classesToNotAcquire, Collection<String> packagesToNotAquire, Collection<String> classesToNotInstrument, Collection<String> packagesToNotInstrument, String classesToNotInstrumentRegex)
-
-
Method Detail
-
newBuilder
public static InstrumentationConfiguration.Builder newBuilder()
-
shouldInstrument
public boolean shouldInstrument(ClassDetails classDetails)
Determine ifSandboxClassLoadershould instrument a given class.- Parameters:
classDetails- The class to check.- Returns:
- True if the class should be instrumented.
-
shouldAcquire
public boolean shouldAcquire(String name)
Determine ifSandboxClassLoadershould load a given class.- Parameters:
name- The fully-qualified class name.- Returns:
- True if the class should be loaded.
-
shouldAcquireResource
public boolean shouldAcquireResource(String name)
Determine ifSandboxClassLoadershould load a given resource.- Parameters:
name- The fully-qualified resource name.- Returns:
- True if the resource should be loaded.
-
classNameTranslations
public Map<String,String> classNameTranslations()
Map from a requested class to an alternate stand-in, or not.- Returns:
- Mapping of class name translations.
-
-