Class DataConfigNode

java.lang.Object
org.apache.solr.util.DataConfigNode
All Implemented Interfaces:
org.apache.solr.common.ConfigNode

public class DataConfigNode extends Object implements org.apache.solr.common.ConfigNode
ConfigNode impl that applies property substitutions on access.

This class wraps another ConfigNode and applies property substitution immediately when the txt() or attributes() methods are called. Because property substition is based on ThreadLocal values, These methods MUST be called while those variables are "active"

See Also:
  • ConfigNode.SUBSTITUTES
  • PropertiesUtil.substitute(java.lang.String, java.util.function.Function<java.lang.String, java.lang.String>)
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.apache.solr.common.ConfigNode

    org.apache.solr.common.ConfigNode.Helpers
  • Field Summary

    Fields inherited from interface org.apache.solr.common.ConfigNode

    EMPTY, SUBSTITUTES
  • Constructor Summary

    Constructors
    Constructor
    Description
    DataConfigNode(org.apache.solr.common.ConfigNode root)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Each call to this method returns a (new) copy of the original Map with substitions applied to the values.
    org.apache.solr.common.ConfigNode
    child(String name)
     
    void
    forEachChild(Function<org.apache.solr.common.ConfigNode,Boolean> fun)
     
    List<org.apache.solr.common.ConfigNode>
    getAll(String name)
     
    List<org.apache.solr.common.ConfigNode>
    getAll(Set<String> names, Predicate<org.apache.solr.common.ConfigNode> test)
     
     
    txt()
    Each call to this method returns a (new) copy of the original txt with substitions applied.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.apache.solr.common.ConfigNode

    attr, attr, attributesExcept, attrRequired, boolAttr, boolVal, child, childNodesToNamedList, childRequired, doubleVal, exists, get, get, get, intAttr, intVal, isNull, txt
  • Constructor Details

    • DataConfigNode

      public DataConfigNode(org.apache.solr.common.ConfigNode root)
  • Method Details

    • name

      public String name()
      Specified by:
      name in interface org.apache.solr.common.ConfigNode
    • txt

      public String txt()
      Each call to this method returns a (new) copy of the original txt with substitions applied.
      Specified by:
      txt in interface org.apache.solr.common.ConfigNode
    • attributes

      public Map<String,String> attributes()
      Each call to this method returns a (new) copy of the original Map with substitions applied to the values.
      Specified by:
      attributes in interface org.apache.solr.common.ConfigNode
    • child

      public org.apache.solr.common.ConfigNode child(String name)
      Specified by:
      child in interface org.apache.solr.common.ConfigNode
    • getAll

      public List<org.apache.solr.common.ConfigNode> getAll(String name)
      Specified by:
      getAll in interface org.apache.solr.common.ConfigNode
    • getAll

      public List<org.apache.solr.common.ConfigNode> getAll(Set<String> names, Predicate<org.apache.solr.common.ConfigNode> test)
      Specified by:
      getAll in interface org.apache.solr.common.ConfigNode
    • forEachChild

      public void forEachChild(Function<org.apache.solr.common.ConfigNode,Boolean> fun)
      Specified by:
      forEachChild in interface org.apache.solr.common.ConfigNode