@Test public void isPropertyReaderテスト() { assertTrue(Beans.isPropertyReader("getHoge")); assertTrue(Beans.isPropertyReader("isHoge")); assertFalse(Beans.isPropertyReader(null)); assertFalse(Beans.isPropertyReader("")); assertFalse(Beans.isPropertyReader("getClass")); assertFalse(Beans.isPropertyReader("hasHoge")); }
public static boolean isPropertyReader(String suspect) { if (suspect == null) return false; if ("getClass".equals(suspect)) return false; return READER_PATTERN.matcher(suspect).matches(); }
Beans { public static boolean isPropertyReader(String suspect) { if (suspect == null) return false; if ("getClass".equals(suspect)) return false; return READER_PATTERN.matcher(suspect).matches(); } }
Beans { public static boolean isPropertyReader(String suspect) { if (suspect == null) return false; if ("getClass".equals(suspect)) return false; return READER_PATTERN.matcher(suspect).matches(); } private  Beans(); }
Beans { public static boolean isPropertyReader(String suspect) { if (suspect == null) return false; if ("getClass".equals(suspect)) return false; return READER_PATTERN.matcher(suspect).matches(); } private  Beans(); static String capitalize(String capitalizee); static String decapitalize(String decapitalizee); static String decapitalize(String decapitalizee, boolean doubleUppercaseEnable); static boolean isPropertyReader(String suspect); static boolean isPropertyWriter(String suspect); static boolean isPropertyAccessor(String suspect); static String generatePropertyNameFor(String accessorName); static T make(Class<T> clazz); static PropertyDescriptor[] findPropertyDescriptorsFor(Class<?> clazz); static PropertyDescriptor findPropertyDescriptorFor(Class<?> clazz, String propertyName); static Object readPropertyValueNamed(String propertyName, Object bean); static void writePropertyValueNamed(String propertyName, Object bean, Object newValue); static Object readPseudoPropertyValueNamed(String propertyName, Object bean); static void writePseudoPropertyValueNamed(String propertyName, Object bean, Object newValue); static String[] listPseudoPropertyNames(Class<?> clazz); static Class<?> detectDeclaredPropertyType(String propertyName, Class<?> target); }
Beans { public static boolean isPropertyReader(String suspect) { if (suspect == null) return false; if ("getClass".equals(suspect)) return false; return READER_PATTERN.matcher(suspect).matches(); } private  Beans(); static String capitalize(String capitalizee); static String decapitalize(String decapitalizee); static String decapitalize(String decapitalizee, boolean doubleUppercaseEnable); static boolean isPropertyReader(String suspect); static boolean isPropertyWriter(String suspect); static boolean isPropertyAccessor(String suspect); static String generatePropertyNameFor(String accessorName); static T make(Class<T> clazz); static PropertyDescriptor[] findPropertyDescriptorsFor(Class<?> clazz); static PropertyDescriptor findPropertyDescriptorFor(Class<?> clazz, String propertyName); static Object readPropertyValueNamed(String propertyName, Object bean); static void writePropertyValueNamed(String propertyName, Object bean, Object newValue); static Object readPseudoPropertyValueNamed(String propertyName, Object bean); static void writePseudoPropertyValueNamed(String propertyName, Object bean, Object newValue); static String[] listPseudoPropertyNames(Class<?> clazz); static Class<?> detectDeclaredPropertyType(String propertyName, Class<?> target);  }