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

How to use
getCanonicalName
method
in
java.lang.Class

Best Java code snippets using java.lang.Class.getCanonicalName (Showing top 20 results out of 45,252)

origin: apache/incubator-dubbo

public static boolean isExcludedInterface(Class<?> clazz) {
  if (includedInterfacePackages == null || includedInterfacePackages.length == 0) {
    return false;
  }
  for (String packagePrefix : includedInterfacePackages) {
    if (clazz.getCanonicalName().startsWith(packagePrefix)) {
      return false;
    }
  }
  return true;
}
origin: apache/incubator-dubbo

public static boolean isExcludedInterface(Class<?> clazz) {
  if (includedInterfacePackages == null || includedInterfacePackages.length == 0) {
    return false;
  }
  for (String packagePrefix : includedInterfacePackages) {
    if (clazz.getCanonicalName().startsWith(packagePrefix)) {
      return false;
    }
  }
  return true;
}
origin: apache/incubator-dubbo

public static boolean isExcludedType(Class<?> clazz) {
  if (includedTypePackages == null || includedTypePackages.length == 0) {
    return false;
  }
  for (String packagePrefix : includedTypePackages) {
    if (clazz.getCanonicalName().startsWith(packagePrefix)) {
      return false;
    }
  }
  return true;
}
origin: apache/incubator-dubbo

public static boolean isExcludedType(Class<?> clazz) {
  if (includedTypePackages == null || includedTypePackages.length == 0) {
    return false;
  }
  for (String packagePrefix : includedTypePackages) {
    if (clazz.getCanonicalName().startsWith(packagePrefix)) {
      return false;
    }
  }
  return true;
}
origin: JakeWharton/butterknife

private static @Nullable AnnotationMirror getMirror(Element element,
  Class<? extends Annotation> annotation) {
 for (AnnotationMirror annotationMirror : element.getAnnotationMirrors()) {
  if (annotationMirror.getAnnotationType().toString().equals(annotation.getCanonicalName())) {
   return annotationMirror;
  }
 }
 return null;
}
origin: apache/incubator-dubbo

public static boolean needAnalyzing(Class<?> clazz) {
  String canonicalName = clazz.getCanonicalName();
  if (closedTypes != null && closedTypes.length > 0) {
    for (String type : closedTypes) {
      if (canonicalName.startsWith(type)) {
        return false;
      }
    }
  }
  return !isExcludedType(clazz);
}
origin: apache/incubator-dubbo

public static boolean needAnalyzing(Class<?> clazz) {
  String canonicalName = clazz.getCanonicalName();
  if (closedTypes != null && closedTypes.length > 0) {
    for (String type : closedTypes) {
      if (canonicalName.startsWith(type)) {
        return false;
      }
    }
  }
  return !isExcludedType(clazz);
}
origin: JakeWharton/butterknife

@Override public Set<String> getSupportedAnnotationTypes() {
 Set<String> types = new LinkedHashSet<>();
 for (Class<? extends Annotation> annotation : getSupportedAnnotations()) {
  types.add(annotation.getCanonicalName());
 }
 return types;
}
origin: androidannotations/androidannotations

public static void assertClassSourcesGeneratedToOutput(Class<?> clazz) {
  String canonicalName = clazz.getCanonicalName();
  String filePath = canonicalName.replace(".", "/").concat(".java");
  File generatedSourcesDir = new File(OUTPUT_DIRECTORY);
  File generatedSourceFile = new File(generatedSourcesDir, filePath);
  File sourcesDir = new File(MAIN_SOURCE_FOLDER);
  File expectedResult = new File(sourcesDir, filePath);
  assertOutput(expectedResult, generatedSourceFile);
}
origin: androidannotations/androidannotations

public static void assertClassSourcesNotGeneratedToOutput(Class<?> clazz) {
  String canonicalName = clazz.getCanonicalName();
  String filePath = canonicalName.replace(".", "/").concat(".java");
  File generatedSourcesDir = new File(OUTPUT_DIRECTORY);
  File output = new File(generatedSourcesDir, filePath);
  assertFalse(output.exists());
}
origin: androidannotations/androidannotations

public AbstractJClass refClass(Class<?> clazz) {
  AbstractJClass referencedClass = codeModel.ref(clazz);
  loadedClasses.put(clazz.getCanonicalName(), referencedClass);
  return referencedClass;
}
origin: apache/incubator-dubbo

@Override
public TypeDefinition build(Type type, Class<?> clazz, Map<Class<?>, TypeDefinition> typeCache) {
  // Process the component type of an array.
  Class<?> componentType = clazz.getComponentType();
  TypeDefinitionBuilder.build(componentType, componentType, typeCache);
  final String canonicalName = clazz.getCanonicalName();
  return new TypeDefinition(canonicalName);
}
origin: apache/incubator-dubbo

