Gets the appropriate render object for the given format
@param FormatInterface $format

@throws \Exception
@return RendererInterface
968594
public function resolve(FormatInterface $format)
    {
        foreach ($this->renderers as $render) {

            if ($render->getFormat() === $format->getName()) {
                return $render;
            }
        }

        throw new \Exception('Render not found');
    }
942612
public function format($format = null)
    {
        if ($format !== null) {
            $this->format = $format;
        }

        return $this->format;
    }
240340
protected static function createFormatter( $format )
    {
        $formatterOptions = new ezpExtensionOptions();
        $formatterOptions->iniFile = 'template.ini';
        $formatterOptions->iniSection = 'AttributeOperator';
        $formatterOptions->iniVariable = 'OutputFormatter';
        $formatterOptions->handlerIndex = $format;

        $formatterInstance = eZExtension::getHandlerClass( $formatterOptions );

        if ( !( $formatterInstance instanceof ezpAttributeOperatorFormatterInterface ) )
            eZDebug::writeError( "Undefined output formatter for '{$format}'", __METHOD__ );

        return $formatterInstance;
    }
399536
public function render(RendererInterface $renderer = null)
    {
        $renderer = $renderer ?: $this->getDefaultRenderer();
        $form = $this->header();
        foreach ($this->rows as $row) {
            $form .= $row->render($renderer);
        }
        $form .= '</form>';

        return $form;
    }
285980
public function out($format = null)
    {
        if (0 == count($this->url)) {
            throw new Exception('No URL is set');
        }
        if (! is_null($format)) {
            $this->format($format);
        }
        if (is_null($this->response)) {
            $this->call();
        }

        return $this->parseResponse();
    }
1109819
private function getEncoder(string $format, array $context): EncoderInterface
    {
        if (isset($this->encoderByFormat[$format])
            && isset($this->encoders[$this->encoderByFormat[$format]])
        ) {
            return $this->encoders[$this->encoderByFormat[$format]];
        }

        foreach ($this->encoders as $i => $encoder) {
            if ($encoder->supportsEncoding($format, $context)) {
                $this->encoderByFormat[$format] = $i;

                return $encoder;
            }
        }

        throw new RuntimeException(sprintf('No encoder found for format "%s".', $format));
    }
177096
public function getFormattedImage($format)
    {
        $formatName = $format instanceof FormatInterface
            ? $format->getName()
            : $format
        ;

        return $this->formattedImages
            ->filter(function (FormattedImageInterface $formattedImage) use ($formatName) {
                return ($format = $formattedImage->getFormat())
                    && $format->getName() == $formatName
                ;
            })
            ->first() ?: null // first() returns "false" if collection empty
        ;
    }
1292748
public function getParser(FormatInterface $format)
    {
        switch ($format->getType()) {
            case 'csv':
                if ($format instanceof CsvFormatInterface) {
                    return new CsvParser($format);
                } else {
                    throw new InvalidArgumentException(
                        "Format indicates it is csv but does not implement CsvFormatInterface"
                    );
                }

            // fallthrough
            case 'json':
                if ($format instanceof JsonFormatInterface) {
                    return new JsonParser($format);
                } else {
                    throw new InvalidArgumentexception(
                        "Format indicates it is json but does not implement JsonFormatInterface"
                    );
                }

            // fallthrough
            default:
                throw new InvalidArgumentException("Supplied format: {$format->getType()} is unknown");
        }
    }
419855
public function setFormat(string $format): VisualizerTask
    {
        switch ($format) {
            case VisualizerTask::FORMAT_PUML:
            case VisualizerTask::FORMAT_PNG:
            case VisualizerTask::FORMAT_EPS:
            case VisualizerTask::FORMAT_SVG:
                $this->format = $format;
                break;
            default:
                $message = "'$format' is not a valid format";
                $this->log($message, Project::MSG_ERR);
                throw new BuildException($message);
                break;
        }

        return $this;
    }
634054
public function getIp($format = self::FORMAT_HEX)
    {
        if ($this->ipHex === null) {
            return null;
        } elseif ($format === self::FORMAT_HEX) {
            return $this->ipHex;
        } elseif ($format === self::FORMAT_IP_STRING) {
            return inet_ntop($this->hex2bin($this->ipHex));
        }
        throw new \Exception('Invalid IP format');
    }
513268
public function format($format)
    {
        if (!$this->image) {
            $this->image();
        }

        $this->format = $format;

        return $this;
    }
1072826
public function get($format)
    {
        if ('plain' == $format || 'string' == $format) {
            return $this->makePlain();
        }
        if ('json' == $format) {
            return $this->makeJson();
        }

        return json_decode($this->response, true);
    }
1101497
public function getFormatter($formatter=null) {
		if (!$formatter) {
			$formatter = $this->getActualEditorType();
		}

		if (!isset(self::$registered_formatters[$formatter])) {
			throw new Exception("Formatter $formatter does not exist");
		}

		return self::$registered_formatters[$formatter];
	}
684859
public function getImage(string $format = null) : string
    {
        if (!$format) {
            $format = explode('/', $this->info['mime'], 2)[1];
        }
        switch (strtolower($format)) {
            case 'jpg':
            case 'jpeg':
                ob_start();
                imagejpeg($this->data);
                return ob_get_clean();
            case 'bitmap':
            case 'bmp':
                ob_start();
                imagewbmp($this->data);
                return ob_get_clean();
            case 'png':
                ob_start();
                imagepng($this->data);
                return ob_get_clean();
            case 'gif':
                ob_start();
                imagegif($this->data);
                return ob_get_clean();
            case 'webp':
                ob_start();
                imagewebp($this->data, null);
                return ob_get_clean();
            default:
                throw new ImageException('Unsupported format');
        }
    }
1168831
public function get($format = null)
    {
        if ( ! is_null($format) )
            $this->setFormat($format);

        ob_start();
        call_user_func($this->getFunctionName(), $this->getImage());

        return ob_get_clean();
    }
466065
public static function create(string $format = SerializerBuilder::DEFAULT_FORMAT) : SerializerInterface
    {
        return SerializerBuilder::instance()->setFormat($format)->build();
    }
839036
final public function format($format)
    {
        if(is_null($this->value)) {
            return null;
        } else {
            return $this->value->format($format);
        }
    }