com.fasterxml.jackson.core.JsonPointer._parseTail()方法的使用及代码示例

x33g5p2x  于2022-01-22 转载在 其他  
字(12.4k)|赞(0)|评价(0)|浏览(217)

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

JsonPointer._parseTail介绍

暂无

代码示例

代码示例来源:origin: redisson/redisson

/**
 * Factory method that parses given input and construct matching pointer
 * instance, if it represents a valid JSON Pointer: if not, a
 * {@link IllegalArgumentException} is thrown.
 * 
 * @throws IllegalArgumentException Thrown if the input does not present a valid JSON Pointer
 *   expression: currently the only such expression is one that does NOT start with
 *   a slash ('/').
 */
public static JsonPointer compile(String input) throws IllegalArgumentException
{
  // First quick checks for well-known 'empty' pointer
  if ((input == null) || input.length() == 0) {
    return EMPTY;
  }
  // And then quick validity check:
  if (input.charAt(0) != '/') {
    throw new IllegalArgumentException("Invalid input: JSON Pointer expression must start with '/': "+"\""+input+"\"");
  }
  return _parseTail(input);
}

代码示例来源:origin: FasterXML/jackson-core

/**
 * Factory method that parses given input and construct matching pointer
 * instance, if it represents a valid JSON Pointer: if not, a
 * {@link IllegalArgumentException} is thrown.
 * 
 * @throws IllegalArgumentException Thrown if the input does not present a valid JSON Pointer
 *   expression: currently the only such expression is one that does NOT start with
 *   a slash ('/').
 */
public static JsonPointer compile(String input) throws IllegalArgumentException
{
  // First quick checks for well-known 'empty' pointer
  if ((input == null) || input.length() == 0) {
    return EMPTY;
  }
  // And then quick validity check:
  if (input.charAt(0) != '/') {
    throw new IllegalArgumentException("Invalid input: JSON Pointer expression must start with '/': "+"\""+input+"\"");
  }
  return _parseTail(input);
}

代码示例来源:origin: redisson/redisson

protected static JsonPointer _parseTail(String input) {
  final int end = input.length();
  // first char is the contextual slash, skip
  for (int i = 1; i < end; ) {
    char c = input.charAt(i);
    if (c == '/') { // common case, got a segment
      return new JsonPointer(input, input.substring(1, i),
          _parseTail(input.substring(i)));
    }
    ++i;
    // quoting is different; offline this case
    if (c == '~' && i < end) { // possibly, quote
      return _parseQuotedTail(input, i);
    }
    // otherwise, loop on
  }
  // end of the road, no escapes
  return new JsonPointer(input, input.substring(1), EMPTY);
}

代码示例来源:origin: redisson/redisson

/**
 * Method called to parse tail of pointer path, when a potentially
 * escaped character has been seen.
 * 
 * @param input Full input for the tail being parsed
 * @param i Offset to character after tilde
 */
protected static JsonPointer _parseQuotedTail(String input, int i) {
  final int end = input.length();
  StringBuilder sb = new StringBuilder(Math.max(16, end));
  if (i > 2) {
    sb.append(input, 1, i-1);
  }
  _appendEscape(sb, input.charAt(i++));
  while (i < end) {
    char c = input.charAt(i);
    if (c == '/') { // end is nigh!
      return new JsonPointer(input, sb.toString(),
          _parseTail(input.substring(i)));
    }
    ++i;
    if (c == '~' && i < end) {
      _appendEscape(sb, input.charAt(i++));
      continue;
    }
    sb.append(c);
  }
  // end of the road, last segment
  return new JsonPointer(input, sb.toString(), EMPTY);
}

代码示例来源:origin: FasterXML/jackson-core