@Override
public TypeDefinition build(Type type, Class<?> clazz, Map<Class<?>, TypeDefinition> typeCache) {
  // Process the component type of an array.
  Class<?> componentType = clazz.getComponentType();
  TypeDefinitionBuilder.build(componentType, componentType, typeCache);
  final String canonicalName = clazz.getCanonicalName();
  return new TypeDefinition(canonicalName);
}
origin: iluwatar/java-design-patterns

 @Override
 public String toString() {
  return getDeclaringClass().getCanonicalName() + "@" + hashCode();
 }
}
origin: apache/incubator-dubbo

@Override
public TypeDefinition build(Type type, Class<?> clazz, Map<Class<?>, TypeDefinition> typeCache) {
  TypeDefinition td = new TypeDefinition(clazz.getCanonicalName());
  try {
    Method methodValues = clazz.getDeclaredMethod("values", new Class<?>[0]);
    Object[] values = (Object[]) methodValues.invoke(clazz, new Object[0]);
    int length = values.length;
    for (int i = 0; i < length; i++) {
      Object value = values[i];
      td.getEnums().add(value.toString());
    }
  } catch (Throwable t) {
    td.setId("-1");
  }
  typeCache.put(clazz, td);
  return td;
}
origin: apache/incubator-dubbo

@Override
public TypeDefinition build(Type type, Class<?> clazz, Map<Class<?>, TypeDefinition> typeCache) {
  TypeDefinition td = new TypeDefinition(clazz.getCanonicalName());
  try {
    Method methodValues = clazz.getDeclaredMethod("values", new Class<?>[0]);
    Object[] values = (Object[]) methodValues.invoke(clazz, new Object[0]);
    int length = values.length;
    for (int i = 0; i < length; i++) {
      Object value = values[i];
      td.getEnums().add(value.toString());
    }
  } catch (Throwable t) {
    td.setId("-1");
  }
  typeCache.put(clazz, td);
  return td;
}
origin: org.mockito/mockito-core

public <T> T mock(Class<T> typeToMock, MockSettings settings) {
  if (!MockSettingsImpl.class.isInstance(settings)) {
    throw new IllegalArgumentException("Unexpected implementation of '" + settings.getClass().getCanonicalName() + "'\n" + "At the moment, you cannot provide your own implementations of that class.");
  }
  MockSettingsImpl impl = MockSettingsImpl.class.cast(settings);
  MockCreationSettings<T> creationSettings = impl.build(typeToMock);
  T mock = createMock(creationSettings);
  mockingProgress().mockingStarted(mock, creationSettings);
  return mock;
}
origin: ch.qos.logback/logback-classic

@Override
public void contextDestroyed(ServletContextEvent sce) {
  ILoggerFactory iLoggerFactory = LoggerFactory.getILoggerFactory();
  if (iLoggerFactory instanceof LoggerContext) {
    LoggerContext loggerContext = (LoggerContext) iLoggerFactory;
    contextAwareBase.setContext(loggerContext);
    StatusViaSLF4JLoggerFactory.addInfo("About to stop " + loggerContext.getClass().getCanonicalName() + " [" + loggerContext.getName() + "]", this);
    loggerContext.stop();
  }
}
origin: org.mockito/mockito-core

public static MockitoException cannotInjectDependency(Field field, Object matchingMock, Exception details) {
  return new MockitoException(join(
      "Mockito couldn't inject mock dependency '" + MockUtil.getMockName(matchingMock) + "' on field ",
      "'" + field + "'",
      "whose type '" + field.getDeclaringClass().getCanonicalName() + "' was annotated by @InjectMocks in your test.",
      "Also I failed because: " + exceptionCauseMessageIfAvailable(details),
      ""
  ), details);
}
origin: org.mockito/mockito-core

private GenericMetadataSupport resolveGenericType(Type type, Method method) {
  if (type instanceof Class) {
    return new NotGenericReturnTypeSupport(this, type);
  }
  if (type instanceof ParameterizedType) {
    return new ParameterizedReturnType(this, method.getTypeParameters(), (ParameterizedType) type);
  }
  if (type instanceof TypeVariable) {
    return new TypeVariableReturnType(this, method.getTypeParameters(), (TypeVariable<?>) type);
  }
  throw new MockitoException("Ouch, it shouldn't happen, type '" + type.getClass().getCanonicalName() + "' on method : '" + method.toGenericString() + "' is not supported : " + type);
}
java.langClassgetCanonicalName

Javadoc

Returns the canonical name of this class. If this class does not have a canonical name as defined in the Java Language Specification, then the method returns null.

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
    Finds a resource with a given name. The rules for searching resources associated with a given class
  • 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,
  • 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
  • From CI to AI: The AI layer in your organization
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