Package com.github.mavolin.maxon
Class MaxonConfigurator
- java.lang.Object
-
- com.github.mavolin.maxon.MaxonConfigurator
-
public class MaxonConfigurator extends Object
TheMaxonConfigurator
is used to create aMaxon
object with a custom output. By configuring the desired settings and callingbuildMaxon()
the custom can be constructed.
-
-
Constructor Summary
Constructors Constructor Description MaxonConfigurator()
Instantiates a newMaxonConfigurator
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Maxon
buildMaxon()
Builds theMaxon
with custom configuration.MaxonConfigurator
setDateFormatConfiguration(DateFormatConfiguration dateFormatConfiguration)
Sets theDateFormatConfiguration
which defines how date and time objects shall be parsed.MaxonConfigurator
setIgnoreNull(boolean ignoreNull)
MaxonConfigurator
setPrintStyle(PrintStyle printStyle)
MaxonConfigurator
setWhitespaceQuantity(int qty)
Sets the quantity of whitespace characters used for one indent when inPrintStyle.PRETTY_PRINTED
mode.MaxonConfigurator
toggleTabWhitespace(boolean bool)
If set to true, the default whitespace character will be a tabulator instead of a space.
-
-
-
Method Detail
-
toggleTabWhitespace
public MaxonConfigurator toggleTabWhitespace(boolean bool)
If set to true, the default whitespace character will be a tabulator instead of a space.
The default setting is
false
- Parameters:
bool
-true
to use tabulator as whitespace character;false
to use a space- Returns:
- itself
-
setWhitespaceQuantity
public MaxonConfigurator setWhitespaceQuantity(int qty)
Sets the quantity of whitespace characters used for one indent when in
PrintStyle.PRETTY_PRINTED
mode.The default setting is
4
.- Parameters:
qty
- the quantity of whitespace characters in one indent- Returns:
- itself
-
setPrintStyle
public MaxonConfigurator setPrintStyle(PrintStyle printStyle)
Sets the
PrintStyle
used to generate JSONStrings
to the passedPrintStyle
.The default setting is
PrintStyle.SINGLE_WHITESPACE
.- Parameters:
printStyle
- thePrintStyle
- Returns:
- itself
-
setIgnoreNull
public MaxonConfigurator setIgnoreNull(boolean ignoreNull)
Choose whether or not
nulls
found inJsonArrays
andJsonObjects
are to be ignored or notThe default setting is
false
.- Parameters:
ignoreNull
-true
ifnulls
should be ignored;false
otherwise- Returns:
- itself
-
setDateFormatConfiguration
public MaxonConfigurator setDateFormatConfiguration(DateFormatConfiguration dateFormatConfiguration)
Sets the
DateFormatConfiguration
which defines how date and time objects shall be parsed.The default value is
new DateFormatConfiguration
.- Parameters:
dateFormatConfiguration
- the date format configuration- Returns:
- itself
-
-