Codota Logo
JsonLocation.getByteOffset
Code IndexAdd Codota to your IDE (free)

How to use
getByteOffset
method
in
com.fasterxml.jackson.core.JsonLocation

Best Java code snippets using com.fasterxml.jackson.core.JsonLocation.getByteOffset (Showing top 20 results out of 315)

  • Common ways to obtain JsonLocation
private void myMethod () {
JsonLocation j =
  • Codota IconJsonParser delegate;delegate.getCurrentLocation()
  • Codota IconJsonParser delegate;delegate.getTokenLocation()
  • Codota IconJsonProcessingException jsonProcessingException;jsonProcessingException.getLocation()
  • Smart code suggestions by Codota
}
origin: redisson/redisson

@Override
public boolean equals(Object other)
{
  if (other == this) return true;
  if (other == null) return false;
  if (!(other instanceof JsonLocation)) return false;
  JsonLocation otherLoc = (JsonLocation) other;
  if (_sourceRef == null) {
    if (otherLoc._sourceRef != null) return false;
  } else if (!_sourceRef.equals(otherLoc._sourceRef)) return false;
  return (_lineNr == otherLoc._lineNr)
    && (_columnNr == otherLoc._columnNr)
    && (_totalChars == otherLoc._totalChars)
    && (getByteOffset() == otherLoc.getByteOffset())
    ;
}
origin: FasterXML/jackson-core

@Override
public boolean equals(Object other)
{
  if (other == this) return true;
  if (other == null) return false;
  if (!(other instanceof JsonLocation)) return false;
  JsonLocation otherLoc = (JsonLocation) other;
  if (_sourceRef == null) {
    if (otherLoc._sourceRef != null) return false;
  } else if (!_sourceRef.equals(otherLoc._sourceRef)) return false;
  return (_lineNr == otherLoc._lineNr)
    && (_columnNr == otherLoc._columnNr)
    && (_totalChars == otherLoc._totalChars)
    && (getByteOffset() == otherLoc.getByteOffset())
    ;
}
origin: redisson/redisson

@Override
public int getInputPos() {
  JsonLocation currentLocation = input.getCurrentLocation();
  long byteOffset = currentLocation.getByteOffset();
  if ( input.getCurrentToken() == JsonToken.FIELD_NAME )
    byteOffset-=2; // eager parsing of jackson ':' + '['/'{'
  return (int) byteOffset;
}
origin: RuedigerMoeller/fast-serialization

@Override
public int getInputPos() {
  JsonLocation currentLocation = input.getCurrentLocation();
  long byteOffset = currentLocation.getByteOffset();
  if ( input.getCurrentToken() == JsonToken.FIELD_NAME )
    byteOffset-=2; // eager parsing of jackson ':' + '['/'{'
  return (int) byteOffset;
}
origin: immutables/immutables

private String getLocationString() {
 JsonLocation l = parser.getCurrentLocation();
 List<String> parts = new ArrayList<>(4);
 parts.add("line: " + l.getLineNr());
 parts.add("column: " + l.getColumnNr());
 if (l.getByteOffset() >= 0) {
  parts.add("byte offset: " + l.getByteOffset());
 }
 return parts.toString();
}
origin: rakam-io/rakam

Object inputSource = jp.getInputSource();
long start = jp.getTokenLocation().getByteOffset();
long end = jp.getTokenLocation().getByteOffset();
origin: com.eclipsesource.jaxrs/jersey-all

  @Override
  public boolean equals(Object other)
  {
    if (other == this) return true;
    if (other == null) return false;
    if (!(other instanceof JsonLocation)) return false;
    JsonLocation otherLoc = (JsonLocation) other;

    if (_sourceRef == null) {
      if (otherLoc._sourceRef != null) return false;
    } else if (!_sourceRef.equals(otherLoc._sourceRef)) return false;

    return (_lineNr == otherLoc._lineNr)
      && (_columnNr == otherLoc._columnNr)
      && (_totalChars == otherLoc._totalChars)
      && (getByteOffset() == otherLoc.getByteOffset())
      ;
  }
}
origin: org.kill-bill.billing/killbill-platform-osgi-bundles-logger

