1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194
|
Description: Preserves the CharMatcher legacy constants which were removed in Guava 26.
Author: Emmanuel Bourg <ebourg@apache.org>
Forwarded: not-needed
--- a/guava/src/com/google/common/base/CharMatcher.java
+++ b/guava/src/com/google/common/base/CharMatcher.java
@@ -290,6 +290,188 @@
return SingleWidth.INSTANCE;
}
+ // Legacy constants
+
+ /**
+ * Determines whether a character is whitespace according to the latest Unicode
+ * standard, as illustrated
+ * <a
+ // href="http://unicode.org/cldr/utility/list-unicodeset.jsp?a=%5Cp%7Bwhitespace%7D">here</a>.
+ * This is not the same definition used by other Java APIs. (See a
+ * <a href="https://goo.gl/Y6SLWx">comparison of several definitions of
+ * "whitespace"</a>.)
+ *
+ * <p><b>Note:</b> as the Unicode definition evolves, we will modify this constant
+ * to keep it up to date.
+ *
+ * @deprecated Use {@link #whitespace()} instead. This constant is scheduled to be
+ * removed in June 2018.
+ */
+ @com.google.common.annotations.Beta
+ @Deprecated
+ public static final CharMatcher WHITESPACE = whitespace();
+
+ /**
+ * Determines whether a character is a breaking whitespace (that is, a whitespace
+ * which can be interpreted as a break between words for formatting purposes). See
+ * {@link #whitespace} for a discussion of that term.
+ *
+ * @since 2.0
+ * @deprecated Use {@link #breakingWhitespace()} instead. This constant is scheduled
+ * to be removed in June 2018.
+ */
+ @com.google.common.annotations.Beta
+ @Deprecated
+ public static final CharMatcher BREAKING_WHITESPACE = breakingWhitespace();
+
+ /**
+ * Determines whether a character is ASCII, meaning that its code point is less than
+ * 128.
+ *
+ * @deprecated Use {@link #ascii()} instead. This constant is scheduled to be
+ * removed in June 2018.
+ */
+ @com.google.common.annotations.Beta
+ @Deprecated
+ public static final CharMatcher ASCII = ascii();
+
+ /**
+ * Determines whether a character is a digit according to
+ * <a href="http://unicode.org/cldr/utility/list-unicodeset.jsp?a=%5Cp%7Bdigit%7D">
+ * Unicode</a>. If you only care to match ASCII digits, you can use
+ * {@code inRange('0', '9')}.
+ *
+ * @deprecated Many digits are supplementary characters; see the class
+ * documentation. If you need to use this, use {@link #digit()} instead. This
+ * . constant is scheduled to be removed in June 2018.
+ */
+ @com.google.common.annotations.Beta
+ @Deprecated
+ public static final CharMatcher DIGIT = digit();
+
+ /**
+ * Determines whether a character is a digit according to
+ * {@linkplain Character#isDigit(char) Java's definition}. If you only care to match
+ * ASCII digits, you can use {@code inRange('0', '9')}.
+ *
+ * @deprecated Many digits are supplementary characters; see the class
+ * documentation. If you need to use this, use {@link #javaDigit()} instead.
+ * This constant is scheduled to be removed in June 2018.
+ */
+ @com.google.common.annotations.Beta
+ @Deprecated
+ public static final CharMatcher JAVA_DIGIT = javaDigit();
+
+ /**
+ * Determines whether a character is a letter according to
+ * {@linkplain Character#isLetter(char) Java's definition}. If you only care to
+ * match letters of the Latin alphabet, you can use
+ * {@code inRange('a', 'z').or(inRange('A', 'Z'))}.
+ *
+ * @deprecated Most letters are supplementary characters; see the class
+ * documentation. If you need to use this, use {@link #javaLetter()} instead.
+ * This constant is scheduled to be removed in June 2018.
+ */
+ @com.google.common.annotations.Beta
+ @Deprecated
+ public static final CharMatcher JAVA_LETTER = javaLetter();
+
+ /**
+ * Determines whether a character is a letter or digit according to
+ * {@linkplain Character#isLetterOrDigit(char) Java's definition}.
+ *
+ * @deprecated Most letters and digits are supplementary characters; see the class
+ * documentation. If you need to use this, use {@link #javaLetterOrDigit()}
+ * instead. This constant is scheduled to be removed in June 2018.
+ */
+ @com.google.common.annotations.Beta
+ @Deprecated
+ public static final CharMatcher JAVA_LETTER_OR_DIGIT = javaLetterOrDigit();
+
+ /**
+ * Determines whether a character is upper case according to
+ * {@linkplain Character#isUpperCase(char) Java's definition}.
+ *
+ * @deprecated Some uppercase letters are supplementary characters; see the class
+ * documentation. If you need to use this, use {@link #javaUpperCase()} instead.
+ * This constant is scheduled to be removed in June 2018.
+ */
+ @com.google.common.annotations.Beta
+ @Deprecated
+ public static final CharMatcher JAVA_UPPER_CASE = javaUpperCase();
+
+ /**
+ * Determines whether a character is lower case according to
+ * {@linkplain Character#isLowerCase(char) Java's definition}.
+ *
+ * @deprecated Some lowercase letters are supplementary characters; see the class
+ * documentation. If you need to use this, use {@link #javaLowerCase()} instead.
+ * This constant is scheduled to be removed in June 2018.
+ */
+ @com.google.common.annotations.Beta
+ @Deprecated
+ public static final CharMatcher JAVA_LOWER_CASE = javaLowerCase();
+
+ /**
+ * Determines whether a character is an ISO control character as specified by
+ * {@link Character#isISOControl(char)}.
+ *
+ * @deprecated Use {@link #javaIsoControl()} instead. This constant is scheduled to
+ * be removed in June 2018.
+ */
+ @com.google.common.annotations.Beta
+ @Deprecated
+ public static final CharMatcher JAVA_ISO_CONTROL = javaIsoControl();
+
+ /**
+ * Determines whether a character is invisible; that is, if its Unicode category is
+ * any of SPACE_SEPARATOR, LINE_SEPARATOR, PARAGRAPH_SEPARATOR, CONTROL, FORMAT,
+ * SURROGATE, and PRIVATE_USE according to ICU4J.
+ *
+ * @deprecated Most invisible characters are supplementary characters; see the class
+ * documentation. If you need to use this, use {@link #invisible()} instead.
+ * This constant is scheduled to be removed in June 2018.
+ */
+ @com.google.common.annotations.Beta
+ @Deprecated
+ public static final CharMatcher INVISIBLE = invisible();
+
+ /**
+ * Determines whether a character is single-width (not double-width). When in doubt,
+ * this matcher errs on the side of returning {@code false} (that is, it tends to
+ * assume a character is double-width).
+ *
+ * <p><b>Note:</b> as the reference file evolves, we will modify this constant to
+ * keep it up to date.
+ *
+ * @deprecated Many such characters are supplementary characters; see the class
+ * documentation. If you need to use this, use {@link #singleWidth()} instead.
+ * This constant is scheduled to be removed in June 2018.
+ */
+ @com.google.common.annotations.Beta
+ @Deprecated
+ public static final CharMatcher SINGLE_WIDTH = singleWidth();
+
+ /**
+ * Matches any character.
+ *
+ * @deprecated Use {@link #any()} instead. This constant is scheduled to be
+ * removed in June 2018.
+ */
+ @com.google.common.annotations.Beta
+ @Deprecated
+ public static final CharMatcher ANY = any();
+
+ /**
+ * Matches no characters.
+ *
+ * @deprecated Use {@link #none()} instead. This constant is scheduled to be
+ * removed in June 2018.
+ */
+ @com.google.common.annotations.Beta
+ @Deprecated
+ public static final CharMatcher NONE = none();
+
// Static factories
/** Returns a {@code char} matcher that matches only one specified BMP character. */
|