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 @Nullable 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(@NotNull XmlConfig config)
Copy attributes from other config
|
| Modifier and Type | Method and Description |
|---|---|
CharSequence |
getDefaultValue()
A replacement text instead of the
null value |
@NotNull CharSequence |
getDoctype()
A header declaration of the document or a doctype
|
int |
getFirstLevel()
Level of the root element, the value may be negative.
|
@NotNull Formatter |
getFormatter()
A default implementation is:
String.valueOf(value) |
@NotNull Charset |
getCharset()
Charset
|
@NotNull 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(@NotNull String defaultValue)
A replacement text instead of the
null value |
DefaultXmlConfig |
setDoctype(@Nullable 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(@NotNull Formatter formatter)
A default value formatter is implemented by the method
String.valueOf(value) |
DefaultXmlConfig |
setCharset(@NotNull Charset charset)
Charset
|
DefaultXmlConfig |
setIndentationSpace(@NotNull CharSequence indentation)
An indentation space for elements of the next level,
where default value is an empty `String`
|
DefaultXmlConfig |
setNewLine(@NotNull CharSequence newLine)
A new line sequence
|
<T extends DefaultXmlConfig> |
setNiceFormat()
Assign parameters for a nice format of the HTML result
|
<T extends DefaultXmlConfig> |
setNiceFormat(@Nullable 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 @Nullable CharSequence doctype
public DefaultXmlConfig()
public DefaultXmlConfig(@NotNull
@NotNull XmlConfig config)
@NotNull public @NotNull CharSequence getDoctype()
getDoctype in interface XmlConfig@NotNull
protected final <T> T nonnull(@Nullable
T value,
@NotNull
T defaultValue)
public DefaultXmlConfig setDoctype(@Nullable @Nullable CharSequence doctype)
@NotNull public @NotNull Charset getCharset()
getCharset in interface XmlConfigpublic DefaultXmlConfig setCharset(@NotNull @NotNull Charset charset)
charset - the charset to setpublic final <T extends DefaultXmlConfig> T setNiceFormat()
public final <T extends DefaultXmlConfig> T setNiceFormat(@Nullable @Nullable CharSequence indentation)
indentation - An empty String is replaced by a default intendation.public final DefaultXmlConfig setCompressedFormat()
public int getFirstLevel()
getFirstLevel in interface XmlConfigpublic DefaultXmlConfig setFirstLevel(int firstLevel)
firstLevel - the firstLevel to set@NotNull public @NotNull CharSequence getIndentation()
getIndentation in interface XmlConfigpublic DefaultXmlConfig setIndentationSpace(@NotNull @NotNull CharSequence indentation)
public CharSequence getDefaultValue()
null valuegetDefaultValue in interface XmlConfig@NotNull public @NotNull Formatter getFormatter()
String.valueOf(value)getFormatter in interface XmlConfigpublic DefaultXmlConfig setDefaultValue(@NotNull @NotNull String defaultValue)
null valuepublic boolean isCacheAllowed()
XmlConfigisCacheAllowed in interface XmlConfigpublic DefaultXmlConfig setCacheAllowed(boolean cacheAllowed)
public CharSequence getNewLine()
getNewLine in interface XmlConfigpublic DefaultXmlConfig setNewLine(@NotNull @NotNull CharSequence newLine)
public DefaultXmlConfig setFormatter(@NotNull @NotNull Formatter formatter)
String.valueOf(value)Copyright 2015, Pavel Ponec