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

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

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

JsonPointer.<init>介绍

[英]Constructor used for creating "empty" instance, used to represent state that matches current node.
[中]用于创建“空”实例的构造函数,用于表示与当前节点匹配的状态。

代码示例

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

protected JsonPointer _constructHead(int suffixLength, JsonPointer last)
{
  if (this == last) {
    return EMPTY;
  }
  JsonPointer next = _nextSegment;
  String str = _asString;
  return new JsonPointer(str.substring(0, str.length() - suffixLength), _matchingPropertyName,
      _matchingElementIndex, next._constructHead(suffixLength, last));
}

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

protected JsonPointer _constructHead()
{
  // ok; find out who we are to drop
  JsonPointer last = last();
  if (last == this) {
    return EMPTY;
  }
  // and from that, length of suffix to drop
  int suffixLength = last._asString.length();
  JsonPointer next = _nextSegment;
  return new JsonPointer(_asString.substring(0, _asString.length() - suffixLength), _matchingPropertyName,
      _matchingElementIndex, next._constructHead(suffixLength, last));
}

代码示例来源: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: FasterXML/jackson-core

protected JsonPointer _constructHead(int suffixLength, JsonPointer last)
{
  if (this == last) {
    return EMPTY;
  }
  JsonPointer next = _nextSegment;
  String str = _asString;
  return new JsonPointer(str.substring(0, str.length() - suffixLength), _matchingPropertyName,
      _matchingElementIndex, next._constructHead(suffixLength, last));
}

代码示例来源: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

protected JsonPointer _constructHead()
{
  // ok; find out who we are to drop
  JsonPointer last = last();
  if (last == this) {
    return EMPTY;
  }
  // and from that, length of suffix to drop
  int suffixLength = last._asString.length();
  JsonPointer next = _nextSegment;
  return new JsonPointer(_asString.substring(0, _asString.length() - suffixLength), _matchingPropertyName,
      _matchingElementIndex, next._constructHead(suffixLength, last));
}

代码示例来源: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: redisson/redisson

seg = "";
  tail = new JsonPointer(_fullPath(tail, seg), seg, tail);
} else if (context.inArray() || includeRoot) {
  int ix = context.getCurrentIndex();
  String ixStr = String.valueOf(ix);
  tail = new JsonPointer(_fullPath(tail, ixStr), ixStr, ix, tail);

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

seg = "";
  tail = new JsonPointer(_fullPath(tail, seg), seg, tail);
} else if (context.inArray() || includeRoot) {
  int ix = context.getCurrentIndex();
  String ixStr = String.valueOf(ix);
  tail = new JsonPointer(_fullPath(tail, ixStr), ixStr, ix, tail);

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

protected JsonPointer _constructHead(int suffixLength, JsonPointer last)
{
  if (this == last) {
    return EMPTY;
  }
  JsonPointer next = _nextSegment;
  String str = _asString;
  return new JsonPointer(str.substring(0, str.length() - suffixLength), _matchingPropertyName,
      _matchingElementIndex, next._constructHead(suffixLength, last));
}

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

protected JsonPointer _constructHead(int suffixLength, JsonPointer last)
{
  if (this == last) {
    return EMPTY;
  }
  JsonPointer next = _nextSegment;
  String str = _asString;
  return new JsonPointer(str.substring(0, str.length() - suffixLength), _matchingPropertyName,
      _matchingElementIndex, next._constructHead(suffixLength, last));
}

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

protected JsonPointer _constructHead(int suffixLength, JsonPointer last)
{
  if (this == last) {
    return EMPTY;
  }
  JsonPointer next = _nextSegment;
  String str = _asString;
  return new JsonPointer(str.substring(0, str.length() - suffixLength), _matchingPropertyName,
      _matchingElementIndex, next._constructHead(suffixLength, last));
}

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

protected JsonPointer _constructHead(int suffixLength, JsonPointer last)
{
  if (this == last) {
    return EMPTY;
  }
  JsonPointer next = _nextSegment;
  String str = _asString;
  return new JsonPointer(str.substring(0, str.length() - suffixLength), _matchingPropertyName,
      _matchingElementIndex, next._constructHead(suffixLength, last));
}

代码示例来源: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: 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: hstaudacher/osgi-jax-rs-connector

protected JsonPointer _constructHead()
{
  // ok; find out who we are to drop
  JsonPointer last = last();
  if (last == this) {
    return EMPTY;
  }
  // and from that, length of suffix to drop
  int suffixLength = last._asString.length();
  JsonPointer next = _nextSegment;
  return new JsonPointer(_asString.substring(0, _asString.length() - suffixLength), _matchingPropertyName,
      _matchingElementIndex, next._constructHead(suffixLength, last));
}

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

protected JsonPointer _constructHead()
{
  // ok; find out who we are to drop
  JsonPointer last = last();
  if (last == this) {
    return EMPTY;
  }
  // and from that, length of suffix to drop
  int suffixLength = last._asString.length();
  JsonPointer next = _nextSegment;
  return new JsonPointer(_asString.substring(0, _asString.length() - suffixLength), _matchingPropertyName,
      _matchingElementIndex, next._constructHead(suffixLength, last));
}

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

protected JsonPointer _constructHead()
{
  // ok; find out who we are to drop
  JsonPointer last = last();
  if (last == this) {
    return EMPTY;
  }
  // and from that, length of suffix to drop
  int suffixLength = last._asString.length();
  JsonPointer next = _nextSegment;
  return new JsonPointer(_asString.substring(0, _asString.length() - suffixLength), _matchingPropertyName,
      _matchingElementIndex, next._constructHead(suffixLength, last));
}

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

protected JsonPointer _constructHead()
{
  // ok; find out who we are to drop
  JsonPointer last = last();
  if (last == this) {
    return EMPTY;
  }
  // and from that, length of suffix to drop
  int suffixLength = last._asString.length();
  JsonPointer next = _nextSegment;
  return new JsonPointer(_asString.substring(0, _asString.length() - suffixLength), _matchingPropertyName,
      _matchingElementIndex, next._constructHead(suffixLength, last));
}

相关文章