Java Utililty Methods Class Name Format

List of utility methods to do Class Name Format

  1. HOME
  2. Java
  3. C
  4. Class Name Format

Description

The list of methods to do Class Name Format are organized into topic(s).

Method

String classToAttributeName(Class clazz)
Helper method to convert a class name into a suitable attribute name.
String ret = clazz.getName();
ret = ret.replaceAll("\\.", "_");
return ret;
String classToFile(String name)
Converts a clas name to a file name.
return name.replace('.', '/').concat(".class");
String classToFilename(Class clazz)
class To Filename
return classnameToFilename(clazz.getName());
String classToFileName(String str)
A method that gets a class based on its file name.
str = str.replace('.', '/');
if (!str.endsWith(".class")) {
 str = str + ".class";
return str;
String classToInstance(String uriClass)
Constructs the URI for instance by the URI of class.
int sepidx = uriClass.indexOf('#');
if (sepidx == -1) {
 sepidx = uriClass.lastIndexOf('/');
if (sepidx == -1) {
 sepidx = uriClass.lastIndexOf(':');
if (sepidx == -1) {
...
String classToLDAPName(Class c)
convert a full classname like org.site.module.class to an ldap friendly version by replacing all "."
return c.getName().replaceAll("\\.", "-");
String classToPath(Class clazz)
translates path to class in package notation to standard path notation with addition of .class suffix
return clazz.getName().replaceAll("\\.", "/") + ".class";
String classToPath(String name, boolean resource)
class To Path
boolean i18nClass = false;
String propSuffix = ".properties";
if (name.startsWith("com.pari.client.Helper") || name.startsWith("com.pari.server.Helper")) {
 i18nClass = true;
String classsuffix = ".class";
char oldChar = '.';
char newChar = '/';
...
String classToResource(String className)
Converts a class name (with dots) to the corresponding resource we're trying to find in the classpath.
return className.replace('.', '/') + ".class";
String classToResourceKeyPrefix(final Class clazz)
class To Resource Key Prefix
return clazz.getName().replace('$', '.');


AltStyle によって変換されたページ (->オリジナル) /