Java examples for Reflection:Method
is Mutator Method
//package com.java2s; import java.lang.reflect.Method; public class Main { public static final String[] MUTATOR_PREFIXES = new String[] { "set" }; public static boolean isMutator(Method method) { for (String prefix : MUTATOR_PREFIXES) { if (method.getName().startsWith(prefix)) return true; }/*from w w w .j a va 2s . c o m*/ return false; } }