List of usage examples for com.fasterxml.jackson.core JsonToken FIELD_NAME
JsonToken FIELD_NAME
To view the source code for com.fasterxml.jackson.core JsonToken FIELD_NAME.
Click Source Link
From source file:com.msopentech.odatajclient.engine.data.metadata.edm.FunctionImportDeserializer.java
@Override public FunctionImport deserialize(final JsonParser jp, final DeserializationContext ctxt) throws IOException, JsonProcessingException { final FunctionImport funcImp = new FunctionImport(); for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) { final JsonToken token = jp.getCurrentToken(); if (token == JsonToken.FIELD_NAME) { if ("Name".equals(jp.getCurrentName())) { funcImp.setName(jp.nextTextValue()); } else if ("ReturnType".equals(jp.getCurrentName())) { funcImp.setReturnType(jp.nextTextValue()); } else if ("EntitySet".equals(jp.getCurrentName())) { funcImp.setEntitySet(jp.nextTextValue()); } else if ("EntitySetPath".equals(jp.getCurrentName())) { funcImp.setEntitySetPath(jp.nextTextValue()); } else if ("IsComposable".equals(jp.getCurrentName())) { funcImp.setComposable(Boolean.valueOf(jp.nextTextValue())); } else if ("IsSideEffecting".equals(jp.getCurrentName())) { funcImp.setSideEffecting(Boolean.valueOf(jp.nextTextValue())); } else if ("IsBindable".equals(jp.getCurrentName())) { funcImp.setBindable(Boolean.valueOf(jp.nextTextValue())); } else if ("IsAlwaysBindable".equals(jp.getCurrentName())) { funcImp.setAlwaysBindable(Boolean.valueOf(jp.nextTextValue())); } else if ("HttpMethod".equals(jp.getCurrentName())) { funcImp.setHttpMethod(jp.nextTextValue()); } else if ("Parameter".equals(jp.getCurrentName())) { jp.nextToken();/*w w w. j a va2s. com*/ funcImp.getParameters().add(jp.getCodec().readValue(jp, Parameter.class)); } } } return funcImp; }
From source file:com.msopentech.odatajclient.engine.data.metadata.edm.ReferentialConstraintRoleDeserializer.java
@Override public ReferentialConstraintRole deserialize(final JsonParser jp, final DeserializationContext ctxt) throws IOException, JsonProcessingException { final ReferentialConstraintRole refConstRole = new ReferentialConstraintRole(); for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) { final JsonToken token = jp.getCurrentToken(); if (token == JsonToken.FIELD_NAME) { if ("Role".equals(jp.getCurrentName())) { refConstRole.setRole(jp.nextTextValue()); } else if ("PropertyRef".equals(jp.getCurrentName())) { jp.nextToken();// w w w.j a v a 2 s.com refConstRole.getPropertyRefs().add(jp.getCodec().readValue(jp, PropertyRef.class)); } } } return refConstRole; }
From source file:com.google.openrtb.json.OpenRtbJsonUtils.java
/** * Starts an Array, skipping the '[' token, and if necessary a field name before it. *//* ww w .java 2 s .co m*/ public static void startArray(JsonParser par) throws IOException { JsonToken token = par.getCurrentToken(); if (token == null || token == JsonToken.FIELD_NAME) { token = par.nextToken(); } if (token == JsonToken.START_ARRAY) { par.nextToken(); } else { throw new JsonParseException(par, "Expected start of array"); } }
From source file:com.msopentech.odatajclient.engine.data.metadata.edm.v4.ActionDeserializer.java
@Override protected Action doDeserialize(final JsonParser jp, final DeserializationContext ctxt) throws IOException, JsonProcessingException { final Action action = new Action(); for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) { final JsonToken token = jp.getCurrentToken(); if (token == JsonToken.FIELD_NAME) { if ("Name".equals(jp.getCurrentName())) { action.setName(jp.nextTextValue()); } else if ("IsBound".equals(jp.getCurrentName())) { action.setBound(BooleanUtils.toBoolean(jp.nextTextValue())); } else if ("EntitySetPath".equals(jp.getCurrentName())) { action.setEntitySetPath(jp.nextTextValue()); } else if ("Parameter".equals(jp.getCurrentName())) { jp.nextToken();//from w w w .java2s . co m action.getParameters().add(jp.getCodec().readValue(jp, Parameter.class)); } else if ("ReturnType".equals(jp.getCurrentName())) { action.setReturnType(parseReturnType(jp, "Action")); } else if ("Annotation".equals(jp.getCurrentName())) { jp.nextToken(); action.setAnnotation(jp.getCodec().readValue(jp, Annotation.class)); } } } return action; }
From source file:com.msopentech.odatajclient.engine.data.metadata.edm.v4.FunctionDeserializer.java
@Override protected Function doDeserialize(final JsonParser jp, final DeserializationContext ctxt) throws IOException, JsonProcessingException { final Function function = new Function(); for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) { final JsonToken token = jp.getCurrentToken(); if (token == JsonToken.FIELD_NAME) { if ("Name".equals(jp.getCurrentName())) { function.setName(jp.nextTextValue()); } else if ("IsBound".equals(jp.getCurrentName())) { function.setBound(BooleanUtils.toBoolean(jp.nextTextValue())); } else if ("IsComposable".equals(jp.getCurrentName())) { function.setComposable(BooleanUtils.toBoolean(jp.nextTextValue())); } else if ("EntitySetPath".equals(jp.getCurrentName())) { function.setEntitySetPath(jp.nextTextValue()); } else if ("Parameter".equals(jp.getCurrentName())) { jp.nextToken();/*from w w w.ja v a 2s .co m*/ function.getParameters().add(jp.getCodec().readValue(jp, Parameter.class)); } else if ("ReturnType".equals(jp.getCurrentName())) { function.setReturnType(parseReturnType(jp, "Function")); } else if ("Annotation".equals(jp.getCurrentName())) { jp.nextToken(); function.setAnnotation(jp.getCodec().readValue(jp, Annotation.class)); } } } return function; }
From source file:com.msopentech.odatajclient.engine.data.metadata.edm.v3.FunctionImportDeserializer.java
@Override protected FunctionImport doDeserialize(final JsonParser jp, final DeserializationContext ctxt) throws IOException, JsonProcessingException { final FunctionImport funcImp = new FunctionImport(); for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) { final JsonToken token = jp.getCurrentToken(); if (token == JsonToken.FIELD_NAME) { if ("Name".equals(jp.getCurrentName())) { funcImp.setName(jp.nextTextValue()); } else if ("ReturnType".equals(jp.getCurrentName())) { funcImp.setReturnType(jp.nextTextValue()); } else if ("EntitySet".equals(jp.getCurrentName())) { funcImp.setEntitySet(jp.nextTextValue()); } else if ("EntitySetPath".equals(jp.getCurrentName())) { funcImp.setEntitySetPath(jp.nextTextValue()); } else if ("IsComposable".equals(jp.getCurrentName())) { funcImp.setComposable(BooleanUtils.toBoolean(jp.nextTextValue())); } else if ("IsSideEffecting".equals(jp.getCurrentName())) { funcImp.setSideEffecting(BooleanUtils.toBoolean(jp.nextTextValue())); } else if ("IsBindable".equals(jp.getCurrentName())) { funcImp.setBindable(BooleanUtils.toBoolean(jp.nextTextValue())); } else if ("IsAlwaysBindable".equals(jp.getCurrentName())) { funcImp.setAlwaysBindable(BooleanUtils.toBoolean(jp.nextTextValue())); } else if ("HttpMethod".equals(jp.getCurrentName())) { funcImp.setHttpMethod(jp.nextTextValue()); } else if ("Parameter".equals(jp.getCurrentName())) { jp.nextToken();/*from w w w . j a v a 2s. co m*/ funcImp.getParameters().add(jp.getCodec().readValue(jp, Parameter.class)); } } } return funcImp; }
From source file:com.msopentech.odatajclient.engine.data.metadata.edm.v4.TermDeserializer.java
@Override protected Term doDeserialize(final JsonParser jp, final DeserializationContext ctxt) throws IOException, JsonProcessingException { final Term term = new Term(); for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) { final JsonToken token = jp.getCurrentToken(); if (token == JsonToken.FIELD_NAME) { if ("Name".equals(jp.getCurrentName())) { term.setName(jp.nextTextValue()); } else if ("Type".equals(jp.getCurrentName())) { term.setType(jp.nextTextValue()); } else if ("BaseTerm".equals(jp.getCurrentName())) { term.setBaseTerm(jp.nextTextValue()); } else if ("DefaultValue".equals(jp.getCurrentName())) { term.setDefaultValue(jp.nextTextValue()); } else if ("Nullable".equals(jp.getCurrentName())) { term.setNullable(BooleanUtils.toBoolean(jp.nextTextValue())); } else if ("MaxLength".equals(jp.getCurrentName())) { term.setMaxLength(jp.nextTextValue()); } else if ("Precision".equals(jp.getCurrentName())) { term.setPrecision(BigInteger.valueOf(jp.nextLongValue(0L))); } else if ("Scale".equals(jp.getCurrentName())) { term.setScale(BigInteger.valueOf(jp.nextLongValue(0L))); } else if ("SRID".equals(jp.getCurrentName())) { term.setSrid(jp.nextTextValue()); } else if ("AppliesTo".equals(jp.getCurrentName())) { for (String split : StringUtils.split(jp.nextTextValue())) { term.getAppliesTo().add(CSDLElement.valueOf(split)); }// w ww.j ava 2 s .c o m } else if ("Annotation".equals(jp.getCurrentName())) { jp.nextToken(); term.setAnnotation(jp.getCodec().readValue(jp, Annotation.class)); } } } return term; }