Interface Normalizer<T>

All Known Subinterfaces:
PolyStringNormalizer, StringNormalizer

@Experimental public interface Normalizer<T>
Normalizes and matches (arbitrary) values, typically strings.
  • Method Summary

    Modifier and Type
    Method
    Description
    @NotNull QName
    Returns the qualified name identifying this normalizer.
    boolean
    `true` if the normalizer is known to be the default one, i.e., one that does no transformations.
    boolean
    match(T a, T b)
    Matches two values.
    boolean
    matchRegex(T a, String regex)
    Matches a value against regular expression (if supported).
    normalize(T orig)
    Returns a normalized version of the value.
    default String
    Temporary solution for untyped relation between normalizers vs.
  • Method Details

    • normalize

      @Contract("null -> null; !null -> !null") T normalize(T orig) throws SchemaException
      Returns a normalized version of the value.
      Throws:
      SchemaException
    • match

      boolean match(@Nullable T a, @Nullable T b) throws SchemaException
      Matches two values.
      Throws:
      SchemaException
    • matchRegex

      boolean matchRegex(T a, String regex) throws SchemaException
      Matches a value against regular expression (if supported).
      Throws:
      SchemaException
    • getName

      @NotNull @NotNull QName getName()
      Returns the qualified name identifying this normalizer.
    • isIdentity

      boolean isIdentity()
      `true` if the normalizer is known to be the default one, i.e., one that does no transformations.
    • normalizeString

      default String normalizeString(String orig) throws SchemaException
      Temporary solution for untyped relation between normalizers vs. matching rules. (See the wildcard return type of MatchingRule.getNormalizer(). We often need to normalize strings into PolyStrings.
      Throws:
      SchemaException