Class Substitutions
- All Implemented Interfaces:
org.teavm.extension.spi.substitution.SubstitutionPolicy
java.util.Formatter and what it needs at the ones in this package.
Found through META-INF/services, which is how the compiler's own class library registers
its substitutions. String.format and printf both go through
java.util.Formatter, so replacing it is what makes them cost what they cost here.
The class library's DoubleAnalyzer, which Double.toString and every string
concatenation of a double write digits from, is pointed at DoubleAnalyzer, its copy that
picks the shortest digits exactly, and its DoubleSynthesizer, which DecimalFormat
reads a number with, at DoubleSynthesizer. Its FloatAnalyzer, which
Float.toString writes from, is pointed at FloatAnalyzer. Double.parseDouble and
Float.parseFloat no longer come through either: ParsePlugin sends them to
Parse.
IllegalFormatException comes along because its constructors are package-private in the
class library, so the two subclasses it is missing cannot be written anywhere else.
Formattable comes along because its one method takes a formatter.
- Since:
- 1.0.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcontribute(org.teavm.extension.spi.substitution.SubstitutionSink sink) Methods inherited from class org.teavm.extension.spi.substitution.SimpleSubstitutionPolicy
inPackage, inPackage, named, namePattern, not
-
Constructor Details
-
Substitutions
public Substitutions()
-
-
Method Details
-
contribute
public void contribute(org.teavm.extension.spi.substitution.SubstitutionSink sink)
-