Tabnine Logo
JsonLocation.getCharOffset
Code IndexAdd Tabnine to your IDE (free)

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

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

origin: com.linkedin.pegasus/data

@Override
public int compareTo(DataLocation other)
{
 return (int) (_location.getCharOffset() - ((Location) other)._location.getCharOffset());
}
origin: beckchr/staxon

@Override
public int getCharacterOffset() {
  return (int)location.getCharOffset();
}
 
origin: restx/restx

public String getJson() {
  return source.substring((int) from.getCharOffset() - 1, (int) to.getCharOffset());
}
origin: io.restx/restx-specs-tests

public String getJson() {
  return source.substring((int) from.getCharOffset() - 1, (int) to.getCharOffset());
}
origin: Esri/spatial-framework-for-hadoop

@Override
public long getPos() throws IOException {
  if (parser == null){
    return 0;
  } else {
    return parser.getCurrentLocation().getCharOffset();
  }
}
origin: cloudegg-tech/com.cloudeggtech.basalt

public static BadMessageException newParsingException(JsonParser jsonParser, String info) {
  return new BadMessageException(String.format("%s. offset: %d", info, jsonParser.
      getCurrentLocation().getCharOffset()));
}

origin: com.reprezen.jsonoverlay/jsonoverlay

public PositionEndpoint(JsonLocation location) {
  this(location.getCharOffset(), location.getLineNr(), location.getColumnNr());
}
origin: stackoverflow.com

long charOffsetStart = startLocation.getCharOffset();
long charOffsetEnd = endLocation.getCharOffset();
String jsonSubString = endLocation.getSourceRef().toString().substring((int)charOffsetStart - 1, (int)charOffsetEnd);
logger.info(strWalkStep);
origin: org.xbib/content-xml

StaxLocation(final JsonLocation location) {
  this((int) location.getCharOffset(), location.getColumnNr(), location.getLineNr());
}
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: Esri/spatial-framework-for-hadoop

key.set(parser.getCurrentLocation().getCharOffset());
origin: cloudegg-tech/com.cloudeggtech.basalt

public static ProtocolException newStanzaParsingException(JsonParser jsonParser, String info) {
  return new ProtocolException(new BadRequest(String.format("%s. offset: %d", info, jsonParser.getCurrentLocation().getCharOffset())));
}

origin: dremio/dremio-oss

private static int findJsonEndBoundary(String plan, int indexInPlan) throws IOException {
 // read the json pushdown query with jackson to find it's total length, wasn't sure how to do this with just regex
 // as it will span across a variable number of lines
 ObjectMapper map = new ObjectMapper(); //for later inner object data binding
 JsonParser p = map.getFactory().createParser(plan.substring(indexInPlan));
 JsonToken token = p.nextToken();
 if (token != JsonToken.START_ARRAY) {
  throw new RuntimeException("Error finding elastic pushdown query JSON in plan text, " +
   "did not find start array as expected, instead found " + token);
 }
 int startEndCounter = 1;
 while (startEndCounter != 0) {
  token = p.nextToken();
  if (token == JsonToken.START_ARRAY) {
   startEndCounter++;
  } else if (token == JsonToken.END_ARRAY) {
   startEndCounter--;
  }
 }
 long pushdownEndIndexInPlan = p.getTokenLocation().getCharOffset() + 1;
 return indexInPlan + (int) pushdownEndIndexInPlan;
}
origin: org.apache.hadoop/hadoop-yarn-server-timeline-pluginstorage

LOG.trace("Read domain {}", domain.getId());
++count;
bytesParsed = parser.getCurrentLocation().getCharOffset() + 1;
LOG.trace("Parser now at offset {}", bytesParsed);
origin: dremio/dremio-oss

int start = (int)parser.getTokenLocation().getCharOffset() + (parser.getCurrentToken() == JsonToken.VALUE_STRING ? 1 : 0);
switch (parser.getCurrentToken()) {
case VALUE_STRING: // values are one token
  updatePath(token);
  if (path.equals(searchedPath)) {
   int end = (int)parser.getTokenLocation().getCharOffset() + parser.getTextLength();
   return new Interval(start, end);
origin: com.google.openrtb/openrtb-core

par.getCurrentName(), locLast.getLineNr(), locLast.getCharOffset());
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);
    }
  }
}
origin: dremio/dremio-oss

JsonToken token;
while ((token = parser.nextToken()) != null) {
 int currentStart = (int)parser.getTokenLocation().getCharOffset();
 int currentEnd = currentStart + parser.getTextLength();
 if (previousEnd < selectionEnd && selectionEnd < currentStart) {
origin: org.seedstack.seed/seed-core-support-core

private void throwParsingError(JsonLocation jsonLocation, String message) {
  throw SeedException.createNew(DataErrorCode.FAILED_TO_PARSE_DATA_STREAM)
      .put("parsingError", message)
      .put("line", jsonLocation.getLineNr())
      .put("col", jsonLocation.getColumnNr())
      .put("offset", jsonLocation.getCharOffset());
}
origin: org.seedstack.business/business-core

private void throwParsingError(JsonLocation jsonLocation, String message) {
  throw BusinessException.createNew(DataErrorCode.FAILED_TO_PARSE_DATA_STREAM)
      .put("parsingError", message)
      .put("line", jsonLocation.getLineNr())
      .put("col", jsonLocation.getColumnNr())
      .put("offset", jsonLocation.getCharOffset());
}
com.fasterxml.jackson.coreJsonLocationgetCharOffset

Popular methods of JsonLocation

  • getLineNr
  • getColumnNr
  • <init>
  • getByteOffset
  • 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
  • scheduleAtFixedRate (ScheduledExecutorService)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • getSystemService (Context)
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • Notification (javax.management)
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • Top 15 Vim Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now