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