protected static JsonPointer _parseTail(String input) {
  final int end = input.length();
  // first char is the contextual slash, skip
  for (int i = 1; i < end; ) {
    char c = input.charAt(i);
    if (c == '/') { // common case, got a segment
      return new JsonPointer(input, input.substring(1, i),
          _parseTail(input.substring(i)));
    }
    ++i;
    // quoting is different; offline this case
    if (c == '~' && i < end) { // possibly, quote
      return _parseQuotedTail(input, i);
    }
    // otherwise, loop on
  }
  // end of the road, no escapes
  return new JsonPointer(input, input.substring(1), EMPTY);
}

代码示例来源:origin: FasterXML/jackson-core

/**
 * Method called to parse tail of pointer path, when a potentially
 * escaped character has been seen.
 * 
 * @param input Full input for the tail being parsed
 * @param i Offset to character after tilde
 */
protected static JsonPointer _parseQuotedTail(String input, int i) {
  final int end = input.length();
  StringBuilder sb = new StringBuilder(Math.max(16, end));
  if (i > 2) {
    sb.append(input, 1, i-1);
  }
  _appendEscape(sb, input.charAt(i++));
  while (i < end) {
    char c = input.charAt(i);
    if (c == '/') { // end is nigh!
      return new JsonPointer(input, sb.toString(),
          _parseTail(input.substring(i)));
    }
    ++i;
    if (c == '~' && i < end) {
      _appendEscape(sb, input.charAt(i++));
      continue;
    }
    sb.append(c);
  }
  // end of the road, last segment
  return new JsonPointer(input, sb.toString(), EMPTY);
}

代码示例来源:origin: com.eclipsesource.jaxrs/jersey-all

/**
 * Factory method that parses given input and construct matching pointer
 * instance, if it represents a valid JSON Pointer: if not, a
 * {@link IllegalArgumentException} is thrown.
 * 
 * @throws IllegalArgumentException Thrown if the input does not present a valid JSON Pointer
 *   expression: currently the only such expression is one that does NOT start with
 *   a slash ('/').
 */
public static JsonPointer compile(String input) throws IllegalArgumentException
{
  // First quick checks for well-known 'empty' pointer
  if ((input == null) || input.length() == 0) {
    return EMPTY;
  }
  // And then quick validity check:
  if (input.charAt(0) != '/') {
    throw new IllegalArgumentException("Invalid input: JSON Pointer expression must start with '/': "+"\""+input+"\"");
  }
  return _parseTail(input);
}

代码示例来源:origin: hstaudacher/osgi-jax-rs-connector

/**
 * Factory method that parses given input and construct matching pointer
 * instance, if it represents a valid JSON Pointer: if not, a
 * {@link IllegalArgumentException} is thrown.
 * 
 * @throws IllegalArgumentException Thrown if the input does not present a valid JSON Pointer
 *   expression: currently the only such expression is one that does NOT start with
 *   a slash ('/').
 */
public static JsonPointer compile(String input) throws IllegalArgumentException
{
  // First quick checks for well-known 'empty' pointer
  if ((input == null) || input.length() == 0) {
    return EMPTY;
  }
  // And then quick validity check:
  if (input.charAt(0) != '/') {
    throw new IllegalArgumentException("Invalid input: JSON Pointer expression must start with '/': "+"\""+input+"\"");
  }
  return _parseTail(input);
}

代码示例来源:origin: org.kill-bill.billing/killbill-platform-osgi-bundles-logger

/**
 * Factory method that parses given input and construct matching pointer
 * instance, if it represents a valid JSON Pointer: if not, a
 * {@link IllegalArgumentException} is thrown.
 * 
 * @throws IllegalArgumentException Thrown if the input does not present a valid JSON Pointer
 *   expression: currently the only such expression is one that does NOT start with
 *   a slash ('/').
 */
public static JsonPointer compile(String input) throws IllegalArgumentException
{
  // First quick checks for well-known 'empty' pointer
  if ((input == null) || input.length() == 0) {
    return EMPTY;
  }
  // And then quick validity check:
  if (input.charAt(0) != '/') {
    throw new IllegalArgumentException("Invalid input: JSON Pointer expression must start with '/': "+"\""+input+"\"");
  }
  return _parseTail(input);
}

