Package edu.umd.cs.findbugs.ba.obl
Class MatchMethodEntry
java.lang.Object
edu.umd.cs.findbugs.ba.obl.MatchMethodEntry
- All Implemented Interfaces:
ObligationPolicyDatabaseEntry
An ObligationPolicyDatabaseEntry which creates or deletes an obligation based
on a call to a specified method.
- Author:
- David Hovemeyer
-
Constructor Summary
ConstructorDescriptionMatchMethodEntry
(XMethod xmethod, ObligationPolicyDatabaseActionType action, ObligationPolicyDatabaseEntryType entryType, Obligation... obligations) Constructor.MatchMethodEntry
(MethodDescriptor method, ObligationPolicyDatabaseActionType action, ObligationPolicyDatabaseEntryType entryType, Obligation... obligations) MatchMethodEntry
(TypeMatcher receiverType, StringMatcher methodName, StringMatcher signature, boolean isStatic, ObligationPolicyDatabaseActionType action, ObligationPolicyDatabaseEntryType entryType, Obligation... obligations) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionboolean
getActions
(org.apache.bcel.generic.ReferenceType receiverType, String methodName, String signature, boolean isStatic, Collection<ObligationPolicyDatabaseAction> actionList) Get the ObligationPolicyDatabaseActions that should be applied when the method described by the parameters is called.Get the type of entry (STRONG or WEAK).toString()
-
Constructor Details
-
MatchMethodEntry
public MatchMethodEntry(XMethod xmethod, ObligationPolicyDatabaseActionType action, ObligationPolicyDatabaseEntryType entryType, Obligation... obligations) Constructor. Creates an entry which matches the given XMethod.- Parameters:
xmethod
- an XMethodaction
- ActionType (ADD or DEL, depending on whether obligation is added or deleted)entryType
- entry typeobligations
- Obligation to be added or deleted
-
MatchMethodEntry
public MatchMethodEntry(MethodDescriptor method, ObligationPolicyDatabaseActionType action, ObligationPolicyDatabaseEntryType entryType, Obligation... obligations) -
MatchMethodEntry
public MatchMethodEntry(TypeMatcher receiverType, StringMatcher methodName, StringMatcher signature, boolean isStatic, ObligationPolicyDatabaseActionType action, ObligationPolicyDatabaseEntryType entryType, Obligation... obligations) Constructor.- Parameters:
receiverType
- TypeMatcher to match the receiver type (or class containing static method)methodName
- StringMatcher to match name of called methodsignature
- StringMatcher to match signature of called methodisStatic
- true if matched method must be static, false otherwiseaction
- ActionType (ADD or DEL, depending on whether obligation is added or deleted)entryType
- entry typeobligations
- Obligation to be added or deleted
-
-
Method Details
-
getAllObligations
- Specified by:
getAllObligations
in interfaceObligationPolicyDatabaseEntry
-
getEntryType
Description copied from interface:ObligationPolicyDatabaseEntry
Get the type of entry (STRONG or WEAK).- Specified by:
getEntryType
in interfaceObligationPolicyDatabaseEntry
-
getActions
public boolean getActions(org.apache.bcel.generic.ReferenceType receiverType, String methodName, String signature, boolean isStatic, Collection<ObligationPolicyDatabaseAction> actionList) Description copied from interface:ObligationPolicyDatabaseEntry
Get the ObligationPolicyDatabaseActions that should be applied when the method described by the parameters is called.- Specified by:
getActions
in interfaceObligationPolicyDatabaseEntry
- Parameters:
receiverType
- receiver type of called methodmethodName
- name of called methodsignature
- signature of called methodisStatic
- true if called method is static, false otherwiseactionList
- List of ObligationPolicyDatabaseActions to be applied when a called method is matched by this entry- Returns:
- true if one or more actions were added, false if no actions were added
-
toString
-