/** * Converts the given name to a valid Java name. * * @param name the XML name to convert * @return a valid Java member name */ @Override public final String toJavaMemberName(final String name) { return toJavaMemberName(name, true); }
/** * 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); }