代码示例来源:origin: Nextdoor/bender

/**
 * Factory method that parses given input and construct matching pointer
 * instance, if it represents a valid JSON Pointer: if not, a
 * {@link IllegalArgumentException} is thrown.
 * 
 * @throws IllegalArgumentException Thrown if the input does not present a valid JSON Pointer
 *   expression: currently the only such expression is one that does NOT start with
 *   a slash ('/').
 */
public static JsonPointer compile(String input) throws IllegalArgumentException
{
  // First quick checks for well-known 'empty' pointer
  if ((input == null) || input.length() == 0) {
    return EMPTY;
  }
  // And then quick validity check:
  if (input.charAt(0) != '/') {
    throw new IllegalArgumentException("Invalid input: JSON Pointer expression must start with '/': "+"\""+input+"\"");
  }
  return _parseTail(input);
}

代码示例来源:origin: hstaudacher/osgi-jax-rs-connector

protected static JsonPointer _parseTail(String input) {
  final int end = input.length();
  // first char is the contextual slash, skip
  for (int i = 1; i < end; ) {
    char c = input.charAt(i);
    if (c == '/') { // common case, got a segment
      return new JsonPointer(input, input.substring(1, i),
          _parseTail(input.substring(i)));
    }
    ++i;
    // quoting is different; offline this case
    if (c == '~' && i < end) { // possibly, quote
      return _parseQuotedTail(input, i);
    }
    // otherwise, loop on
  }
  // end of the road, no escapes
  return new JsonPointer(input, input.substring(1), EMPTY);
}

代码示例来源:origin: org.kill-bill.billing/killbill-platform-osgi-bundles-logger

protected static JsonPointer _parseTail(String input) {
  final int end = input.length();
  // first char is the contextual slash, skip
  for (int i = 1; i < end; ) {
    char c = input.charAt(i);
    if (c == '/') { // common case, got a segment
      return new JsonPointer(input, input.substring(1, i),
          _parseTail(input.substring(i)));
    }
    ++i;
    // quoting is different; offline this case
    if (c == '~' && i < end) { // possibly, quote
      return _parseQuotedTail(input, i);
    }
    // otherwise, loop on
  }
  // end of the road, no escapes
  return new JsonPointer(input, input.substring(1), EMPTY);
}

代码示例来源:origin: com.eclipsesource.jaxrs/jersey-all

protected static JsonPointer _parseTail(String input) {
  final int end = input.length();
  // first char is the contextual slash, skip
  for (int i = 1; i < end; ) {
    char c = input.charAt(i);
    if (c == '/') { // common case, got a segment
      return new JsonPointer(input, input.substring(1, i),
          _parseTail(input.substring(i)));
    }
    ++i;
    // quoting is different; offline this case
    if (c == '~' && i < end) { // possibly, quote
      return _parseQuotedTail(input, i);
    }
    // otherwise, loop on
  }
  // end of the road, no escapes
  return new JsonPointer(input, input.substring(1), EMPTY);
}

代码示例来源:origin: Nextdoor/bender

protected static JsonPointer _parseTail(String input) {
  final int end = input.length();
  // first char is the contextual slash, skip
  for (int i = 1; i < end; ) {
    char c = input.charAt(i);
    if (c == '/') { // common case, got a segment
      return new JsonPointer(input, input.substring(1, i),
          _parseTail(input.substring(i)));
    }
    ++i;
    // quoting is different; offline this case
    if (c == '~' && i < end) { // possibly, quote
      return _parseQuotedTail(input, i);
    }
    // otherwise, loop on
  }
  // end of the road, no escapes
  return new JsonPointer(input, input.substring(1), EMPTY);
}

代码示例来源:origin: Nextdoor/bender

