Class PreprocessorIDPool

java.lang.Object
com.helger.schematron.pure.preprocess.PreprocessorIDPool

@NotThreadSafe public class PreprocessorIDPool extends Object
Utility lookup cache for all used IDs within a schema.
Author:
Philip Helger
  • Field Details

  • Constructor Details

    • PreprocessorIDPool

      public PreprocessorIDPool()
  • Method Details

    • getDefaultSeparator

      @Nonnull public static String getDefaultSeparator()
      Returns:
      The separator to be used between the original ID and the counter added to make the ID unique. Never null. The default value is DEFAULT_SEPARATOR.
      Since:
      6.3.5
    • setDefaultSeparator

      public static void setDefaultSeparator(@Nonnull String sDefaultSeparator)
      Set the separator to be used between the original ID and the counter added internally.
      Parameters:
      sDefaultSeparator - Any non-null value is okay.
      Since:
      6.3.5
    • getSeparator

      @Nonnull public String getSeparator()
      Returns:
      The separator to be used between the original ID and the counter added to make the ID unique. Never null. The default value is DEFAULT_SEPARATOR.
      Since:
      6.3.5
      See Also:
    • getUniqueID

      @Nullable public String getUniqueID(@Nullable String sID)
      Create a unique ID based on the passed one. If the passed ID is not yet contained, than a numeric index is appended until the ID is unique.
      Parameters:
      sID - The source ID. May be null.
      Returns:
      null if the passed ID is null indicating that no ID is present. Otherwise a unique ID is returned.
    • toString

      public String toString()
      Overrides:
      toString in class Object