public class MinifyHtml extends Object
RuntimeException will be thrown.| Modifier and Type | Class and Description |
|---|---|
static class |
MinifyHtml.Configuration
Class representing minification configuration.
|
static class |
MinifyHtml.SyntaxException
Basic exception class representing minification errors.
|
| Modifier and Type | Method and Description |
|---|---|
static String |
minify(String code,
MinifyHtml.Configuration cfg)
Minify HTML code represented as a
String. |
static int |
minifyInPlace(ByteBuffer code,
MinifyHtml.Configuration cfg)
Minify UTF-8 HTML code contents of a
ByteBuffer instance in place. |
public static int minifyInPlace(ByteBuffer code, MinifyHtml.Configuration cfg)
ByteBuffer instance in place.
The backing data will be mutated. Returns the length of the minified portion of the ByteBuffer.
The ByteBuffer must be direct, otherwise IllegalArgumentException will be thrown.
If the code fails to be minified, a MinifyHtml.SyntaxException will be thrown with a descriptive English message and position in code where the error occurred.code - ByteBuffer containing HTML code to minifycfg - MinifyHtml.Configuration minification settings to useByteBufferpublic static String minify(String code, MinifyHtml.Configuration cfg)
String.
The String will be copied to a UTF-8 byte array in native code, and then copied back into a Java String.
If the code fails to be minified, a MinifyHtml.SyntaxException will be thrown with a descriptive English message and position in code where the error occurred.code - HTML code to minifycfg - MinifyHtml.Configuration minification settings to useCopyright © 2020. All rights reserved.