congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
ClassUtils
Code IndexAdd Tabnine to your IDE (free)

How to use
ClassUtils
in
com.atlassian.plugin.util

Best Java code snippets using com.atlassian.plugin.util.ClassUtils (Showing top 6 results out of 315)

origin: com.atlassian.plugins/atlassian-plugins-core

/**
 * Finds all super classes and interfaces for a given class
 *
 * @param cls The class to scan
 * @return The collected related classes found
 */
public static Set<Class> findAllTypes(Class cls) {
  Set<Class> types = new HashSet<>();
  findAllTypes(cls, types);
  return types;
}
origin: com.atlassian.plugins/atlassian-plugins-core

/**
 * Get the underlying class for a type, or null if the type is a variable type.
 *
 * @param type the type
 * @return the underlying class
 */
private static Class<?> getClass(Type type) {
  if (type instanceof Class) {
    return (Class) type;
  } else if (type instanceof ParameterizedType) {
    return getClass(((ParameterizedType) type).getRawType());
  } else if (type instanceof GenericArrayType) {
    Type componentType = ((GenericArrayType) type).getGenericComponentType();
    Class<?> componentClass = getClass(componentType);
    if (componentClass != null) {
      return Array.newInstance(componentClass, 0).getClass();
    } else {
      return null;
    }
  } else {
    return null;
  }
}
origin: com.atlassian.plugins/atlassian-plugins-core

  moduleTypeClass = ClassUtils.getTypeArguments(AbstractModuleDescriptor.class, getClass()).get(0);
} catch (RuntimeException ex) {
  log.debug("Unable to get generic type, usually due to Class.forName() problems", ex);
origin: com.atlassian.plugins/atlassian-plugins-core

/**
 * Finds all super classes and interfaces for a given class
 *
 * @param cls   The class to scan
 * @param types The collected related classes found
 */
public static void findAllTypes(Class cls, Set<Class> types) {
  if (cls == null) {
    return;
  }
  // check to ensure it hasn't been scanned yet
  if (types.contains(cls)) {
    return;
  }
  types.add(cls);
  findAllTypes(cls.getSuperclass(), types);
  for (int x = 0; x < cls.getInterfaces().length; x++) {
    findAllTypes(cls.getInterfaces()[x], types);
  }
}
origin: com.atlassian.plugins/atlassian-plugins-core

Map<Type, Type> resolvedTypes = new HashMap<>();
Type type = childClass;
Class typeClass = getClass(type);
  typeClass = getClass(type);
  if (typeClass == null) {
    throw new IllegalArgumentException("Unable to find the class for the type " + type);
    baseType = resolvedTypes.get(baseType);
  typeArgumentsAsClasses.add(getClass(baseType));
origin: com.atlassian.plugins/atlassian-plugins-osgi

/**
 * Finds all referred packages for the specified set of classes/interfaces by scanning their bytecode.
 * Packages starting with "java." are ignored.
 *
 * @param classes The set of classes/interfaces to scan
 * @return The set of referred packages
 * @throws IOException If there are any problems scanning bytecode
 * @since 5.0.0
 */
public static Set<String> findReferredPackageNames(Collection<Class<?>> classes) throws IOException {
  if (classes == null || classes.isEmpty()) {
    return Collections.emptySet();
  }
  Set<Class> classesToScan = new HashSet<>();
  for (Class<?> clazz : classes) {
    ClassUtils.findAllTypes(clazz, classesToScan);
  }
  Set<String> referredClasses = new HashSet<>();
  Set<String> referredPackages = new HashSet<>();
  for (Class inf : classesToScan) {
    String clsName = inf.getName().replace('.', '/') + ".class";
    crawlReferenceTree(clsName, referredClasses, referredPackages, 1);
  }
  return ImmutableSet.copyOf(referredPackages);
}
com.atlassian.plugin.utilClassUtils

Javadoc

Class utility methods

Most used methods

  • findAllTypes
    Finds all super classes and interfaces for a given class
  • getClass
    Get the underlying class for a type, or null if the type is a variable type.
  • getTypeArguments
    Get the actual type arguments a child class has used to extend a generic base class.

Popular in Java

  • Making http post requests using okhttp
  • setContentView (Activity)
  • getExternalFilesDir (Context)
  • requestLocationUpdates (LocationManager)
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • Kernel (java.awt.image)
  • Socket (java.net)
    Provides a client-side TCP socket.
  • TreeSet (java.util)
    TreeSet is an implementation of SortedSet. All optional operations (adding and removing) are support
  • Modifier (javassist)
    The Modifier class provides static methods and constants to decode class and member access modifiers
  • BoxLayout (javax.swing)
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now