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

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

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

Reference.hasScheme介绍

[英]Indicates if this reference has a scheme component.
[中]指示此引用是否包含方案组件。

代码示例

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

/**
 * Returns the scheme component.<br>
 * Note that no URI decoding is done by this method.
 * 
 * @return The scheme component.
 */
public String getScheme() {
  if (hasScheme()) {
    // Scheme found
    return this.internalRef.substring(0, this.schemeIndex);
  }
  // No scheme found
  return null;
}

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

/**
 * Returns the scheme component.<br>
 * Note that no URI decoding is done by this method.
 * 
 * @return The scheme component.
 */
public String getScheme() {
  if (hasScheme()) {
    // Scheme found
    return this.internalRef.substring(0, this.schemeIndex);
  }
  // No scheme found
  return null;
}

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

/**
 * Returns the scheme component.<br>
 * Note that no URI decoding is done by this method.
 * 
 * @return The scheme component.
 */
public String getScheme() {
  if (hasScheme()) {
    // Scheme found
    return this.internalRef.substring(0, this.schemeIndex);
  }
  // No scheme found
  return null;
}

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

/**
 * Returns the scheme specific part.<br>
 * Note that no URI decoding is done by this method.
 * 
 * @return The scheme specific part.
 */
public String getSchemeSpecificPart() {
  String result = null;
  if (hasScheme()) {
    // Scheme found
    if (hasFragment()) {
      // Fragment found
      result = this.internalRef.substring(this.schemeIndex + 1,
          this.fragmentIndex);
    } else {
      // No fragment found
      result = this.internalRef.substring(this.schemeIndex + 1);
    }
  }
  return result;
}

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

/**
 * Returns the scheme specific part.<br>
 * Note that no URI decoding is done by this method.
 * 
 * @return The scheme specific part.
 */
public String getSchemeSpecificPart() {
  String result = null;
  if (hasScheme()) {
    // Scheme found
    if (hasFragment()) {
      // Fragment found
      result = this.internalRef.substring(this.schemeIndex + 1,
          this.fragmentIndex);
    } else {
      // No fragment found
      result = this.internalRef.substring(this.schemeIndex + 1);
    }
  }
  return result;
}

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

/**
 * Returns the scheme specific part.<br>
 * Note that no URI decoding is done by this method.
 * 
 * @return The scheme specific part.
 */
public String getSchemeSpecificPart() {
  String result = null;
  if (hasScheme()) {
    // Scheme found
    if (hasFragment()) {
      // Fragment found
      result = this.internalRef.substring(this.schemeIndex + 1,
          this.fragmentIndex);
    } else {
      // No fragment found
      result = this.internalRef.substring(this.schemeIndex + 1);
    }
  }
  return result;
}

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

if (hasScheme()) {

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

if (hasScheme()) {

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

if (hasScheme()) {

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

if (hasScheme()) {

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

if (hasScheme()) {

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

if (hasScheme()) {

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

if (hasScheme()) {

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

if (hasScheme()) {

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

if (hasScheme()) {

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

/**
 * Sets the relative part for relative references only.
 * 
 * @param relativePart
 *            The relative part to set.
 */
public void setRelativePart(String relativePart) {
  relativePart = encodeInvalidCharacters(relativePart);
  if (relativePart == null) {
    relativePart = "";
  }
  if (!hasScheme()) {
    // This is a relative reference, no scheme found
    if (hasQuery()) {
      // Query found
      this.internalRef = relativePart
          + this.internalRef.substring(this.queryIndex);
    } else if (hasFragment()) {
      // Fragment found
      this.internalRef = relativePart
          + this.internalRef.substring(this.fragmentIndex);
    } else {
      // No fragment found
      this.internalRef = relativePart;
    }
  }
  updateIndexes();
}

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

/**
 * Sets the relative part for relative references only.
 * 
 * @param relativePart
 *            The relative part to set.
 */
public void setRelativePart(String relativePart) {
  relativePart = encodeInvalidCharacters(relativePart);
  if (relativePart == null) {
    relativePart = "";
  }
  if (!hasScheme()) {
    // This is a relative reference, no scheme found
    if (hasQuery()) {
      // Query found
      this.internalRef = relativePart
          + this.internalRef.substring(this.queryIndex);
    } else if (hasFragment()) {
      // Fragment found
      this.internalRef = relativePart
          + this.internalRef.substring(this.fragmentIndex);
    } else {
      // No fragment found
      this.internalRef = relativePart;
    }
  }
  updateIndexes();
}

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

/**
 * Sets the relative part for relative references only.
 * 
 * @param relativePart
 *            The relative part to set.
 */
public void setRelativePart(String relativePart) {
  relativePart = encodeInvalidCharacters(relativePart);
  if (relativePart == null) {
    relativePart = "";
  }
  if (!hasScheme()) {
    // This is a relative reference, no scheme found
    if (hasQuery()) {
      // Query found
      this.internalRef = relativePart
          + this.internalRef.substring(this.queryIndex);
    } else if (hasFragment()) {
      // Fragment found
      this.internalRef = relativePart
          + this.internalRef.substring(this.fragmentIndex);
    } else {
      // No fragment found
      this.internalRef = relativePart;
    }
  }
  updateIndexes();
}

相关文章

Reference类方法