Gets the best suited {@link Renderer} for the given {@link Renderable} to
the given {@link RenderingFormat}.

@param <I>
@param <O>
@param renderable
@param renderingFormat
@return
482482
public <I extends Renderable, O> Renderer<? super I, ? extends O> getRenderer(final I renderable,
            final Class<? extends RenderingFormat<? extends O>> renderingFormat) {

        RendererSelection bestMatch = null;

        final Collection<RendererBeanDescriptor<?>> descriptors =
                _descriptorProvider.getRendererBeanDescriptorsForRenderingFormat(renderingFormat);
        for (final RendererBeanDescriptor<?> descriptor : descriptors) {
            final RendererSelection rendererMatch = isRendererMatch(descriptor, renderable, bestMatch);
            if (rendererMatch != null) {
                bestMatch = rendererMatch;
            }
        }

        if (bestMatch == null) {
            logger.warn("Didn't find any matches for renderable {} (format={})", renderable, renderingFormat);
            return null;
        }

        @SuppressWarnings("unchecked") final Renderer<? super I, ? extends O> renderer =
                (Renderer<? super I, ? extends O>) bestMatch.getRenderer();

        if (logger.isInfoEnabled()) {
            logger.info("Returning renderer '{}' for renderable '{}' in format '{}'",
                    new Object[] { renderer, renderable.getClass().getName(), renderingFormat.getName() });
        }

        return renderer;
    }
564034
function (renderables) {
                if (!renderables) {
                    throw new ArgumentError(
                        Logger.logMessage(Logger.LEVEL_SEVERE, "WktExporter", "exportRenderables",
                            "missingRenderables"));
                }

                if (renderables.length == 0) {
                    return;
                }

                if (renderables.length > 1) {
                    var sb = WktType.SupportedGeometries.GEOMETRY_COLLECTION + '(';

                    for (var i = 0; i < renderables.length; i++) {
                        var exportedRenderable = this.exportRenderable(renderables[i]);

                        if (exportedRenderable) {
                            sb = sb + exportedRenderable;
                            sb = sb + ',';
                        }
                    }
                    sb = sb.substring(0, sb.length - 1);
                    sb = sb + ')';

                    return sb;
                }
                else {
                    return this.exportRenderable(renderables[0]);
                }
            }
415306
public List<FacesConfigRendererType<FacesConfigRenderKitType<T>>> getAllRenderer()
   {
      List<FacesConfigRendererType<FacesConfigRenderKitType<T>>> list = new ArrayList<FacesConfigRendererType<FacesConfigRenderKitType<T>>>();
      List<Node> nodeList = childNode.get("renderer");
      for(Node node: nodeList)
      {
         FacesConfigRendererType<FacesConfigRenderKitType<T>>  type = new FacesConfigRendererTypeImpl<FacesConfigRenderKitType<T>>(this, "renderer", childNode, node);
         list.add(type);
      }
      return list;
   }
322029
protected RenderVisitor createHelperInstance(Appendable outputBuf, SoyRecord data) {
    return new RenderVisitor(
        evalVisitorFactory,
        outputBuf,
        basicTemplates,
        deltemplates,
        data,
        ijData,
        activeDelPackageSelector,
        msgBundle,
        xidRenamingMap,
        cssRenamingMap,
        debugSoyTemplateInfo,
        pluginInstances);
  }
1294262
public RequestContext renderPretty() {
        if (renderer instanceof JsonRenderer) {
            final JsonRenderer r = (JsonRenderer) renderer;
            r.setPretty(true);
        }

        return this;
    }
1317373
function Renderer(options) {
  options = options || {};
  this.MD   = new MDRenderer(options);
  this.CGMD = new CGMDRenderer(new MDRenderer(options));

  return this;
}
328393
public static synchronized RenderEngine getInstance(String name) {
    if (null == availableEngines) {
      availableEngines = new HashMap();
    }

    //Logger.debug("Engines: " + availableEngines);
    return (RenderEngine) availableEngines.get(name);
  }
