|
Groovy Documentation | |||||||
| FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectgroovy.org.codenarc.util.ModifiersUtil
class ModifiersUtil
Provide static utility methods for parsing AST member modifiers, e.g. public/protected/private, static, final, etc.
| Method Summary | |
|---|---|
static boolean
|
matchesAnyModifiers(Integer actualModifiers, List expectedModifiersList)
|
static boolean
|
matchesModifiers(Integer actualModifiers, Integer expectedModifiers)
Return true only if the actualModifiers int value contains all of the bits (enabled) from the expectedModifiers |
static int
|
parseModifiers(String modifiersString)
Parse a group of whitespace-delimited modifier names |
static List
|
parseModifiersList(String modifiersString)
Parse comma-separated list of modifier groups |
| Methods inherited from class Object | |
|---|---|
| wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll |
| Method Detail |
|---|
static boolean matchesAnyModifiers(Integer actualModifiers, List expectedModifiersList)
static boolean matchesModifiers(Integer actualModifiers, Integer expectedModifiers)
actualModifiers - - the full actual modifiers; an int value of the OR-ed modifiers (values from Opcodes)expectedModifiers - - the modifiers to check against; an int value of the OR-ed modifiers (values from Opcodes)
static int parseModifiers(String modifiersString)
modifiersString - - a group of whitespace-delimited modifier names
static List parseModifiersList(String modifiersString)
modifiersString - - comma-separated list of modifier groups;
each group is a list of whitespace-delimited modifier names;
e.g. "public, protected static, protected final"
Groovy Documentation