Package soot.jimple.validation
Enum NewValidator
- java.lang.Object
-
- java.lang.Enum<NewValidator>
-
- soot.jimple.validation.NewValidator
-
- All Implemented Interfaces:
Serializable,Comparable<NewValidator>,BodyValidator,Validator<Body>
public enum NewValidator extends Enum<NewValidator> implements BodyValidator
A relatively simple validator. It tries to check whether after each new-expression-statement there is a corresponding call to the <init> method before a use or the end of the method.- Author:
- Marc Miltenberger, Steven Arzt
-
-
Enum Constant Summary
Enum Constants Enum Constant Description INSTANCE
-
Field Summary
Fields Modifier and Type Field Description static booleanMUST_CALL_CONSTRUCTOR_BEFORE_RETURN
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanisBasicValidator()Basic validators run essential checks and are run always if validate is called.
If this method returns false and the caller of the validator respects this property,
the checks will only be run if the debug or validation option is activated.static NewValidatorv()voidvalidate(Body body, List<ValidationException> exceptions)Checks whether after each new-instruction a constructor call follows.static NewValidatorvalueOf(String name)Returns the enum constant of this type with the specified name.static NewValidator[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
INSTANCE
public static final NewValidator INSTANCE
-
-
Method Detail
-
values
public static NewValidator[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (NewValidator c : NewValidator.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static NewValidator valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
v
public static NewValidator v()
-
validate
public void validate(Body body, List<ValidationException> exceptions)
Checks whether after each new-instruction a constructor call follows.- Specified by:
validatein interfaceBodyValidator- Specified by:
validatein interfaceValidator<Body>- Parameters:
body- the body to checkexceptions- the list of exceptions
-
isBasicValidator
public boolean isBasicValidator()
Description copied from interface:BodyValidatorBasic validators run essential checks and are run always if validate is called.
If this method returns false and the caller of the validator respects this property,
the checks will only be run if the debug or validation option is activated.- Specified by:
isBasicValidatorin interfaceBodyValidator- Specified by:
isBasicValidatorin interfaceValidator<Body>- Returns:
- whether this validator is a basic validator
-
-