1290717
public static void checkDepthOnlyRenderableTexture2D(
    final JCGLTextureFormat t)
    throws JCGLExceptionFormatError
  {
    if (!isDepthRenderable(t)) {
      final String m =
        String.format("Format %s is not depth-renderable", t);
      assert m != null;
      throw new JCGLExceptionFormatError(m);
    }

    if (isStencilRenderable(t)) {
      final String m = String.format(
        "Format %s is stencil-renderable: Must be used as a depth+stencil "
          + "attachment",
        t);
      assert m != null;
      throw new JCGLExceptionFormatError(m);
    }
  }
619040
@Override
	protected BundleRenderer createRenderer(ResourceBundlesHandler rsHandler,
			Boolean useRandomParam, ComponentTag tag) {
		
		final IValueMap attributes = tag.getAttributes();
		boolean async = attributes.getBoolean(JawrConstant.ASYNC_ATTR);
		boolean defer = attributes.getBoolean(JawrConstant.DEFER_ATTR);
        String type = attributes.getString(JawrConstant.TYPE_ATTR);
        String crossorigin = attributes.getString(JawrConstant.CROSSORIGIN_ATTR);
		return RendererFactory.getJsBundleRenderer(rsHandler, type, useRandomParam, async, defer, crossorigin);
	}
106878
protected void renderCaptionFacet(FacesContext facesContext, ResponseWriter writer, UIComponent component)
            throws IOException
    {
        HtmlRendererUtils.renderTableCaption(facesContext, writer, component);
    }
668221
def select_renderer(self, request, renderers, format_suffix=None):
        
        # Allow URL style format override.  eg. "?format=json
        format_query_param = self.settings.URL_FORMAT_OVERRIDE
        format = format_suffix or request.query_params.get(format_query_param)

        if format:
            renderers = self.filter_renderers(renderers, format)

        accepts = self.get_accept_list(request)

        # Check the acceptable media types against each renderer,
        # attempting more specific media types first
        # NB. The inner loop here isn't as bad as it first looks :)
        #     Worst case is we're looping over len(accept_list) * len(self.renderers)
        for media_type_set in order_by_precedence(accepts):
            for renderer in renderers:
                for media_type in media_type_set:
                    if media_type_matches(renderer.media_type, media_type):
                        # Return the most specific media type as accepted.
                        media_type_wrapper = _MediaType(media_type)
                        if (
                            _MediaType(renderer.media_type).precedence >
                            media_type_wrapper.precedence
                        ):
                            # Eg client requests '*/*'
                            # Accepted media type is 'application/json'
                            full_media_type = ';'.join(
                                (renderer.media_type,) +
                                tuple('{0}={1}'.format(
                                    key, value.decode(HTTP_HEADER_ENCODING))
                                    for key, value in media_type_wrapper.params.items()))
                            return renderer, full_media_type
                        else:
                            # Eg client requests 'application/json; indent=8'
                            # Accepted media type is 'application/json; indent=8'
                            return renderer, media_type

        raise exceptions.NotAcceptable(available_renderers=renderers)
210211
function (renderable) {
                if (!(renderable instanceof WorldWind.Path)) {
                    throw new ArgumentError(
                        Logger.logMessage(Logger.LEVEL_SEVERE, "GeoJSONExporter", "exportPath",
                            "invalidTypeOfRenderable"));
                }

                var sb = '{';
                sb = sb + '"' + GeoJSONConstants.FIELD_TYPE + '":"' + GeoJSONConstants.TYPE_LINE_STRING + '",';
                sb = sb + '"' + GeoJSONConstants.FIELD_COORDINATES + '":[';
                for (var i = 0; i < renderable.positions.length; i++) {
                    sb = sb + '[' + renderable.positions[i].longitude + ',' +
                        renderable.positions[i].latitude + ',' +
                        renderable.positions[i].altitude + ']';
                    if (i !== renderable.positions.length - 1) {
                        sb = sb + ',';
                    }
                }
                sb = sb + ']';
                sb = sb + '}';
                return sb;
            }
300636
protected ResourceFormatParser getResourceFormatParser() throws ResourceModelSourceException {
        try {
            String format = getResourceFormat();
            if (null != format) {
                return framework.getResourceFormatParserService()
                                .getParserForFormat(format);
            } else {
                return framework.getResourceFormatParserService()
                                .getParserForFileExtension(getDocumentFileExtension());
            }
        } catch (UnsupportedFormatException e) {
            throw new ResourceModelSourceException(e);
        }
    }
