/** * <p>Constructs a <code>NumericEntityEscaper</code> between the specified values (inclusive). </p> * * @param codepointLow above which to escape * @param codepointHigh below which to escape * @return the newly created {@code NumericEntityEscaper} instance */ public static NumericEntityEscaper between(final int codepointLow, final int codepointHigh) { return new NumericEntityEscaper(codepointLow, codepointHigh, true); }
/** * <p>Constructs a <code>NumericEntityEscaper</code> outside of the specified values (exclusive). </p> * * @param codepointLow below which to escape * @param codepointHigh above which to escape * @return the newly created {@code NumericEntityEscaper} instance */ public static NumericEntityEscaper outsideOf(final int codepointLow, final int codepointHigh) { return new NumericEntityEscaper(codepointLow, codepointHigh, false); }
@Test public void testSupplementary() { final NumericEntityEscaper nee = new NumericEntityEscaper(); final String input = "\uD803\uDC22"; final String expected = "𐰢"; final String result = nee.translate(input); assertEquals("Failed to escape numeric entities supplementary characters", expected, result); }
/** * <p>Constructs a <code>NumericEntityEscaper</code> between the specified values (inclusive). </p> * * @param codepointLow above which to escape * @param codepointHigh below which to escape * @return the newly created {@code NumericEntityEscaper} instance */ public static NumericEntityEscaper between(final int codepointLow, final int codepointHigh) { return new NumericEntityEscaper(codepointLow, codepointHigh, true); }
/** * <p>Constructs a <code>NumericEntityEscaper</code> outside of the specified values (exclusive). </p> * * @param codepointLow below which to escape * @param codepointHigh above which to escape * @return the newly created {@code NumericEntityEscaper} instance */ public static NumericEntityEscaper outsideOf(final int codepointLow, final int codepointHigh) { return new NumericEntityEscaper(codepointLow, codepointHigh, false); }
/** * <p>Constructs a <code>NumericEntityEscaper</code> outside of the specified values (exclusive). </p> * * @param codepointLow below which to escape * @param codepointHigh above which to escape * @return the newly created {@code NumericEntityEscaper} instance */ public static NumericEntityEscaper outsideOf(final int codepointLow, final int codepointHigh) { return new NumericEntityEscaper(codepointLow, codepointHigh, false); }
/** * <p>Constructs a <code>NumericEntityEscaper</code> outside of the specified values (exclusive). </p> * * @param codepointLow below which to escape * @param codepointHigh above which to escape * @return the newly created {@code NumericEntityEscaper} instance */ public static NumericEntityEscaper outsideOf(final int codepointLow, final int codepointHigh) { return new NumericEntityEscaper(codepointLow, codepointHigh, false); }
/** * <p>Constructs a <code>NumericEntityEscaper</code> between the specified values (inclusive). </p> * * @param codepointLow above which to escape * @param codepointHigh below which to escape * @return the newly created {@code NumericEntityEscaper} instance */ public static NumericEntityEscaper between(final int codepointLow, final int codepointHigh) { return new NumericEntityEscaper(codepointLow, codepointHigh, true); }
/** * <p>Constructs a <code>NumericEntityEscaper</code> between the specified values (inclusive). </p> * * @param codepointLow above which to escape * @param codepointHigh below which to escape * @return the newly created {@code NumericEntityEscaper} instance */ public static NumericEntityEscaper between(final int codepointLow, final int codepointHigh) { return new NumericEntityEscaper(codepointLow, codepointHigh, true); }