Package org.ujorm.tools.xml.config.impl
Class DefaultXmlConfig
java.lang.Object
org.ujorm.tools.xml.config.impl.DefaultXmlConfig
- All Implemented Interfaces:
XmlConfig
- Direct Known Subclasses:
DefaultHtmlConfig
Configuration of HtmlPage
- Author:
- Pavel Ponec
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intDefault first level of intendationstatic final StringDefault intendation per levelstatic final StringDefault string or the new lineprotected @Nullable CharSequenceA header declaration of the document or a doctypestatic final StringAn empty Stringstatic final StringAssertion message template -
Constructor Summary
ConstructorsConstructorDescriptionDefaultXmlConfig(@NotNull XmlConfig config) Copy attributes from other config -
Method Summary
Modifier and TypeMethodDescriptionA replacement text instead of thenullvalue@NotNull CharSequenceA header declaration of the document or a doctypeintLevel of the root element, the value may be negative.@NotNull FormatterA default implementation is:String.valueOf(value)@NotNull CharsetCharset@NotNull CharSequenceAn indentation space for elements of the next level, where default value is an empty `String`A new line sequencebooleanHTTP cache is allowedprotected final <T> Tnonnull(T value, T defaultValue) setCacheAllowed(boolean cacheAllowed) final DefaultXmlConfigAssign parameters for a compressed format of the HTML resultsetDefaultValue(@NotNull String defaultValue) A replacement text instead of thenullvaluesetDoctype(@Nullable CharSequence doctype) A header declaration of the document or a doctypesetFirstLevel(int firstLevel) Level of the root element, the value may be negative.setFormatter(@NotNull Formatter formatter) A default value formatter is implemented by the methodString.valueOf(value)setCharset(@NotNull Charset charset) CharsetsetIndentationSpace(@NotNull CharSequence indentation) An indentation space for elements of the next level, where default value is an empty `String`setNewLine(@NotNull CharSequence newLine) A new line sequencefinal <T extends DefaultXmlConfig>
TAssign parameters for a nice format of the HTML resultfinal <T extends DefaultXmlConfig>
TsetNiceFormat(@Nullable CharSequence indentation) Assign parameters for a nice format of the HTML resultMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.ujorm.tools.xml.config.XmlConfig
pairElement
-
Field Details
-
DEFAULT_INTENDATION
Default intendation per level- See Also:
-
DEFAULT_NEW_LINE
Default string or the new line- See Also:
-
DEFAULT_FIRST_LEVEL
public static final int DEFAULT_FIRST_LEVELDefault first level of intendation- See Also:
-
REQUIRED_MSG
Assertion message template- See Also:
-
EMPTY
An empty String- See Also:
-
doctype
A header declaration of the document or a doctype
-
-
Constructor Details
-
DefaultXmlConfig
public DefaultXmlConfig() -
DefaultXmlConfig
Copy attributes from other config
-
-
Method Details
-
getDoctype
A header declaration of the document or a doctype- Specified by:
getDoctypein interfaceXmlConfig
-
nonnull
@NotNull protected final <T> T nonnull(@Nullable T value, @NotNull T defaultValue) -
setDoctype
A header declaration of the document or a doctype -
getCharset
Charset- Specified by:
getCharsetin interfaceXmlConfig- Returns:
- the charset
-
setCharset
Charset- Parameters:
charset- the charset to set
-
setNiceFormat
Assign parameters for a nice format of the HTML result -
setNiceFormat
public final <T extends DefaultXmlConfig> T setNiceFormat(@Nullable @Nullable CharSequence indentation) Assign parameters for a nice format of the HTML result- Parameters:
indentation- An empty String is replaced by a default intendation.
-
setCompressedFormat
Assign parameters for a compressed format of the HTML result -
getFirstLevel
public int getFirstLevel()Level of the root element, the value may be negative.- Specified by:
getFirstLevelin interfaceXmlConfig- Returns:
- the firstLevel
-
setFirstLevel
Level of the root element, the value may be negative.- Parameters:
firstLevel- the firstLevel to set
-
getIndentation
An indentation space for elements of the next level, where default value is an empty `String`- Specified by:
getIndentationin interfaceXmlConfig- Returns:
- the newLine
-
setIndentationSpace
An indentation space for elements of the next level, where default value is an empty `String` -
getDefaultValue
A replacement text instead of thenullvalue- Specified by:
getDefaultValuein interfaceXmlConfig
-
getFormatter
A default implementation is:String.valueOf(value)- Specified by:
getFormatterin interfaceXmlConfig
-
setDefaultValue
A replacement text instead of thenullvalue -
isCacheAllowed
public boolean isCacheAllowed()Description copied from interface:XmlConfigHTTP cache is allowed- Specified by:
isCacheAllowedin interfaceXmlConfig- Returns:
-
setCacheAllowed
-
getNewLine
A new line sequence- Specified by:
getNewLinein interfaceXmlConfig
-
setNewLine
A new line sequence -
setFormatter
A default value formatter is implemented by the methodString.valueOf(value)
-