Java Class Name Get getClassName(String string)

Here you can find the source of getClassName(String string)

Description

get Class Name

License

Creative Commons License

Declaration

public static String getClassName(String string) 

Method Source Code

//package com.java2s;
//License from project: Creative Commons License 

import java.util.Arrays;
import java.util.Iterator;
import java.util.List;

public class Main {
    public static String getClassName(String string) {
        List<String> words = Arrays.asList(string.split(" "));
        Iterator wordIterator = words.iterator();
        while (wordIterator.hasNext())
            if (wordIterator.next().equals("class"))
                return ((String) wordIterator.next()).replace("{", "");
        return null;
    }//from   w w  w.j a va  2 s  .  co  m
}

Related

  1. classNameSubName(String className)
  2. classNameSubPackage(String className)
  3. classNameWithType(String className, String type)
  4. getClassName(Class type)
  5. getClassName(Integer typeValue)
  6. getClassName(String typeName)
  7. getClassName(String upnpDataType)
  8. getClassNameAsSrc(Class clazz)
  9. getClassNameFromConfig(Object config)