java.lang.Object
net.luis.utils.io.data.xml.XmlElement
net.luis.utils.io.data.xml.XmlValue
- All Implemented Interfaces:
DefaultValueGetter,ValueGetter
Represents a xml value element.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a new xml value with the given name and boolean value.Constructs a new xml value with the given name and number value.Constructs a new xml value with the given name and string value.
The value will be escaped automatically.XmlValue(@NotNull String name, @NotNull XmlAttributes attributes, boolean value) Constructs a new xml value with the given name, attributes and boolean value.XmlValue(@NotNull String name, @NotNull XmlAttributes attributes, @Nullable Number value) Constructs a new xml value with the given name, attributes and number value.XmlValue(@NotNull String name, @NotNull XmlAttributes attributes, @Nullable String value) Constructs a new xml value with the given name, attributes and string value.
The value will be escaped automatically. -
Method Summary
Modifier and TypeMethodDescriptionboolean@NotNull StringReturns the value which is hold by this object as a string.protected @NotNull StringReturns the type of the xml element.
This is used internally for error messages.@NotNull StringReturns the raw unescaped value of the element.@NotNull StringReturns the unescaped value of the element.inthashCode()booleanChecks if the xml element is self-closing.@NotNull StringReturns a string representation of this value.Methods inherited from class net.luis.utils.io.data.xml.XmlElement
addAttribute, addAttribute, addAttribute, addAttribute, addAttribute, addAttribute, addAttribute, addAttribute, addAttribute, addAttribute, getAsXmlContainer, getAsXmlValue, getAttribute, getAttributeAs, getAttributeAsBoolean, getAttributeAsByte, getAttributeAsDouble, getAttributeAsFloat, getAttributeAsInteger, getAttributeAsLong, getAttributeAsNumber, getAttributeAsShort, getAttributeAsString, getAttributes, getName, isXmlContainer, isXmlValue, toBaseString, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.luis.utils.util.getter.DefaultValueGetter
getAs, getAsBoolean, getAsByte, getAsDouble, getAsFloat, getAsInteger, getAsLong, getAsNumber, getAsShortMethods inherited from interface net.luis.utils.util.getter.ValueGetter
getAs, getAsBoolean, getAsByte, getAsDouble, getAsFloat, getAsInteger, getAsLong, getAsNumber, getAsShort
-
Field Details
-
value
The value of the xml element.
-
-
Constructor Details
-
XmlValue
Constructs a new xml value with the given name and boolean value.- Parameters:
name- The name of the xml elementvalue- The value of the xml element- Throws:
NullPointerException- If the name is null
-
XmlValue
Constructs a new xml value with the given name and number value.- Parameters:
name- The name of the xml elementvalue- The value of the xml element- Throws:
NullPointerException- If the name is null
-
XmlValue
Constructs a new xml value with the given name and string value.
The value will be escaped automatically.- Parameters:
name- The name of the xml elementvalue- The value of the xml element- Throws:
NullPointerException- If the name is null
-
XmlValue
public XmlValue(@NotNull @NotNull String name, @NotNull @NotNull XmlAttributes attributes, boolean value) Constructs a new xml value with the given name, attributes and boolean value.- Parameters:
name- The name of the xml elementattributes- The attributes of the xml elementvalue- The value of the xml element- Throws:
NullPointerException- If the name or attributes are null
-
XmlValue
public XmlValue(@NotNull @NotNull String name, @NotNull @NotNull XmlAttributes attributes, @Nullable @Nullable Number value) Constructs a new xml value with the given name, attributes and number value.- Parameters:
name- The name of the xml elementattributes- The attributes of the xml elementvalue- The value of the xml element
-
XmlValue
public XmlValue(@NotNull @NotNull String name, @NotNull @NotNull XmlAttributes attributes, @Nullable @Nullable String value) Constructs a new xml value with the given name, attributes and string value.
The value will be escaped automatically.- Parameters:
name- The name of the xml elementattributes- The attributes of the xml elementvalue- The value of the xml element- Throws:
NullPointerException- If the name or attributes are null
-
-
Method Details
-
getElementType
Description copied from class:XmlElementReturns the type of the xml element.
This is used internally for error messages.- Overrides:
getElementTypein classXmlElement- Returns:
- The type of the xml element
-
isSelfClosing
public boolean isSelfClosing()Description copied from class:XmlElementChecks if the xml element is self-closing.- Overrides:
isSelfClosingin classXmlElement- Returns:
- Always false
-
getRawValue
Returns the raw unescaped value of the element.- Returns:
- The raw value
-
getUnescapedValue
Returns the unescaped value of the element.- Returns:
- The unescaped value
-
getAsString
Returns the value which is hold by this object as a string.
This method is equivalent togetUnescapedValue().- Specified by:
getAsStringin interfaceValueGetter- Returns:
- The value as a string
-
equals
- Overrides:
equalsin classXmlElement
-
hashCode
public int hashCode()- Overrides:
hashCodein classXmlElement
-
toString
Returns a string representation of this value.- Overrides:
toStringin classXmlElement- Parameters:
config- The xml config to use for the string representation- Returns:
- The string representation
- Throws:
NullPointerException- If the config is null
-