Tabnine Logo
Class.isLocalClass
Code IndexAdd Tabnine to your IDE (free)

How to use
isLocalClass
method
in
java.lang.Class

Best Java code snippets using java.lang.Class.isLocalClass (Showing top 20 results out of 1,692)

origin: redisson/redisson

/**
 * {@inheritDoc}
 */
public boolean isLocalType() {
  return type.isLocalClass();
}
origin: spring-projects/spring-loaded

public static boolean callIsLocalClass(Class thiz)
{
  return thiz.isLocalClass();
}
origin: google/guava

 @Override
 @Nullable
 Class<?> getOwnerType(Class<?> rawType) {
  if (rawType.isLocalClass()) {
   return null;
  } else {
   return rawType.getEnclosingClass();
  }
 }
};
origin: org.mockito/mockito-core

private void checkNotLocal(Field field) {
  if(field.getType().isLocalClass()) {
    throw new MockitoException("the type '" + field.getType().getSimpleName() + "' is a local class.");
  }
}
origin: prestodb/presto

 @NullableDecl
 @Override
 Class<?> getOwnerType(Class<?> rawType) {
  if (rawType.isLocalClass()) {
   return null;
  } else {
   return rawType.getEnclosingClass();
  }
 }
};
origin: jdbi/jdbi

  @Nullable
  @Override
  Class<?> getOwnerType(Class<?> rawType) {
    if (rawType.isLocalClass()) {
      return null;
    } else {
      return rawType.getEnclosingClass();
    }
  }
};
origin: google/j2objc

 @Override
 @NullableDecl
 Class<?> getOwnerType(Class<?> rawType) {
  if (rawType.isLocalClass()) {
   return null;
  } else {
   return rawType.getEnclosingClass();
  }
 }
};
origin: google/j2objc

private void checkNotLocal(Field field) {
  if(field.getType().isLocalClass()) {
    throw new MockitoException("the type '" + field.getType().getSimpleName() + "' is a local class.");
  }
}
origin: kiegroup/optaplanner

public static <T> T newInstance(Object bean, String propertyName, Class<T> clazz) {
  try {
    return clazz.newInstance();
  } catch (InstantiationException | IllegalAccessException e) {
    throw new IllegalArgumentException("The " + bean.getClass().getSimpleName() + "'s " + propertyName + " ("
        + clazz.getName() + ") does not have a public no-arg constructor"
        // Inner classes include local, anonymous and non-static member classes
        + ((clazz.isLocalClass() || clazz.isAnonymousClass() || clazz.isMemberClass())
        && !Modifier.isStatic(clazz.getModifiers()) ? " because it is an inner class." : "."), e);
  }
}
origin: wildfly/wildfly

 @NullableDecl
 @Override
 Class<?> getOwnerType(Class<?> rawType) {
  if (rawType.isLocalClass()) {
   return null;
  } else {
   return rawType.getEnclosingClass();
  }
 }
};
origin: jersey/jersey

/**
 * Check if the class is acceptable as a JAX-RS provider or resource.
 * <p/>
 * Method returns {@code false} if the class is either
 * <ul>
 * <li>abstract</li>
 * <li>interface</li>
 * <li>annotation</li>
 * <li>primitive</li>
 * <li>local class</li>
 * <li>non-static member class</li>
 * </ul>
 *
 * @param c class to be checked.
 * @return {@code true} if the class is an acceptable JAX-RS provider or
 * resource, {@code false} otherwise.
 */
public static boolean isAcceptable(Class<?> c) {
  return !((c.getModifiers() & Modifier.ABSTRACT) != 0
           || c.isPrimitive()
           || c.isAnnotation()
           || c.isInterface()
           || c.isLocalClass()
           || (c.isMemberClass() && (c.getModifiers() & Modifier.STATIC) == 0));
}
origin: jersey/jersey

/**
 * Check if the class is acceptable as a JAX-RS provider or resource.
 * <p/>
 * Method returns {@code false} if the class is either
 * <ul>
 * <li>abstract</li>
 * <li>interface</li>
 * <li>annotation</li>
 * <li>primitive</li>
 * <li>local class</li>
 * <li>non-static member class</li>
 * </ul>
 *
 * @param c class to be checked.
 * @return {@code true} if the class is an acceptable JAX-RS provider or
 * resource, {@code false} otherwise.
 */
public static boolean isAcceptable(Class<?> c) {
  return !((c.getModifiers() & Modifier.ABSTRACT) != 0
           || c.isPrimitive()
           || c.isAnnotation()
           || c.isInterface()
           || c.isLocalClass()
           || (c.isMemberClass() && (c.getModifiers() & Modifier.STATIC) == 0));
}
origin: wildfly/wildfly

private Class<?> checkSecurity(Class<?> clazz) throws ClassNotFoundException {
 Class<?> target = clazz;
 while (target.isArray()) {
   target = target.getComponentType();
 }
 while (target.isAnonymousClass() || target.isLocalClass()) {
   target = target.getEnclosingClass();
 }
 if (!target.isPrimitive()) {
   if (!isTrustedType(target)) {
    throw new ClassNotFoundException("Forbidden " + clazz + "! " +
                      "This class is not trusted to be deserialized under the current configuration. " +
                      "Please refer to the documentation for more information on how to configure trusted classes.");
   }
 }
 return clazz;
}
origin: openzipkin/brave

