object Format
Minimal re-implementation of Python's %
formatting logic, since Jsonnet's
%
formatter is basically "do whatever python does", with a link to:
- https://docs.python.org/2/library/stdtypes.html#string-formatting
Parses the formatted strings into a sequence of literal strings separated
by %
interpolations modelled as structured Format.FormatSpecs, and
use those to decide how to inteprolate the provided Jsonnet Vals into
the final string.
Linear Supertypes
Ordering
- Alphabetic
- By Inheritance
Inherited
- Format
- AnyRef
- Any
- Hide All
- Show All
Visibility
- Public
- All
Type Members
- case class FormatSpec(label: Option[String], alternate: Boolean, zeroPadded: Boolean, leftAdjusted: Boolean, blankBeforePositive: Boolean, signCharacter: Boolean, width: Option[Int], precision: Option[Int], conversion: Char) extends Product with Serializable
- class PartialApplyFmt extends Builtin1
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
- def conversion[_](implicit arg0: P[Any]): P[String]
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
- def flags[_](implicit arg0: P[Any]): P[String]
- def format(leading: String, chunks: Seq[(FormatSpec, String)], values0: Val, pos: Position)(implicit evaluator: EvalScope): String
- def format(s: String, values0: Val, pos: Position)(implicit evaluator: EvalScope): String
- def format[_](implicit arg0: P[Any]): P[(String, Seq[(FormatSpec, String)])]
- def formatExponent(formatted: FormatSpec, s: Double): String
- def formatFloat(formatted: FormatSpec, s: Double): String
- def formatGeneric(formatted: FormatSpec, s: Double): String
- def formatHexadecimal(formatted: FormatSpec, s: Double): String
- def formatInteger(formatted: FormatSpec, s: Double): String
- def formatOctal(formatted: FormatSpec, s: Double): String
- def formatSpec[_](implicit arg0: P[Any]): P[FormatSpec]
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def integer[_](implicit arg0: P[Any]): P[Unit]
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def label[_](implicit arg0: P[Any]): P[Option[String]]
- def maybeDecimalPoint(formatted: FormatSpec, fracLengths: (Int, Int)): Option[(Int, Int)]
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def plain[_](implicit arg0: P[Any]): P[String]
- def precision[_](implicit arg0: P[Any]): P[Option[String]]
- def precisionPad(lhs: String, rhs: String, precision: Option[Int]): String
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
- def widen(formatted: FormatSpec, lhs: String, mhs: String, rhs: String, numeric: Boolean, signedConversion: Boolean): String
- def widenRaw(formatted: FormatSpec, txt: String): String
- def width[_](implicit arg0: P[Any]): P[Option[String]]