Sets the SQL values formatter
@param formatter The SQL values formatter
@return The builder itself
@see AbstractRedG#setSqlValuesFormatter(SQLValuesFormatter)
176161
public RedGBuilder<T> withSqlValuesFormatter(final SQLValuesFormatter formatter) {
        if (instance == null) {
            throw new IllegalStateException("Using the builder after build() was called is not allowed!");
        }
        instance.setSqlValuesFormatter(formatter);
        return this;
    }
232278
private void addFormatter(CmsJspContentAccessValueWrapper formatterItem) {

        I_CmsXmlContentValue val = formatterItem.getContentValue();
        if (val instanceof CmsXmlDisplayFormatterValue) {
            CmsXmlDisplayFormatterValue value = (CmsXmlDisplayFormatterValue)val;
            String type = value.getDisplayType();
            CmsUUID formatterId = value.getFormatterId();
            if (formatterId != null) {
                m_displayFormatterIds.put(type, formatterId);
            }
        }
    }
853957
public function setFormatter(Formatter $formatter)
    {
        $this->formatter = $formatter;
        $format = $this;

        return $this
            ->setOptionsRecursive($formatter->getOptions())
            ->registerHelper(
                'dependencies_storage',
                $formatter->getOption('dependencies_storage')
            )->registerHelper(
                'helper_prefix',
                static::class.'::'
            )->provideHelper(
                'get_helper',
                [
                    'dependencies_storage',
                    'helper_prefix',
                    function ($dependenciesStorage, $prefix) use ($format) {
                        return function ($name) use ($dependenciesStorage, $prefix, $format) {
                            if (!isset($$dependenciesStorage)) {
                                return $format->getHelper($name);
                            }

                            $storage = $$dependenciesStorage;

                            if (!array_key_exists($prefix.$name, $storage) &&
                                !isset($storage[$prefix.$name])
                            ) {
                                throw new \Exception(
                                    var_export($name, true).
                                    ' dependency not found in the namespace: '.
                                    var_export($prefix, true)
                                );
                            }

                            return $storage[$prefix.$name];
                        };
                    },
                ]
            );
    }
980632
public SimpleDateFormat build() {
        
        final SimpleDateFormat formatter;
        if(locale == null) {
            formatter = new SimpleDateFormat(pattern);
        } else {
            formatter = new SimpleDateFormat(pattern, locale);
        }
        
        if(timeZone != null) {
            formatter.setTimeZone(timeZone);
        }
        formatter.setLenient(lenient);
        
        return formatter;
        
    }
343605
function setFormat(format) {
            if (format === null || format === undefined) {
                throw new Error("Format is not defined " + this.clazz.$name);
            }

            if (this.format !== format) {
                this.format = format;
                this.$getSuper("setValue").call(this, this.$format(this.date));
            }

            return this;
        }
159915
@Override
	public D withFormat(FormatDescriptor format) {
		formatDescriptor = Optional.of(Preconditions.checkNotNull(format));
		return (D) this;
	}
519460
public DataWriterBuilder<S, D> writeInFormat(WriterOutputFormat format) {
    this.format = format;
    log.debug("writeInFormat : {}", this.format);
    return this;
  }
750404
public Datatype.Builder setBuilderFactory(Optional<? extends BuilderFactory> builderFactory) {
    if (builderFactory.isPresent()) {
      return setBuilderFactory(builderFactory.get());
    } else {
      return clearBuilderFactory();
    }
  }
986718
public function format($operator, $value, &$states = [])
    {
        $defaults = [
            'schemas' => [],
            'aliases' => [],
            'schema' => null
        ];
        $states += $defaults;
        if (!isset($this->_formatters[$operator])) {
            throw new SqlException("Unexisting formatter `'{$operator}'`.");
        }
        $formatter = $this->_formatters[$operator];
        return $formatter($value, $states);
    }
