Java examples for Reflection:Modifier
Checks if String with modifiers contains ABSTRACT_MODIFIER and returns Modifier States TRUE if String contains this String or Modifier States.UNSET if not.
public class Main{ /**/*from ww w .ja v a 2 s . co m*/ * String representation of {@code abstract} modifier. */ public static final String ABSTRACT_MODIFIER = "abstract"; /** * Checks if String with modifiers contains {@code ABSTRACT_MODIFIER} and * returns {@code ModifierStates.TRUE} if String contains this String or * {@code ModifierStates.UNSET} if not. * * @param modifiers * String with modifiers. * @return {@code ModifierStates.TRUE} if String contains * {@code ABSTRACT_MODIFIER} or {@code ModifierStates.UNSET} if not. */ public static ModifierStates isAbstract(String modifiers) { if (modifiers.contains(ABSTRACT_MODIFIER)) { return ModifierStates.TRUE; } return ModifierStates.UNSET; } }