/** Validating instance creator that ensures the supplier type is static or top-level */
public static <T> T newInstance(Class<T> type, ClassLoader loader) {
 assertThat(type)
   .withFailMessage(type + " should be a static member class")
   .satisfies(c -> {
    assertThat(c.isLocalClass()).isFalse();
    assertThat(Modifier.isPublic(c.getModifiers())).isFalse();
   });
 try {
  Class<T> classToInstantiate = (Class<T>) loader.loadClass(type.getName());
  Constructor<T> ctor = classToInstantiate.getDeclaredConstructor();
  ctor.setAccessible(true);
  return ctor.newInstance();
 } catch (ReflectiveOperationException e) {
  throw new IllegalStateException(e);
 }
}
origin: oldmanpushcart/greys-anatomy

/**
 * 计算ClassType
 *
 * @param targetClass 目标类
 * @return 计算出的ClassType
 */
public static int computeClassType(Class<?> targetClass) {
  int type = 0;
  if (targetClass.isAnnotation())
    type |= TYPE_ANNOTATION;
  if (targetClass.isAnonymousClass())
    type |= TYPE_ANONYMOUS;
  if (targetClass.isArray())
    type |= TYPE_ARRAY;
  if (targetClass.isEnum())
    type |= TYPE_ENUM;
  if (targetClass.isInterface())
    type |= TYPE_INTERFACE;
  if (targetClass.isLocalClass())
    type |= TYPE_LOCAL;
  if (targetClass.isMemberClass())
    type |= TYPE_MEMBER;
  if (targetClass.isPrimitive())
    type |= TYPE_PRIMITIVE;
  if (targetClass.isSynthetic())
    type |= TYPE_SYNTHETIC;
  return type;
}
origin: square/moshi

 throw new IllegalArgumentException("Cannot serialize anonymous class " + rawType.getName());
if (rawType.isLocalClass()) {
 throw new IllegalArgumentException("Cannot serialize local class " + rawType.getName());
origin: org.junit.jupiter/junit-jupiter-engine

@Override
public boolean test(Class<?> candidate) {
  // Please do not collapse the following into a single statement.
  if (isPrivate(candidate)) {
    return false;
  }
  if (isAbstract(candidate)) {
    return false;
  }
  if (candidate.isLocalClass()) {
    return false;
  }
  if (candidate.isAnonymousClass()) {
    return false;
  }
  return !isInnerClass(candidate);
}
origin: redisson/redisson

private <T> void validateClass(Class<T> entityClass) {
  if (entityClass.isAnonymousClass() || entityClass.isLocalClass()) {
    throw new IllegalArgumentException(entityClass.getName() + " is not publically accessable.");
origin: redisson/redisson

private <T> void validateClass(Class<T> entityClass) {
  if (entityClass.isAnonymousClass() || entityClass.isLocalClass()) {
    throw new IllegalArgumentException(entityClass.getName() + " is not publically accessable.");
origin: oldmanpushcart/greys-anatomy

private String drawClassInfo() {
  final CodeSource cs = clazz.getProtectionDomain().getCodeSource();
  final TTable tTable = new TTable(new TTable.ColumnDefine[]{
      new TTable.ColumnDefine(50, TTable.Align.RIGHT),
      new TTable.ColumnDefine(80, TTable.Align.LEFT)
  })
      .addRow("class-info", tranClassName(clazz))
      .addRow("code-source", getCodeSource(cs))
      .addRow("name", tranClassName(clazz))
      .addRow("isInterface", clazz.isInterface())
      .addRow("isAnnotation", clazz.isAnnotation())
      .addRow("isEnum", clazz.isEnum())
      .addRow("isAnonymousClass", clazz.isAnonymousClass())
      .addRow("isArray", clazz.isArray())
      .addRow("isLocalClass", clazz.isLocalClass())
      .addRow("isMemberClass", clazz.isMemberClass())
      .addRow("isPrimitive", clazz.isPrimitive())
      .addRow("isSynthetic", clazz.isSynthetic())
      .addRow("simple-name", clazz.getSimpleName())
      .addRow("modifier", tranModifier(clazz.getModifiers()))
      .addRow("annotation", drawAnnotation())
      .addRow("interfaces", drawInterface())
      .addRow("super-class", drawSuperClass())
      .addRow("class-loader", drawClassLoader());
  if (isPrintField) {
    tTable.addRow("fields", drawField());
  }
  return tTable.padding(1).rendering();
}
java.langClassisLocalClass

Javadoc

Tests whether the class represented by this Class is defined locally.

Popular methods of Class

  • getName
    Returns the name of the class represented by this Class. For a description of the format which is us
  • getSimpleName
  • getClassLoader
  • isAssignableFrom
    Determines if the class or interface represented by this Class object is either the same as, or is a
  • forName
    Returns the Class object associated with the class or interface with the given string name, using th
  • newInstance
    Returns a new instance of the class represented by this Class, created by invoking the default (that
  • getMethod
    Returns a Method object that reflects the specified public member method of the class or interface r
  • getResourceAsStream
  • getSuperclass
    Returns the Class representing the superclass of the entity (class, interface, primitive type or voi
  • getConstructor
  • cast
    Casts an object to the class or interface represented by this Class object.
  • isInstance
  • cast,
  • isInstance,
  • getCanonicalName,
  • getDeclaredField,
  • isArray,
  • getAnnotation,
  • getDeclaredFields,
  • getResource,
  • getDeclaredMethod,
  • getMethods

Popular in Java

  • Making http post requests using okhttp
  • scheduleAtFixedRate (Timer)
  • notifyDataSetChanged (ArrayAdapter)
  • getSharedPreferences (Context)
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • Socket (java.net)
    Provides a client-side TCP socket.
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • JFileChooser (javax.swing)
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
  • Top plugins for WebStorm
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