org.restlet.data.Reference.isValid()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(1.6k)|赞(0)|评价(0)|浏览(110)

本文整理了Java中org.restlet.data.Reference.isValid方法的一些代码示例,展示了Reference.isValid的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Reference.isValid方法的具体详情如下:
包路径:org.restlet.data.Reference
类名称:Reference
方法名:isValid

Reference.isValid介绍

[英]Indicates if the given character is a valid URI character.
[中]指示给定字符是否为有效的URI字符。

代码示例

代码示例来源:origin: org.restlet/org.restlet

if (!isValid(uriRef.charAt(i))) {
  valid = false;
  Context.getCurrentLogger().fine(
  if (isValid(uriRef.charAt(i))) {
    sb.append(uriRef.charAt(i));
  } else {

代码示例来源:origin: org.restlet.jee/org.restlet.ext.jaxrs

/**
 * Checks / encodes all chars of the given char sequence.
 * 
 * @param string
 * @param encode
 *            true, if the value should be encoded, or false if not.
 * @return the enoced string (if it should be encoded)
 * @throws IllegalArgumentException
 *             if encode is false and at least one character of the
 *             CharSequence is invalid.
 */
public static String all(CharSequence string, boolean encode)
    throws IllegalArgumentException {
  final int length = string.length();
  final StringBuilder stb = new StringBuilder(length);
  for (int i = 0; i < length; i++) {
    final char c = string.charAt(i);
    if (c == '%') {
      processPercent(i, encode, string, stb);
    } else if (Reference.isValid(c)) {
      stb.append(c);
    } else {
      toHexOrReject(c, stb, encode);
    }
  }
  return stb.toString();
}

代码示例来源:origin: DeviceConnect/DeviceConnect-Android

if (!isValid(uriRef.charAt(i))) {
  valid = false;
  Context.getCurrentLogger().fine(
  if (isValid(uriRef.charAt(i))) {
    if ((uriRef.charAt(i) == '%')
        && (i > uriRef.length() - 2)) {

代码示例来源:origin: org.restlet.osgi/org.restlet

if (!isValid(uriRef.charAt(i))) {
  valid = false;
  Context.getCurrentLogger().fine(
  if (isValid(uriRef.charAt(i))) {
    if ((uriRef.charAt(i) == '%')
        && (i > uriRef.length() - 2)) {

相关文章

Reference类方法