360173
public static void setDefaultFormatter (@Nonnull final BiConsumer <String, BootstrapSystemMessage> aFormatter)
  {
    ValueEnforcer.notNull (aFormatter, "Formatter");
    s_aRWLock.writeLocked ( () -> s_aFormatter = aFormatter);
  }
734006
public String mkString(NumberFormat formatter, String rowsDelimiter, String columnsDelimiter) {
        // TODO: rewrite using iterators
        int[] formats = new int[columns];

        for (int i = 0; i < rows; i++) {
            for (int j = 0; j < columns; j++) {
                double value = get(i, j);
                String output = formatter.format(value);
                int size = output.length();
                formats[j] = size > formats[j] ? size : formats[j];
            }
        }

        StringBuilder sb = new StringBuilder();

        for (int i = 0; i < rows; i++) {
            for (int j = 0; j < columns; j++) {
                String output = formatter.format(get(i, j));
                int outputLength = output.length();

                if (outputLength < formats[j]) {
                    int align = formats[j] - outputLength;
                    if (align > INDENTS.length - 1) {
                        indent(sb, align);
                    } else {
                        sb.append(INDENTS[align - 1]);
                    }
                }

                sb.append(output)
                        .append(j < columns - 1 ? columnsDelimiter : "");
            }
            sb.append(rowsDelimiter);
        }

        return sb.toString();
    }
742146
def _set_formatter(self):
        
        if hasattr(self._config, "formatter") and self._config.formatter == "json":
            self._formatter = "json"
        else:
            self._formatter = "text"
298449
public function decreaseIndentLevelUntilIndentTypeIsSpecial(Formatter $formatter)
    {
        $formatter->setFormattedSql(\rtrim($formatter->getFormattedSql(), ' '));
        --$this->indentLvl;

        while ($j = \array_shift($this->indentTypes)) {
            if ('special' !== $j) {
                break;
            }
            --$this->indentLvl;
        }

        return $this;
    }
369824
private void format( CssFormatter formatter ) {
        String fmt = get( 0 ).stringValue( formatter );
        int idx = 1;
        for( int i = 0; i < fmt.length(); i++ ) {
            char ch = fmt.charAt( i );
            if( ch == '%' ) {
                ch = fmt.charAt( ++i );
                switch( ch ){
                    case '%':
                        formatter.append( ch );
                        break;
                    case 'a':
                    case 'd':
                        get( idx++ ).appendTo( formatter );
                        break;
                    case 'A':
                    case 'D':
                        String str = get( idx++ ).stringValue( formatter );
                        try {
                            str = new URI( null, null, str, null ).getRawPath();
                        } catch( URISyntaxException e ) {
                            e.printStackTrace();
                        }
                        formatter.append( str );
                        break;
                    case 's':
                        formatter.setInlineMode( true );
                        get( idx++ ).appendTo( formatter );
                        formatter.setInlineMode( false );
                        break;
                    case 'S':
                        formatter.setInlineMode( true );
                        str = get( idx++ ).stringValue( formatter );
                        try {
                            str = new URI( null, null, str, null ).getRawPath();
                        } catch( URISyntaxException e ) {
                            e.printStackTrace();
                        }
                        formatter.append( str );
                        formatter.setInlineMode( false );
                        break;
                    default:
                        formatter.append( ch );
                }
            } else {
                formatter.append( ch );
            }
        }
    }
602616
@Override
  public DurationFormatterFactory setPeriodFormatter(
      PeriodFormatter formatter) {
    if (formatter != this.formatter) {
      this.formatter = formatter;
      reset();
    }
    return this;
  }
542497
public DatePicker setDateFormat(SimpleDateFormat dateFormat) {
        this.dateFormat = dateFormat;
        for (Validator validator : this.getValidators()) {
            if (validator instanceof DateValidator) {
                ((DateValidator) validator).setDateFormat(dateFormat);
            }
        }
        return this;
    }
80579
public void setFormatter(final FormatterCallback<T> formatterCallback) {
        this.formatterCallback = formatterCallback;
        if (isAttached()) {
            setFormatter(getElement());
            refresh();
        }
    }