197204
function (renderable) {
                if (!(renderable instanceof WorldWind.SurfacePolygon)) {
                    throw new ArgumentError(
                        Logger.logMessage(Logger.LEVEL_SEVERE, "GeoJSONExporter", "exportSurfacePolygon",
                            "invalidTypeOfRenderable"));
                }

                var sb = '{';
                sb = sb + '"' + GeoJSONConstants.FIELD_TYPE + '":"' + GeoJSONConstants.TYPE_POLYGON + '",';
                sb = sb + '"' + GeoJSONConstants.FIELD_COORDINATES + '":[';
                if (renderable.boundaries.length > 0 && renderable.boundaries[0].length > 2) {
                    //with holes
                    for (var i = 0; i < renderable.boundaries.length; i++) {
                        sb = sb + '[';
                        for (var j = 0; j < renderable.boundaries[i].length; j++) {
                            sb = sb + '[' + renderable.boundaries[i][j].longitude + ',' +
                                renderable.boundaries[i][j].latitude + ']';
                            sb = sb + ',';

                            if (j === renderable.boundaries[i].length - 1) {
                                sb = sb + '[' + renderable.boundaries[i][0].longitude + ',' +
                                    renderable.boundaries[i][0].latitude + ']';
                            }
                        }
                        sb = sb + ']';
                        if (i !== renderable.boundaries.length - 1) {
                            sb = sb + ',';
                        }
                    }
                }
                else {
                    //no holes
                    sb = sb + '[';
                    for (var i = 0; i < renderable.boundaries.length; i++) {
                        sb = sb + '[' + renderable.boundaries[i].longitude + ',' +
                            renderable.boundaries[i].latitude + ']';
                        sb = sb + ',';

                        if (i === renderable.boundaries.length - 1) {
                            sb = sb + '[' + renderable.boundaries[0].longitude + ',' +
                                renderable.boundaries[0].latitude + ']';
                        }
                    }
                    sb = sb + ']';
                }
                sb = sb + ']';
                sb = sb + '}';
                return sb;
            }
590145
private MalisisRenderer<?> getRenderer(Class<? extends MalisisRenderer<?>> clazz) throws InstantiationException, IllegalAccessException
	{
		if (clazz == DefaultRenderer.Block.class)
			return DefaultRenderer.block;
		else if (clazz == DefaultRenderer.Block.class)
			return DefaultRenderer.item;
		else if (clazz == DefaultRenderer.Null.class)
			return DefaultRenderer.nullRender;

		MalisisRenderer<?> renderer = registeredRenderers.get(clazz);
		if (renderer == null)
		{
			renderer = clazz.newInstance();
			registeredRenderers.put(clazz, renderer);
		}

		return renderer;
	}
1287068
public static <R extends Renderer<?, ?>> RendererBeanDescriptor<R> ofRenderer(final Class<R> rendererClass) {
        return new AnnotationBasedRendererBeanDescriptor<>(rendererClass);
    }
501209
def GetRendererForValueOrClass(cls, value, limit_lists=-1):
    """"""

    if inspect.isclass(value):
      value_cls = value
    else:
      value_cls = value.__class__

    cache_key = "%s_%d" % (value_cls.__name__, limit_lists)
    try:
      renderer_cls = cls._renderers_cache[cache_key]
    except KeyError:
      candidates = []
      for candidate in itervalues(ApiValueRenderer.classes):
        if candidate.value_class:
          candidate_class = candidate.value_class
        else:
          continue

        if inspect.isclass(value):
          if issubclass(value_cls, candidate_class):
            candidates.append((candidate, candidate_class))
        else:
          if isinstance(value, candidate_class):
            candidates.append((candidate, candidate_class))

      if not candidates:
        raise RuntimeError(
            "No renderer found for value %s." % value.__class__.__name__)

      candidates = sorted(
          candidates, key=lambda candidate: len(candidate[1].mro()))
      renderer_cls = candidates[-1][0]
      cls._renderers_cache[cache_key] = renderer_cls

    return renderer_cls(limit_lists=limit_lists)