Helper method to lookup a cell renderer based on type.

@param type the type for which a renderer should be found
@return a renderer for the given object type
553084
private TableCellRenderer getCellRenderer(Class<?> type) {
        // try to create one from the factory
        TableCellRenderer renderer = getRendererFactory().createTableCellRenderer(type);

        // if that fails, recursively try again with the superclass
        if (renderer == null && type != null) {
            renderer = getCellRenderer(type.getSuperclass());
        }

        // if that fails, just use the default Object renderer
        if (renderer == null) {
            renderer = super.getDefaultRenderer(Object.class);
        }

        return renderer;
    }
1182164
@Override
    public ContentSerializer getContentSerializerForContentType(String contentType) {
        for (ContentSerializer renderer : serializers) {
            if (renderer.getContentType().equals(contentType)) {
                return renderer;
            }
        }
        LoggerFactory.getLogger(this.getClass()).info("Cannot find a content renderer handling " + contentType);
        return null;
    }
872585
@SuppressWarnings("unchecked")
	public <T> Converter<T> getCustomConverter(Type type) {
		return (null == customConverterMap) ? null : (Converter<T>) customConverterMap.get(type);
	}
1349449
def render(self, type, rerender=False):
        """"""
        for child in self.children:
            child.render(type, rerender)
440006
public SerDeserializer findDeserializer(Class<?> type) {
        SerDeserializer deser = deserializers.get(type);
        if (deser != null) {
            return deser;
        }
        for (SerDeserializerProvider provider : providers) {
            deser = provider.findDeserializer(type);
            if (deser != null) {
                return deser;
            }
        }
        return defaultDeserializer;
    }
577639
public <T> Map<String, T> findByTypeWithName(Class<T> type) {
        return BeanFactoryUtils.beansOfTypeIncludingAncestors(applicationContext, type);
    }
1132727
private static Type processTypeForDescendantLookup(Type type) {
        if (type instanceof ParameterizedType) {
            return ((ParameterizedType) type).getRawType();
        } else {
            return type;
        }
    }
849244
Object resolveTypeReference(TypeMirror type) {
        Object result = Void.TYPE;
        if (type.getKind().isPrimitive()) {
            result = resolvePrimitiveTypeReference(type);
        } else if (type.getKind() == ARRAY) {
            ArrayType arrayType = (ArrayType) type;
            TypeMirror componentType = arrayType.getComponentType();
            if (componentType.getKind().isPrimitive()) {
                result = classOfPrimitiveArrayFor(resolvePrimitiveTypeReference(componentType).getName());
            } else {
                final TypeMirror erased = typeUtils.erasure(componentType);
                final Element e = typeUtils.asElement(erased);
                if (e instanceof TypeElement) {
                    result = resolveTypeReferenceForTypeElement((TypeElement) e) + "[]";
                }
            }
        } else if (type.getKind() != VOID && type.getKind() != ERROR) {
            final TypeMirror erased = typeUtils.erasure(type);
            final Element element = typeUtils.asElement(erased);
            if (element instanceof TypeElement) {
                TypeElement te = (TypeElement) element;
                result = resolveTypeReferenceForTypeElement(te);
            }
        }
        return result;
    }
277373
@Nullable static VariableElement findCreator(Elements elements, Types types, TypeMirror type) {
    if (type.getKind() != TypeKind.DECLARED) {
      return null;
    }
    DeclaredType declaredType = (DeclaredType) type;
    TypeElement typeElement = (TypeElement) declaredType.asElement();
    return findCreator(elements, types, typeElement);
  }
511028
public static String renderPackage(final Class<?> type) {
        return PACKAGE_FORMATTER.abbreviate(type.isMemberClass() && !type.isAnonymousClass()
                ? type.getDeclaringClass().getName() : type.getPackage().getName());
    }
603957
private Object lookUp(Class<?> type) {
        Jenkins j = Jenkins.getInstance();
        assert j != null : "This method is only invoked after the Jenkins singleton instance has been set";
        if (type==Jenkins.class || type==Hudson.class)
            return j;
        Injector i = j.getInjector();
        if (i!=null)
            return i.getInstance(type);
        throw new IllegalArgumentException("Unable to inject "+type);
    }
177970
public static Class<?> getClassFromType(final Type type) {
        Class<?> returnClass = null;
        if (type instanceof Class<?>) {
            returnClass = (Class<?>) type;
        } else if (type instanceof ParameterizedType) {
            returnClass = getClassFromType(((ParameterizedType) type).getRawType());
        }
        return returnClass;
    }
325393
function renderTypeFun(obj) {
    if (!this.isGridShow()) return;
    if (typeof obj == 'undefined') {
        var begin = null,
            length = null,
            field = '';
    } else {
        var begin = typeof obj.begin == 'undefined' ? null : obj.begin,
            length = typeof obj.length == 'undefined' ? null : obj.length,
            field = typeof obj.field == 'undefined' ? '' : obj.field;
    }
    var oThis = this,
        begin = parseInt(begin),
        length = parseInt(length),
        end = begin;
    if (length > 0) {
        end = parseInt(begin + length - 1);
    }
    if (field == '') {
        if (this.gridCompColumnFixedArr) $.each(this.gridCompColumnFixedArr, function (i) {
            oThis.renderTypeByColumn(this, i, begin, length, true);
        });
        $.each(this.gridCompColumnArr, function (i) {
            oThis.renderTypeByColumn(this, i, begin, length, false);
        });
    } else {
        var rendered = false;
        if (this.gridCompColumnFixedArr) $.each(this.gridCompColumnFixedArr, function (i) {
            if (this.options.field == field) {
                oThis.renderTypeByColumn(this, i, begin, length, true);
                rendered = true;
                return;
            }
        });
        if (!rendered) $.each(this.gridCompColumnArr, function (i) {
            if (this.options.field == field) {
                oThis.renderTypeByColumn(this, i, begin, length, false);
                return;
            }
        });
    }
}
919562
public RendererBuilder<T> withPrototype(Renderer<? extends T> renderer) {
    if (renderer == null) {
      throw new NeedsPrototypesException(
          "RendererBuilder can't use a null Renderer<T> instance as prototype");
    }
    this.prototypes.add(renderer);
    return this;
  }
1057430
public static TypeMirror getApplicationSupertype(TypeElement type) {
    TypeMirror supertype = type.getSuperclass();
    return Keys.isPlatformType(supertype.toString()) ? null : supertype;
  }
901620
public static @CheckForNull <T> T lookup(Class<T> type) {
        Jenkins j = Jenkins.getInstanceOrNull();
        return j != null ? j.lookup.get(type) : null;
    }
918887
@CheckForNull
    public Descriptor getDescriptor(Class<? extends Describable> type) {
        for( Descriptor d : getExtensionList(Descriptor.class) )
            if(d.clazz==type)
                return d;
        return null;
    }