@Override
public boolean equals(Object other)
{
  if (other == this) return true;
  if (other == null) return false;
  if (!(other instanceof JsonLocation)) return false;
  JsonLocation otherLoc = (JsonLocation) other;
  if (_sourceRef == null) {
    if (otherLoc._sourceRef != null) return false;
  } else if (!_sourceRef.equals(otherLoc._sourceRef)) return false;
  return (_lineNr == otherLoc._lineNr)
    && (_columnNr == otherLoc._columnNr)
    && (_totalChars == otherLoc._totalChars)
    && (getByteOffset() == otherLoc.getByteOffset())
    ;
}
origin: com.fasterxml.jackson.core/com.springsource.com.fasterxml.jackson.core.jackson-core

  @Override
  public boolean equals(Object other)
  {
    if (other == this) return true;
    if (other == null) return false;
    if (!(other instanceof JsonLocation)) return false;
    JsonLocation otherLoc = (JsonLocation) other;

    if (_sourceRef == null) {
      if (otherLoc._sourceRef != null) return false;
    } else if (!_sourceRef.equals(otherLoc._sourceRef)) return false;

    return (_lineNr == otherLoc._lineNr)
      && (_columnNr == otherLoc._columnNr)
      && (_totalChars == otherLoc._totalChars)
      && (getByteOffset() == otherLoc.getByteOffset())
      ;
  }
}
origin: com.ning.billing/killbill-osgi-bundles-analytics

  @Override
  public boolean equals(Object other)
  {
    if (other == this) return true;
    if (other == null) return false;
    if (!(other instanceof JsonLocation)) return false;
    JsonLocation otherLoc = (JsonLocation) other;

    if (_sourceRef == null) {
      if (otherLoc._sourceRef != null) return false;
    } else if (!_sourceRef.equals(otherLoc._sourceRef)) return false;

    return (_lineNr == otherLoc._lineNr)
      && (_columnNr == otherLoc._columnNr)
      && (_totalChars == otherLoc._totalChars)
      && (getByteOffset() == otherLoc.getByteOffset())
      ;
  }
}
origin: hstaudacher/osgi-jax-rs-connector

  @Override
  public boolean equals(Object other)
  {
    if (other == this) return true;
    if (other == null) return false;
    if (!(other instanceof JsonLocation)) return false;
    JsonLocation otherLoc = (JsonLocation) other;

    if (_sourceRef == null) {
      if (otherLoc._sourceRef != null) return false;
    } else if (!_sourceRef.equals(otherLoc._sourceRef)) return false;

    return (_lineNr == otherLoc._lineNr)
      && (_columnNr == otherLoc._columnNr)
      && (_totalChars == otherLoc._totalChars)
      && (getByteOffset() == otherLoc.getByteOffset())
      ;
  }
}
origin: Nextdoor/bender

  @Override
  public boolean equals(Object other)
  {
    if (other == this) return true;
    if (other == null) return false;
    if (!(other instanceof JsonLocation)) return false;
    JsonLocation otherLoc = (JsonLocation) other;

    if (_sourceRef == null) {
      if (otherLoc._sourceRef != null) return false;
    } else if (!_sourceRef.equals(otherLoc._sourceRef)) return false;

    return (_lineNr == otherLoc._lineNr)
      && (_columnNr == otherLoc._columnNr)
      && (_totalChars == otherLoc._totalChars)
      && (getByteOffset() == otherLoc.getByteOffset())
      ;
  }
}
origin: Esri/spatial-framework-for-hadoop

@Override
public float getProgress() throws IOException {
  if (splitLen == 0 || parser == null) return 0;
  
  return (float)parser.getCurrentLocation().getByteOffset() / splitLen;
}
origin: org.ojai/ojai

/**
 * Returns the current position in the underlying InputStream
 */
