Here you can find the source of classToAttributeName(Class> clazz)
Parameter | Description |
---|---|
clazz | the Class |
public static String classToAttributeName(Class<?> clazz)
//package com.java2s; // compliance with the InfoGrid license. The InfoGrid license and important public class Main { /**/*from ww w . j a v a 2 s . c o m*/ * Helper method to convert a class name into a suitable attribute name. * * @param clazz the Class * @return the attribute name */ public static String classToAttributeName(Class<?> clazz) { String ret = clazz.getName(); ret = ret.replaceAll("\\.", "_"); return ret; } /** * Helper method to convert a class name and a local fragment into a suitable attribute name. * * @param clazz the Class * @param fragment the fragment, or local id * @return the attribute name */ public static String classToAttributeName(Class<?> clazz, String fragment) { String ret = clazz.getName(); ret = ret.replaceAll("\\.", "_"); ret = ret + "__" + fragment; return ret; } }