Java Code Examples for java.lang.Character#isISOControl()
The following examples show how to use
java.lang.Character#isISOControl() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: URI.java From jdk1.8-source-analysis with Apache License 2.0 | 6 votes |
private int scanEscape(int start, int n, char first) throws URISyntaxException { int p = start; char c = first; if (c == '%') { // Process escape pair if ((p + 3 <= n) && match(charAt(p + 1), L_HEX, H_HEX) && match(charAt(p + 2), L_HEX, H_HEX)) { return p + 3; } fail("Malformed escape pair", p); } else if ((c > 128) && !Character.isSpaceChar(c) && !Character.isISOControl(c)) { // Allow unescaped but visible non-US-ASCII chars return p + 1; } return p; }
Example 2
Source File: URI.java From openjdk-jdk9 with GNU General Public License v2.0 | 6 votes |
private int scanEscape(int start, int n, char first) throws URISyntaxException { int p = start; char c = first; if (c == '%') { // Process escape pair if ((p + 3 <= n) && match(input.charAt(p + 1), L_HEX, H_HEX) && match(input.charAt(p + 2), L_HEX, H_HEX)) { return p + 3; } fail("Malformed escape pair", p); } else if ((c > 128) && !Character.isSpaceChar(c) && !Character.isISOControl(c)) { // Allow unescaped but visible non-US-ASCII chars return p + 1; } return p; }
Example 3
Source File: URI.java From Bytecoder with Apache License 2.0 | 6 votes |
private int scanEscape(int start, int n, char first) throws URISyntaxException { int p = start; char c = first; if (c == '%') { // Process escape pair if ((p + 3 <= n) && match(input.charAt(p + 1), L_HEX, H_HEX) && match(input.charAt(p + 2), L_HEX, H_HEX)) { return p + 3; } fail("Malformed escape pair", p); } else if ((c > 128) && !Character.isSpaceChar(c) && !Character.isISOControl(c)) { // Allow unescaped but visible non-US-ASCII chars return p + 1; } return p; }
Example 4
Source File: URI.java From openjdk-8 with GNU General Public License v2.0 | 6 votes |
private int scanEscape(int start, int n, char first) throws URISyntaxException { int p = start; char c = first; if (c == '%') { // Process escape pair if ((p + 3 <= n) && match(charAt(p + 1), L_HEX, H_HEX) && match(charAt(p + 2), L_HEX, H_HEX)) { return p + 3; } fail("Malformed escape pair", p); } else if ((c > 128) && !Character.isSpaceChar(c) && !Character.isISOControl(c)) { // Allow unescaped but visible non-US-ASCII chars return p + 1; } return p; }
Example 5
Source File: URI.java From jdk8u_jdk with GNU General Public License v2.0 | 6 votes |
private int scanEscape(int start, int n, char first) throws URISyntaxException { int p = start; char c = first; if (c == '%') { // Process escape pair if ((p + 3 <= n) && match(charAt(p + 1), L_HEX, H_HEX) && match(charAt(p + 2), L_HEX, H_HEX)) { return p + 3; } fail("Malformed escape pair", p); } else if ((c > 128) && !Character.isSpaceChar(c) && !Character.isISOControl(c)) { // Allow unescaped but visible non-US-ASCII chars return p + 1; } return p; }
Example 6
Source File: URI.java From j2objc with Apache License 2.0 | 6 votes |
private int scanEscape(int start, int n, char first) throws URISyntaxException { int p = start; char c = first; if (c == '%') { // Process escape pair if ((p + 3 <= n) && match(charAt(p + 1), L_HEX, H_HEX) && match(charAt(p + 2), L_HEX, H_HEX)) { return p + 3; } fail("Malformed escape pair", p); } else if ((c > 128) && !Character.isSpaceChar(c) && !Character.isISOControl(c)) { // Allow unescaped but visible non-US-ASCII chars return p + 1; } return p; }
Example 7
Source File: URI.java From jdk8u60 with GNU General Public License v2.0 | 6 votes |
private int scanEscape(int start, int n, char first) throws URISyntaxException { int p = start; char c = first; if (c == '%') { // Process escape pair if ((p + 3 <= n) && match(charAt(p + 1), L_HEX, H_HEX) && match(charAt(p + 2), L_HEX, H_HEX)) { return p + 3; } fail("Malformed escape pair", p); } else if ((c > 128) && !Character.isSpaceChar(c) && !Character.isISOControl(c)) { // Allow unescaped but visible non-US-ASCII chars return p + 1; } return p; }
Example 8
Source File: URI.java From jdk8u-dev-jdk with GNU General Public License v2.0 | 6 votes |
private int scanEscape(int start, int n, char first) throws URISyntaxException { int p = start; char c = first; if (c == '%') { // Process escape pair if ((p + 3 <= n) && match(charAt(p + 1), L_HEX, H_HEX) && match(charAt(p + 2), L_HEX, H_HEX)) { return p + 3; } fail("Malformed escape pair", p); } else if ((c > 128) && !Character.isSpaceChar(c) && !Character.isISOControl(c)) { // Allow unescaped but visible non-US-ASCII chars return p + 1; } return p; }
Example 9
Source File: URI.java From jdk8u-jdk with GNU General Public License v2.0 | 6 votes |
private int scanEscape(int start, int n, char first) throws URISyntaxException { int p = start; char c = first; if (c == '%') { // Process escape pair if ((p + 3 <= n) && match(charAt(p + 1), L_HEX, H_HEX) && match(charAt(p + 2), L_HEX, H_HEX)) { return p + 3; } fail("Malformed escape pair", p); } else if ((c > 128) && !Character.isSpaceChar(c) && !Character.isISOControl(c)) { // Allow unescaped but visible non-US-ASCII chars return p + 1; } return p; }
Example 10
Source File: URI.java From openjdk-8-source with GNU General Public License v2.0 | 6 votes |
private int scanEscape(int start, int n, char first) throws URISyntaxException { int p = start; char c = first; if (c == '%') { // Process escape pair if ((p + 3 <= n) && match(charAt(p + 1), L_HEX, H_HEX) && match(charAt(p + 2), L_HEX, H_HEX)) { return p + 3; } fail("Malformed escape pair", p); } else if ((c > 128) && !Character.isSpaceChar(c) && !Character.isISOControl(c)) { // Allow unescaped but visible non-US-ASCII chars return p + 1; } return p; }
Example 11
Source File: URI.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
private static String quote(String s, long lowMask, long highMask) { int n = s.length(); StringBuffer sb = null; boolean allowNonASCII = ((lowMask & L_ESCAPED) != 0); for (int i = 0; i < s.length(); i++) { char c = s.charAt(i); if (c < '\u0080') { if (!match(c, lowMask, highMask)) { if (sb == null) { sb = new StringBuffer(); sb.append(s.substring(0, i)); } appendEscape(sb, (byte)c); } else { if (sb != null) sb.append(c); } } else if (allowNonASCII && (Character.isSpaceChar(c) || Character.isISOControl(c))) { if (sb == null) { sb = new StringBuffer(); sb.append(s.substring(0, i)); } appendEncoded(sb, c); } else { if (sb != null) sb.append(c); } } return (sb == null) ? s : sb.toString(); }
Example 12
Source File: URI.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
private static String quote(String s, long lowMask, long highMask) { int n = s.length(); StringBuffer sb = null; boolean allowNonASCII = ((lowMask & L_ESCAPED) != 0); for (int i = 0; i < s.length(); i++) { char c = s.charAt(i); if (c < '\u0080') { if (!match(c, lowMask, highMask)) { if (sb == null) { sb = new StringBuffer(); sb.append(s.substring(0, i)); } appendEscape(sb, (byte)c); } else { if (sb != null) sb.append(c); } } else if (allowNonASCII && (Character.isSpaceChar(c) || Character.isISOControl(c))) { if (sb == null) { sb = new StringBuffer(); sb.append(s.substring(0, i)); } appendEncoded(sb, c); } else { if (sb != null) sb.append(c); } } return (sb == null) ? s : sb.toString(); }
Example 13
Source File: URI.java From jdk8u-jdk with GNU General Public License v2.0 | 5 votes |
private static String quote(String s, long lowMask, long highMask) { int n = s.length(); StringBuffer sb = null; boolean allowNonASCII = ((lowMask & L_ESCAPED) != 0); for (int i = 0; i < s.length(); i++) { char c = s.charAt(i); if (c < '\u0080') { if (!match(c, lowMask, highMask)) { if (sb == null) { sb = new StringBuffer(); sb.append(s.substring(0, i)); } appendEscape(sb, (byte)c); } else { if (sb != null) sb.append(c); } } else if (allowNonASCII && (Character.isSpaceChar(c) || Character.isISOControl(c))) { if (sb == null) { sb = new StringBuffer(); sb.append(s.substring(0, i)); } appendEncoded(sb, c); } else { if (sb != null) sb.append(c); } } return (sb == null) ? s : sb.toString(); }
Example 14
Source File: URI.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
private static String quote(String s, long lowMask, long highMask) { int n = s.length(); StringBuffer sb = null; boolean allowNonASCII = ((lowMask & L_ESCAPED) != 0); for (int i = 0; i < s.length(); i++) { char c = s.charAt(i); if (c < '\u0080') { if (!match(c, lowMask, highMask)) { if (sb == null) { sb = new StringBuffer(); sb.append(s.substring(0, i)); } appendEscape(sb, (byte)c); } else { if (sb != null) sb.append(c); } } else if (allowNonASCII && (Character.isSpaceChar(c) || Character.isISOControl(c))) { if (sb == null) { sb = new StringBuffer(); sb.append(s.substring(0, i)); } appendEncoded(sb, c); } else { if (sb != null) sb.append(c); } } return (sb == null) ? s : sb.toString(); }
Example 15
Source File: URI.java From jdk8u_jdk with GNU General Public License v2.0 | 5 votes |
private static String quote(String s, long lowMask, long highMask) { int n = s.length(); StringBuffer sb = null; boolean allowNonASCII = ((lowMask & L_ESCAPED) != 0); for (int i = 0; i < s.length(); i++) { char c = s.charAt(i); if (c < '\u0080') { if (!match(c, lowMask, highMask)) { if (sb == null) { sb = new StringBuffer(); sb.append(s.substring(0, i)); } appendEscape(sb, (byte)c); } else { if (sb != null) sb.append(c); } } else if (allowNonASCII && (Character.isSpaceChar(c) || Character.isISOControl(c))) { if (sb == null) { sb = new StringBuffer(); sb.append(s.substring(0, i)); } appendEncoded(sb, c); } else { if (sb != null) sb.append(c); } } return (sb == null) ? s : sb.toString(); }
Example 16
Source File: URI.java From Bytecoder with Apache License 2.0 | 5 votes |
private static String quote(String s, long lowMask, long highMask) { StringBuilder sb = null; boolean allowNonASCII = ((lowMask & L_ESCAPED) != 0); for (int i = 0; i < s.length(); i++) { char c = s.charAt(i); if (c < '\u0080') { if (!match(c, lowMask, highMask)) { if (sb == null) { sb = new StringBuilder(); sb.append(s, 0, i); } appendEscape(sb, (byte)c); } else { if (sb != null) sb.append(c); } } else if (allowNonASCII && (Character.isSpaceChar(c) || Character.isISOControl(c))) { if (sb == null) { sb = new StringBuilder(); sb.append(s, 0, i); } appendEncoded(sb, c); } else { if (sb != null) sb.append(c); } } return (sb == null) ? s : sb.toString(); }
Example 17
Source File: URI.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
private static String quote(String s, long lowMask, long highMask) { StringBuilder sb = null; boolean allowNonASCII = ((lowMask & L_ESCAPED) != 0); for (int i = 0; i < s.length(); i++) { char c = s.charAt(i); if (c < '\u0080') { if (!match(c, lowMask, highMask)) { if (sb == null) { sb = new StringBuilder(); sb.append(s, 0, i); } appendEscape(sb, (byte)c); } else { if (sb != null) sb.append(c); } } else if (allowNonASCII && (Character.isSpaceChar(c) || Character.isISOControl(c))) { if (sb == null) { sb = new StringBuilder(); sb.append(s, 0, i); } appendEncoded(sb, c); } else { if (sb != null) sb.append(c); } } return (sb == null) ? s : sb.toString(); }
Example 18
Source File: URI.java From jdk1.8-source-analysis with Apache License 2.0 | 5 votes |
private static String quote(String s, long lowMask, long highMask) { int n = s.length(); StringBuffer sb = null; boolean allowNonASCII = ((lowMask & L_ESCAPED) != 0); for (int i = 0; i < s.length(); i++) { char c = s.charAt(i); if (c < '\u0080') { if (!match(c, lowMask, highMask)) { if (sb == null) { sb = new StringBuffer(); sb.append(s.substring(0, i)); } appendEscape(sb, (byte)c); } else { if (sb != null) sb.append(c); } } else if (allowNonASCII && (Character.isSpaceChar(c) || Character.isISOControl(c))) { if (sb == null) { sb = new StringBuffer(); sb.append(s.substring(0, i)); } appendEncoded(sb, c); } else { if (sb != null) sb.append(c); } } return (sb == null) ? s : sb.toString(); }
Example 19
Source File: URI.java From jdk8u-jdk with GNU General Public License v2.0 | 5 votes |
private static String quote(String s, long lowMask, long highMask) { int n = s.length(); StringBuffer sb = null; boolean allowNonASCII = ((lowMask & L_ESCAPED) != 0); for (int i = 0; i < s.length(); i++) { char c = s.charAt(i); if (c < '\u0080') { if (!match(c, lowMask, highMask)) { if (sb == null) { sb = new StringBuffer(); sb.append(s.substring(0, i)); } appendEscape(sb, (byte)c); } else { if (sb != null) sb.append(c); } } else if (allowNonASCII && (Character.isSpaceChar(c) || Character.isISOControl(c))) { if (sb == null) { sb = new StringBuffer(); sb.append(s.substring(0, i)); } appendEncoded(sb, c); } else { if (sb != null) sb.append(c); } } return (sb == null) ? s : sb.toString(); }
Example 20
Source File: URI.java From jdk8u-dev-jdk with GNU General Public License v2.0 | 5 votes |
private static String quote(String s, long lowMask, long highMask) { int n = s.length(); StringBuffer sb = null; boolean allowNonASCII = ((lowMask & L_ESCAPED) != 0); for (int i = 0; i < s.length(); i++) { char c = s.charAt(i); if (c < '\u0080') { if (!match(c, lowMask, highMask)) { if (sb == null) { sb = new StringBuffer(); sb.append(s.substring(0, i)); } appendEscape(sb, (byte)c); } else { if (sb != null) sb.append(c); } } else if (allowNonASCII && (Character.isSpaceChar(c) || Character.isISOControl(c))) { if (sb == null) { sb = new StringBuffer(); sb.append(s.substring(0, i)); } appendEncoded(sb, c); } else { if (sb != null) sb.append(c); } } return (sb == null) ? s : sb.toString(); }