public long getInputStreamPosition() {
 return jsonParser.getTokenLocation().getByteOffset();
}
origin: org.immutables/gson

private String getLocationString() {
 JsonLocation l = parser.getCurrentLocation();
 List<String> parts = new ArrayList<>(4);
 parts.add("line: " + l.getLineNr());
 parts.add("column: " + l.getColumnNr());
 if (l.getByteOffset() >= 0) {
  parts.add("byte offset: " + l.getByteOffset());
 }
 return parts.toString();
}
origin: hazelcast/hazelcast-jet

private static long getTokenLocation(JsonParser parser) {
  if (parser instanceof ReaderBasedJsonParser) {
    return parser.getTokenLocation().getCharOffset();
  } else if (parser instanceof UTF8StreamJsonParser) {
    return parser.getTokenLocation().getByteOffset();
  } else {
    throw new HazelcastException("Provided parser does not support location: "
        + parser.getClass().getName());
  }
}
origin: com.orientechnologies/orientdb-graphdb

 protected void printStatus(final JsonParser jp, final long importedVertices, final long importedEdges) {
  if (output != null && (importedVertices + importedEdges) % 50000 == 0) {
   final long parsed = jp.getCurrentLocation().getByteOffset();

   if (inputSize > 0)
    output.onMessage(String.format("Imported %d graph elements: %d vertices and %d edges. Parsed %s/%s (uncompressed) (%s%%)",
      importedVertices + importedEdges, importedVertices, importedEdges, OFileUtils.getSizeAsString(parsed),
      "" + OFileUtils.getSizeAsString(inputSize), "" + parsed * 100 / inputSize));
   else
    output.onMessage(String.format("Imported %d graph elements: %d vertices and %d edges. Parsed %s (uncompressed)",
      importedVertices + importedEdges, importedVertices, importedEdges, OFileUtils.getSizeAsString(parsed)));
  }
 }
}
origin: scalecube/scalecube-services

 dataStart = jp.getTokenLocation().getByteOffset();
 if (current.isScalarValue()) {
  if (!current.isNumeric() && !current.isBoolean()) {
  jp.skipChildren();
 dataEnd = jp.getCurrentLocation().getByteOffset();
} else {
origin: scalecube/scalecube-services

 dataStart = jp.getTokenLocation().getByteOffset();
 if (current.isScalarValue()) {
  if (!current.isNumeric() && !current.isBoolean()) {
  jp.skipChildren();
 dataEnd = jp.getCurrentLocation().getByteOffset();
} else {
origin: datasift/dropwizard-extra

  @Override
  public T fromBytes(final byte[] bytes) {
    try {
      try {
        return mapper.readValue(bytes, clazz);
      } catch (final JsonParseException ex) {
        final JsonLocation location = ex.getLocation();
        Object src = location.getSourceRef();
        if (src instanceof ByteBuffer) {
          src = ((ByteBuffer) src).asCharBuffer();
        } else if (src instanceof byte[]) {
          src = new String((byte[]) src);
        } else if (src instanceof char[]) {
          src = new String((char[]) src);
        }
        throw new JsonParseException(
            ex.getMessage(),
            new JsonLocation(
                src,
                location.getByteOffset(),
                location.getCharOffset(),
                location.getLineNr(),
                location.getColumnNr()),
            ex.getCause());
      }
    } catch (final IOException ex) {
      throw new RuntimeException(ex);
    }
  }
}
com.fasterxml.jackson.coreJsonLocationgetByteOffset

Popular methods of JsonLocation

  • getLineNr
  • getColumnNr
  • <init>
  • getCharOffset
  • toString
  • getSourceRef
    Reference to the original resource being read, if one available. For example, when a parser has been
  • _append
  • _appendSourceDesc
  • equals
  • hashCode

Popular in Java

  • Updating database using SQL prepared statement
  • onRequestPermissionsResult (Fragment)
  • setRequestProperty (URLConnection)
  • setContentView (Activity)
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • Time (java.sql)
    Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • Collectors (java.util.stream)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now