Java Class Load getClassForDomain(String domain)

Here you can find the source of getClassForDomain(String domain)

Description

get Class For Domain

License

Apache License

Declaration

public static Class getClassForDomain(String domain) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.util.*;

public class Main {
    private static final Map<Class, Set<String>> CLASS_TO_DOMAINS = new HashMap<>();

    public static Class getClassForDomain(String domain) {
        for (Map.Entry<Class, Set<String>> entry : CLASS_TO_DOMAINS.entrySet()) {
            if (entry.getValue().contains(domain))
                return entry.getKey();
        }//from  www . j a  va  2 s  . com

        throw new IllegalArgumentException("Unknown domain '" + domain + "'");
    }
}

Related

  1. getClasses(Object... objects)
  2. getClasses(String input)
  3. getClassesFromPaths(String[] classpaths)
  4. getClassesOfType(T[] l, Class type)
  5. getClassesTree(Class clazz)
  6. getClassFQNString(Class clazz, StringBuilder sb)
  7. getClassHierarchyFrom(Class clazz)
  8. getClassHierarchyLeaf( Collection> classes)
  9. getClassName(String logicalName, String trailingName)