/** * <p> * Constructs a <code>JavaUnicodeEscaper</code> above the specified value (exclusive). * </p> * * @param codepoint * above which to escape * @return the newly created {@code UnicodeEscaper} instance */ public static JavaUnicodeEscaper above(final int codepoint) { return outsideOf(0, codepoint); }
/** * <p> * Constructs a <code>JavaUnicodeEscaper</code> below the specified value (exclusive). * </p> * * @param codepoint * below which to escape * @return the newly created {@code UnicodeEscaper} instance */ public static JavaUnicodeEscaper below(final int codepoint) { return outsideOf(codepoint, Integer.MAX_VALUE); }
/** * <p> * Constructs a <code>JavaUnicodeEscaper</code> below the specified value (exclusive). * </p> * * @param codepoint * below which to escape * @return the newly created {@code UnicodeEscaper} instance */ public static JavaUnicodeEscaper below(final int codepoint) { return outsideOf(codepoint, Integer.MAX_VALUE); }
/** * <p> * Constructs a <code>JavaUnicodeEscaper</code> below the specified value (exclusive). * </p> * * @param codepoint * below which to escape * @return the newly created {@code UnicodeEscaper} instance */ public static JavaUnicodeEscaper below(final int codepoint) { return outsideOf(codepoint, Integer.MAX_VALUE); }
/** * <p> * Constructs a <code>JavaUnicodeEscaper</code> above the specified value (exclusive). * </p> * * @param codepoint * above which to escape * @return the newly created {@code UnicodeEscaper} instance */ public static JavaUnicodeEscaper above(final int codepoint) { return outsideOf(0, codepoint); }
/** * <p> * Constructs a <code>JavaUnicodeEscaper</code> above the specified value (exclusive). * </p> * * @param codepoint * above which to escape * @return the newly created {@code UnicodeEscaper} instance */ public static JavaUnicodeEscaper above(final int codepoint) { return outsideOf(0, codepoint); }
/** * <p> * Constructs a <code>JavaUnicodeEscaper</code> above the specified value (exclusive). * </p> * * @param codepoint * above which to escape * @return the newly created {@code UnicodeEscaper} instance */ public static JavaUnicodeEscaper above(final int codepoint) { return outsideOf(0, codepoint); }
/** * <p> * Constructs a <code>JavaUnicodeEscaper</code> below the specified value (exclusive). * </p> * * @param codepoint * below which to escape * @return the newly created {@code UnicodeEscaper} instance */ public static JavaUnicodeEscaper below(final int codepoint) { return outsideOf(codepoint, Integer.MAX_VALUE); }
/** * Escape the string with given quote character. */ public static String escape(String value, char quote) { final CharSequenceTranslator escape = new LookupTranslator( new String[][]{ {Character.toString(quote), "\\" + quote}, {"\\", "\\\\"}, }).with( new LookupTranslator(EntityArrays.JAVA_CTRL_CHARS_ESCAPE()) ).with( JavaUnicodeEscaper.outsideOf(32, 0x7f) ); return quote + escape.translate(value) + quote; }