@Component(value="cuba_ConditionXmlLoader")
public class ConditionXmlLoader
extends java.lang.Object
Condition
s from XML.
Use addFactory(String, Function)
method to add your own functions creating conditions from XML elements.
By default, LogicalCondition
and JpqlCondition
are supported.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
NAME |
Constructor and Description |
---|
ConditionXmlLoader() |
Modifier and Type | Method and Description |
---|---|
void |
addFactory(java.lang.String name,
java.util.function.Function<org.dom4j.Element,Condition> factory)
Adds a function creating a condition from XML element.
|
Condition |
fromXml(org.dom4j.Element element)
Creates a conditions tree from XML element.
|
Condition |
fromXml(java.lang.String xml)
Creates a conditions tree from XML string.
|
void |
removeFactory(java.lang.String name)
Removes a factory by its name.
|
public static final java.lang.String NAME
public void addFactory(java.lang.String name, java.util.function.Function<org.dom4j.Element,Condition> factory)
name
- name that can be used later in removeFactory(String)
method to remove the functionfactory
- function creating a condition from XML elementpublic void removeFactory(java.lang.String name)
public Condition fromXml(java.lang.String xml)
public Condition fromXml(org.dom4j.Element element)