/**
 * Method called to parse tail of pointer path, when a potentially
 * escaped character has been seen.
 * 
 * @param input Full input for the tail being parsed
 * @param i Offset to character after tilde
 */
protected static JsonPointer _parseQuotedTail(String input, int i) {
  final int end = input.length();
  StringBuilder sb = new StringBuilder(Math.max(16, end));
  if (i > 2) {
    sb.append(input, 1, i-1);
  }
  _appendEscape(sb, input.charAt(i++));
  while (i < end) {
    char c = input.charAt(i);
    if (c == '/') { // end is nigh!
      return new JsonPointer(input, sb.toString(),
          _parseTail(input.substring(i)));
    }
    ++i;
    if (c == '~' && i < end) {
      _appendEscape(sb, input.charAt(i++));
      continue;
    }
    sb.append(c);
  }
  // end of the road, last segment
  return new JsonPointer(input, sb.toString(), EMPTY);
}

代码示例来源:origin: com.eclipsesource.jaxrs/jersey-all

/**
 * Method called to parse tail of pointer path, when a potentially
 * escaped character has been seen.
 * 
 * @param input Full input for the tail being parsed
 * @param i Offset to character after tilde
 */
protected static JsonPointer _parseQuotedTail(String input, int i) {
  final int end = input.length();
  StringBuilder sb = new StringBuilder(Math.max(16, end));
  if (i > 2) {
    sb.append(input, 1, i-1);
  }
  _appendEscape(sb, input.charAt(i++));
  while (i < end) {
    char c = input.charAt(i);
    if (c == '/') { // end is nigh!
      return new JsonPointer(input, sb.toString(),
          _parseTail(input.substring(i)));
    }
    ++i;
    if (c == '~' && i < end) {
      _appendEscape(sb, input.charAt(i++));
      continue;
    }
    sb.append(c);
  }
  // end of the road, last segment
  return new JsonPointer(input, sb.toString(), EMPTY);
}

代码示例来源:origin: org.kill-bill.billing/killbill-platform-osgi-bundles-logger

/**
 * Method called to parse tail of pointer path, when a potentially
 * escaped character has been seen.
 * 
 * @param input Full input for the tail being parsed
 * @param i Offset to character after tilde
 */
protected static JsonPointer _parseQuotedTail(String input, int i) {
  final int end = input.length();
  StringBuilder sb = new StringBuilder(Math.max(16, end));
  if (i > 2) {
    sb.append(input, 1, i-1);
  }
  _appendEscape(sb, input.charAt(i++));
  while (i < end) {
    char c = input.charAt(i);
    if (c == '/') { // end is nigh!
      return new JsonPointer(input, sb.toString(),
          _parseTail(input.substring(i)));
    }
    ++i;
    if (c == '~' && i < end) {
      _appendEscape(sb, input.charAt(i++));
      continue;
    }
    sb.append(c);
  }
  // end of the road, last segment
  return new JsonPointer(input, sb.toString(), EMPTY);
}

代码示例来源:origin: hstaudacher/osgi-jax-rs-connector

/**
 * Method called to parse tail of pointer path, when a potentially
 * escaped character has been seen.
 * 
 * @param input Full input for the tail being parsed
 * @param i Offset to character after tilde
 */
protected static JsonPointer _parseQuotedTail(String input, int i) {
  final int end = input.length();
  StringBuilder sb = new StringBuilder(Math.max(16, end));
  if (i > 2) {
    sb.append(input, 1, i-1);
  }
  _appendEscape(sb, input.charAt(i++));
  while (i < end) {
    char c = input.charAt(i);
    if (c == '/') { // end is nigh!
      return new JsonPointer(input, sb.toString(),
          _parseTail(input.substring(i)));
    }
    ++i;
    if (c == '~' && i < end) {
      _appendEscape(sb, input.charAt(i++));
      continue;
    }
    sb.append(c);
  }
  // end of the road, last segment
  return new JsonPointer(input, sb.toString(), EMPTY);
}

相关文章