Class PSXPathVariables

java.lang.Object
com.helger.schematron.pure.binding.xpath.PSXPathVariables
All Implemented Interfaces:
com.helger.commons.lang.ICloneable<PSXPathVariables>, IPSXPathVariables, Serializable

@NotThreadSafe public class PSXPathVariables extends Object implements IPSXPathVariables
This class manages all variables present in Schematron <let> elements.
Author:
Philip Helger
See Also:
  • Constructor Details

  • Method Details

    • add

      @Nonnull public com.helger.commons.state.EChange add(@Nonnull Map.Entry<String,String> aEntry)
      Add a new variable.
      Parameters:
      aEntry - The entry to be added - key is the variable name and value is the variable value. May not be null.
      Returns:
      EChange.UNCHANGED if a variable with the same name is already present. Never null.
    • add

      @Nonnull public com.helger.commons.state.EChange add(@Nonnull @Nonempty String sName, @Nonnull @Nonempty String sValue)
      Add a new variable.
      Parameters:
      sName - The name of the variable. May neither be null nor empty.
      sValue - The value of the variable. May neither be null nor empty.
      Returns:
      EChange.UNCHANGED if a variable with the same name is already present. Never null.
    • getAppliedReplacement

      @Nullable public String getAppliedReplacement(@Nullable String sText)
      Description copied from interface: IPSXPathVariables
      Perform the text replacement of all variables in the specified text.
      Specified by:
      getAppliedReplacement in interface IPSXPathVariables
      Parameters:
      sText - The source text. May be null.
      Returns:
      The text with all values replaced. May be null if the source text is null.
    • remove

      @Nonnull public com.helger.commons.state.EChange remove(@Nullable String sVarName)
      Remove the variable with the specified name
      Parameters:
      sVarName - The name of the variable to be removed. May be null.
      Returns:
      EChange.CHANGED if the variable was removed successfully. Never null.
    • removeAll

      @Nonnull public com.helger.commons.state.EChange removeAll(@Nullable Iterable<String> aVars)
      Remove all variables with the specified names
      Parameters:
      aVars - A list of variable names to be removed. May be null.
      Returns:
      EChange.CHANGED if at least one variable was removed successfully. Never null.
    • getAll

      @Nonnull @ReturnsMutableCopy public com.helger.commons.collection.impl.ICommonsNavigableMap<String,String> getAll()
      Specified by:
      getAll in interface IPSXPathVariables
      Returns:
      All contained variable key value pairs. Never null.
    • contains

      public boolean contains(@Nullable String sName)
      Specified by:
      contains in interface IPSXPathVariables
      Parameters:
      sName - Name of the variable to check
      Returns:
      true if a variable with the passed name in present.
    • get

      @Nullable public String get(@Nullable String sName)
      Specified by:
      get in interface IPSXPathVariables
      Parameters:
      sName - Variable name
      Returns:
      The variable value of the variable with the specified name or null if no such variable is present.
    • getClone

      @Nonnull @ReturnsMutableCopy public PSXPathVariables getClone()
      Specified by:
      getClone in interface com.helger.commons.lang.ICloneable<PSXPathVariables>
    • toString

      public String toString()
      Overrides:
      toString in class Object