/** * Extracts the filed name part from the methods name. Mostly it cuts away the method prefix. * * @param method the Method to process * @return the extracted field name */ @Override public final String extractFieldNameFromMethod(final Method method) { if (method == null) { return null; } String fieldName = null; if (isSetMethod(method)) { fieldName = method.getName().substring(METHOD_PREFIX_SET.length()); } else if (isCreateMethod(method)) { fieldName = method.getName().substring(METHOD_PREFIX_CREATE.length()); } else if (isGetMethod(method)) { fieldName = method.getName().substring(METHOD_PREFIX_GET.length()); } else if (isIsMethod(method)) { fieldName = method.getName().substring(METHOD_PREFIX_IS.length()); } else if (isAddMethod(method)) { fieldName = method.getName().substring(METHOD_PREFIX_ADD.length()); } return toJavaMemberName(fieldName); }
/** * Extracts the filed name part from the methods name. Mostly it cuts * away the method prefix. * @param method the Method to process * @return the extracted field name * @see org.castor.xml.JavaNaming#extractFieldNameFromMethod(java.lang.reflect.Method) */ public final String extractFieldNameFromMethod(final Method method) { if (method == null) { return null; } String fieldName = null; if (isSetMethod(method)) { fieldName = method.getName().substring(METHOD_PREFIX_SET.length()); } else if (isCreateMethod(method)) { fieldName = method.getName().substring(METHOD_PREFIX_CREATE.length()); } else if (isGetMethod(method)) { fieldName = method.getName().substring(METHOD_PREFIX_GET.length()); } else if (isIsMethod(method)) { fieldName = method.getName().substring(METHOD_PREFIX_IS.length()); } else if (isAddMethod(method)) { fieldName = method.getName().substring(METHOD_PREFIX_ADD.length()); } return toJavaMemberName(fieldName); } //FIELD_UNDERSCORE_PREFIX