public class DefaultXmlConfig extends Object implements XmlConfig
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_FIRST_LEVEL |
static String |
DEFAULT_INTENDATION
Default intendation have got 4 spaces per level
|
static String |
DEFAULT_NEW_LINE
Default string or the new line
|
protected String |
doctype
A header declaration of the document or a doctype
|
static String |
REQUIRED_MSG
Assertion message template
|
Constructor and Description |
---|
DefaultXmlConfig() |
Modifier and Type | Method and Description |
---|---|
String |
getDefaultValue()
A replacement text instead of the
null value |
String |
getDoctype()
A header declaration of the document or a doctype
|
int |
getFirstLevel()
Level of the root element, the value may be negative.
|
Formatter |
getFormatter()
A default implementation is:
String.valueOf(value) |
Charset |
getCharset()
Charset
|
String |
getIndentation()
An indentation space for elements of the next level,
where default value is an empty `String`
|
String |
getNewLine()
A new line sequence
|
boolean |
isCacheAllowed()
HTTP cache is allowed
|
protected <T> T |
nonnull(T value,
T defaultValue) |
void |
setCacheAllowed(boolean cacheAllowed) |
void |
setCompressedFormat()
Assign parameters for a compressed format of the HTML result
|
void |
setDefaultValue(String defaultValue)
A replacement text instead of the
null value |
void |
setDoctype(String doctype)
A header declaration of the document or a doctype
|
void |
setDom(boolean dom)
Use a DOM model
|
void |
setFirstLevel(int firstLevel)
Level of the root element, the value may be negative.
|
void |
setFormatter(Formatter formatter)
A default value formatter is implemented by the method
String.valueOf(value) |
void |
setCharset(Charset charset)
Charset
|
void |
setIndentationSpace(String indentation)
An indentation space for elements of the next level,
where default value is an empty `String`
|
void |
setNewLine(String newLine)
A new line sequence
|
void |
setNiceFormat()
Assign parameters for a nice format of the HTML result
|
void |
setNiceFormat(String indentation)
Assign parameters for a nice format of the HTML result
|
public static final String DEFAULT_INTENDATION
public static final String DEFAULT_NEW_LINE
public static final int DEFAULT_FIRST_LEVEL
public static final String REQUIRED_MSG
@Nonnull public String getDoctype()
getDoctype
in interface XmlConfig
public void setDoctype(@Nullable String doctype)
@Nonnull public Charset getCharset()
getCharset
in interface XmlConfig
public void setCharset(@Nonnull Charset charset)
charset
- the charset to setpublic final void setNiceFormat()
public final void setNiceFormat(@Nullable String indentation)
indentation
- An empty String is replaced by a default intendation.public final void setCompressedFormat()
public int getFirstLevel()
getFirstLevel
in interface XmlConfig
public void setFirstLevel(int firstLevel)
firstLevel
- the firstLevel to set@Nonnull public String getIndentation()
getIndentation
in interface XmlConfig
public void setIndentationSpace(@Nonnull String indentation)
public String getDefaultValue()
null
valuegetDefaultValue
in interface XmlConfig
@Nonnull public Formatter getFormatter()
String.valueOf(value)
getFormatter
in interface XmlConfig
public void setDefaultValue(@Nonnull String defaultValue)
null
valuepublic void setDom(boolean dom)
dom
- the dom to setpublic boolean isCacheAllowed()
XmlConfig
isCacheAllowed
in interface XmlConfig
public void setCacheAllowed(boolean cacheAllowed)
public String getNewLine()
getNewLine
in interface XmlConfig
Copyright 2019-2022, Pavel Ponec