Tabnine Logo
RebindUtils.getGenericsFromInterfaceHierarchy
Code IndexAdd Tabnine to your IDE (free)

How to use
getGenericsFromInterfaceHierarchy
method
in
sk.seges.acris.core.rebind.RebindUtils

Best Java code snippets using sk.seges.acris.core.rebind.RebindUtils.getGenericsFromInterfaceHierarchy (Showing top 2 results out of 315)

origin: sk.seges.acris/acris-client-core

/**
 * Tries to find parametrized type in interface hierarchy of a class.
 * 
 * @param classType
 *            A class having parametrized interface.
 * @param parametrizedType
 *            Interface where parametrized type is present.
 * @param position
 *            Position in a list of parametrized types in interface.
 * @return Generics type in interface implemented by a class type or null if
 *         not found
 */
private static JClassType getGenericsFromInterfaceHierarchy(JClassType classType,
    JClassType parametrizedType, int position) {
  for (JClassType type : classType.getImplementedInterfaces()) {
    if (type instanceof JParameterizedType) {
      JParameterizedType paramType = (JParameterizedType) type;
      if (paramType.getErasedType().equals(parametrizedType.getErasedType())) {
        return paramType.getTypeArgs()[position];
      }
    }
    // seach parent interfaces
    JClassType result = getGenericsFromInterfaceHierarchy(type, parametrizedType, position);
    if (result != null)
      return result;
  }
  return null;
}
origin: sk.seges.acris/acris-client-core

/**
 * Tries to find parametrized type in interface of a class.
 * 
 * @param classType
 *            A class having parametrized interface.
 * @param parametrizedType
 *            Interface where parametrized type is present.
 * @param position
 *            Position in a list of parametrized types in interface.
 * @return Generics type in interface implemented by a class type.
 * @throws NotFoundException
 */
public static JClassType getGenericsFromInterfaceType(JClassType classType, JClassType parametrizedType,
    int position) throws NotFoundException {
  JClassType type = getGenericsFromInterfaceHierarchy(classType, parametrizedType, position);
  if (type != null)
    return type;
  if (classType.getSuperclass() != null) {
    return getGenericsFromInterfaceType(classType.getSuperclass(), parametrizedType, position);
  }
  throw new NotFoundException("Unable to find generics in type " + classType
      + ", where parametrized type is " + parametrizedType + " on position " + position);
}
sk.seges.acris.core.rebindRebindUtilsgetGenericsFromInterfaceHierarchy

Javadoc

Tries to find parametrized type in interface hierarchy of a class.

Popular methods of RebindUtils

  • getGetter
  • getDeclaredFieldType
    Will it comment it aprox. 2 minutes before getDeclaredFieldClassType method
  • getGenericsFromInterfaceType
    Tries to find parametrized type in interface of a class.
  • getGenericsFromSuperclassType
    Same as getGenericsFromInterfaceType but it extracts generics from superclass
  • getGetterForMoreDotsInBeanTable
    recursively calls RebindUtils#getGetter(JClassType,String) to handle "more-dots strings" e.g.: addre
  • getSetter
  • getComparableMethodDeclaration
  • getDeclaredDirectField
    Searches class and all its superclasses for a field.
  • getDeclaredField
    Searches class and all its superclasses for a property.
  • getDeclaredFieldClassType
    Will it comment later :)
  • getterSetterDeterminator
    Example: for field street it will generate string Street used to construct getter/setter.
  • toFieldName
    Convert method getter/setter/isser to field name.
  • getterSetterDeterminator,
  • toFieldName

Popular in Java

  • Finding current android device location
  • scheduleAtFixedRate (ScheduledExecutorService)
  • getContentResolver (Context)
  • setScale (BigDecimal)
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • Time (java.sql)
    Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • StringTokenizer (java.util)
    Breaks a string into tokens; new code should probably use String#split.> // Legacy code: StringTo
  • Semaphore (java.util.concurrent)
    A counting semaphore. Conceptually, a semaphore maintains a set of permits. Each #acquire blocks if
  • Top plugins for Android Studio
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