Class RegexpEncoder

java.lang.Object
com.webmethods.rtl.encode.Encoder
com.webmethods.rtl.encode.RegexpEncoder

public class RegexpEncoder extends Encoder
Encodes to and from Regexp. Escapes /\{}().*+?|[]^$ plus cr and lf.
  • Field Details

    • encoder

      protected static Encoder encoder
  • Constructor Details

    • RegexpEncoder

      public RegexpEncoder()
  • Method Details

    • encoder

      public static Encoder encoder()
      Returns the encoder instance.
    • encode

      public String encode(String src)
      Encodes to the format.
      Overrides:
      encode in class Encoder
      Parameters:
      src - String to encode.
      Returns:
      Encoded String.
    • decode

      public String decode(String src)
      Decodes from the format.
      Overrides:
      decode in class Encoder
      Parameters:
      src - String to decode.
      Returns:
      Decoded String.
    • encode

      public int encode(char[] src, int soff, int len, Writer dst) throws IOException
      Encodes to Regexp.
      Specified by:
      encode in class Encoder
      Parameters:
      src - Char array to encode.
      soff - Offset in the src array at which to begin reading.
      len - Length of src array to encode.
      dst - Writer in which to write the encoded chars.
      Returns:
      Length of chars written to dst.
      Throws:
      IOException
    • decode

      public int decode(char[] src, int soff, int len, Writer dst) throws IOException
      Decodes from Regexp.
      Specified by:
      decode in class Encoder
      Parameters:
      src - Char array to decode.
      soff - Offset in the src array at which to begin reading.
      len - Length of src array to decode.
      dst - Writer in which to write the decoded chars.
      Returns:
      Length of chars written to dst.
      Throws:
      IOException