Class VBScriptCodec


  • public class VBScriptCodec
    extends Codec
    Implementation of the Codec interface for 'quote' encoding from VBScript.
    Since:
    June 1, 2007
    Author:
    Jeff Williams (jeff.williams .at. aspectsecurity.com) Aspect Security
    See Also:
    Encoder
    • Constructor Summary

      Constructors 
      Constructor Description
      VBScriptCodec()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Character decodeCharacter​(PushbackString input)
      Returns the decoded version of the character starting at index, or null if no decoding is possible.
      java.lang.String encode​(char[] immune, java.lang.String input)
      Encode a String so that it can be safely used in a specific context.
      java.lang.String encodeCharacter​(char[] immune, java.lang.Character c)
      Returns quote-encoded character
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • VBScriptCodec

        public VBScriptCodec()
    • Method Detail

      • encode

        public java.lang.String encode​(char[] immune,
                                       java.lang.String input)
        Encode a String so that it can be safely used in a specific context.
        Overrides:
        encode in class Codec
        Parameters:
        immune -
        input - the String to encode
        Returns:
        the encoded String
      • encodeCharacter

        public java.lang.String encodeCharacter​(char[] immune,
                                                java.lang.Character c)
        Returns quote-encoded character
        Overrides:
        encodeCharacter in class Codec
        Parameters:
        immune -
        c - the Character to encode
        Returns:
        the encoded Character
      • decodeCharacter

        public java.lang.Character decodeCharacter​(PushbackString input)
        Returns the decoded version of the character starting at index, or null if no decoding is possible. Formats all are legal both upper/lower case: "x - all special characters " + chr(x) + " - not supported yet
        Overrides:
        decodeCharacter in class Codec
        Parameters:
        input - the Character to decode
        Returns:
        the decoded Character