Class ConditionXmlLoader

java.lang.Object
io.jmix.core.querycondition.ConditionXmlLoader

@Component("core_ConditionXmlLoader") public class ConditionXmlLoader extends Object
Loads the tree of Conditions from XML.

Use addFactory(String, Function) method to add your own functions creating conditions from XML elements. By default, LogicalCondition and JpqlCondition are supported.

  • Constructor Details

    • ConditionXmlLoader

      public ConditionXmlLoader()
  • Method Details

    • addFactory

      public void addFactory(String name, Function<org.dom4j.Element,Condition> factory)
      Adds a function creating a condition from XML element.
      Parameters:
      name - name that can be used later in removeFactory(String) method to remove the function
      factory - function creating a condition from XML element
    • removeFactory

      public void removeFactory(String name)
      Removes a factory by its name.
    • fromXml

      public Condition fromXml(String xml)
      Creates a conditions tree from XML string.
    • fromXml

      public Condition fromXml(org.dom4j.Element element)
      Creates a conditions tree from XML element.