Class LoaderSupport
java.lang.Object
io.jmix.flowui.xml.layout.support.LoaderSupport
Facilitates parsing data from XML.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionloadBoolean
(org.dom4j.Element element, String attributeName) Returns anOptional
with the attribute value from the given element for the attribute with the given name, otherwise an emptyOptional
.void
loadBoolean
(org.dom4j.Element element, String attributeName, Consumer<Boolean> setter) loadDouble
(org.dom4j.Element element, String attributeName) Returns anOptional
with the attribute value from the given element for the attribute with the given name, otherwise an emptyOptional
.void
loadDouble
(org.dom4j.Element element, String attributeName, Consumer<Double> setter) Returns anOptional
with the attribute value from the given element for the attribute with the given name, otherwise an emptyOptional
.<T extends Enum<T>>
voidloadInteger
(org.dom4j.Element element, String attributeName) Returns anOptional
with the attribute value from the given element for the attribute with the given name, otherwise an emptyOptional
.void
loadInteger
(org.dom4j.Element element, String attributeName, Consumer<Integer> setter) protected String
loadResourceString
(String message, String messageGroup) loadResourceString
(org.dom4j.Element element, String attributeName, String messageGroup) Returns anOptional
with the localized message defined in the attribute value from the given element for the attribute with the given name, otherwise an emptyOptional
.loadResourceString
(org.dom4j.Element element, String attributeName, String messageGroup, boolean emptyToNull) Returns anOptional
with the localized message defined in the attribute value from the given element for the attribute with the given name, otherwise an emptyOptional
.void
loadResourceString
(org.dom4j.Element element, String attributeName, String messageGroup, Consumer<String> setter) loadString
(org.dom4j.Element element, String attributeName) Returns anOptional
with the attribute value from the given element for the attribute with the given name, otherwise an emptyOptional
.loadString
(org.dom4j.Element element, String attributeName, boolean emptyToNull) Returns anOptional
with the attribute value from the given element for the attribute with the given name, otherwise an emptyOptional
.void
loadString
(org.dom4j.Element element, String attributeName, Consumer<String> setter)
-
Field Details
-
messageTools
-
-
Constructor Details
-
LoaderSupport
-
-
Method Details
-
loadString
Returns anOptional
with the attribute value from the given element for the attribute with the given name, otherwise an emptyOptional
. Also returns an emptyOptional
if the attribute value is the empty string. -
loadString
public Optional<String> loadString(org.dom4j.Element element, String attributeName, boolean emptyToNull) Returns anOptional
with the attribute value from the given element for the attribute with the given name, otherwise an emptyOptional
.- Parameters:
element
- the element to obtain valueattributeName
- the name of the attribute value to be returnedemptyToNull
- whether to return an emptyOptional
for empty string- Returns:
- an
Optional
with a presentString
value if the specified attribute exists in the element, otherwise an emptyOptional
-
loadBoolean
Returns anOptional
with the attribute value from the given element for the attribute with the given name, otherwise an emptyOptional
. -
loadInteger
Returns anOptional
with the attribute value from the given element for the attribute with the given name, otherwise an emptyOptional
. -
loadDouble
Returns anOptional
with the attribute value from the given element for the attribute with the given name, otherwise an emptyOptional
. -
loadEnum
public <T extends Enum<T>> Optional<T> loadEnum(org.dom4j.Element element, Class<T> type, String attributeName) Returns anOptional
with the attribute value from the given element for the attribute with the given name, otherwise an emptyOptional
. -
loadResourceString
public Optional<String> loadResourceString(org.dom4j.Element element, String attributeName, String messageGroup) Returns anOptional
with the localized message defined in the attribute value from the given element for the attribute with the given name, otherwise an emptyOptional
. Also returns an emptyOptional
if the attribute value is the empty string. -
loadResourceString
public Optional<String> loadResourceString(org.dom4j.Element element, String attributeName, String messageGroup, boolean emptyToNull) Returns anOptional
with the localized message defined in the attribute value from the given element for the attribute with the given name, otherwise an emptyOptional
.- Parameters:
element
- the element to obtain valueattributeName
- the name of the attribute value to be returnedmessageGroup
- message group to useemptyToNull
- whether to return an emptyOptional
for empty string- Returns:
- an
Optional
with a present localizedString
value if the specified attribute exists in the element, otherwise an emptyOptional
-
loadString
-
loadBoolean
-
loadInteger
-
loadDouble
-
loadEnum
-
loadResourceString
-
loadResourceString
-