/** Returns the simple name of this class */ @NonNull public String getSimpleName() { // This doesn't handle inner classes properly, so subclasses with more // accurate type information will override to handle it correctly. String name = getName(); int index = name.lastIndexOf('.'); if (index != -1) { return name.substring(index + 1); } return name; }
TypeDescriptor parameterType = context.getType(first); if (parameterType != null) { specifiesLocale = isLocaleReference(parameterType.getName()); } else if (!call.astName().astValue().equals(FORMAT_METHOD)) { specifiesLocale = false;
@NonNull public TypeReference getNode() { TypeReference typeReference = new TypeReference(); StrictListAccessor<TypeReferencePart, TypeReference> parts = typeReference.astParts(); for (String part : Splitter.on('.').split(getName())) { Identifier identifier = Identifier.of(part); parts.addToEnd(new TypeReferencePart().astIdentifier(identifier)); } return typeReference; }
private static boolean isLocaleReference(@Nullable TypeDescriptor reference) { return reference != null && isLocaleReference(reference.getName()); }
private static Class<?> getTypeClass(@Nullable TypeDescriptor type) { if (type != null) { return getTypeClass(type.getName()); } return null; }
/** * Computes the internal class name of the given fully qualified class name. * For example, it converts foo.bar.Foo.Bar into foo/bar/Foo$Bar. * This should only be called for class types, not primitives. * * @return the internal class name */ @NonNull public String getInternalName() { return ClassContext.getInternalName(getName()); }
@Override public String toString() { return getName(); } }
private static boolean overridesIsValidFragment(ResolvedClass resolvedClass) { Iterable<ResolvedMethod> resolvedMethods = resolvedClass.getMethods(IS_VALID_FRAGMENT, false); for (ResolvedMethod resolvedMethod : resolvedMethods) { if (resolvedMethod.getArgumentCount() == 1 && resolvedMethod.getArgumentType(0).getName().equals(TYPE_STRING)) { return true; } } return false; } }