Example usage for com.fasterxml.jackson.core JsonParser getCurrentToken

List of usage examples for com.fasterxml.jackson.core JsonParser getCurrentToken

Introduction

In this page you can find the example usage for com.fasterxml.jackson.core JsonParser getCurrentToken.

Prototype

public abstract JsonToken getCurrentToken();

Source Link

Document

Accessor to find which token parser currently points to, if any; null will be returned if none.

Usage

From source file:org.apache.olingo.client.core.edm.xml.annotation.DynamicAnnotationExpressionDeserializer.java

@Override
protected AbstractDynamicAnnotationExpression doDeserialize(final JsonParser jp,
        final DeserializationContext ctxt) throws IOException, JsonProcessingException {

    AbstractDynamicAnnotationExpression expression = null;

    if ("Not".equals(jp.getCurrentName())) {
        final NotImpl not = new NotImpl();

        jp.nextToken();/*from   w ww.  j av  a2  s .  co m*/
        for (; jp.getCurrentToken() != JsonToken.FIELD_NAME; jp.nextToken()) {
        }
        not.setExpression(jp.readValueAs(AbstractDynamicAnnotationExpression.class));
        for (; jp.getCurrentToken() != JsonToken.END_OBJECT || !jp.getCurrentName().equals("Not"); jp
                .nextToken()) {
        }

        expression = not;
    } else if (TwoParamsOpDynamicAnnotationExpression.Type.fromString(jp.getCurrentName()) != null) {
        final TwoParamsOpDynamicAnnotationExpressionImpl dynExprDoubleParamOp = new TwoParamsOpDynamicAnnotationExpressionImpl();
        dynExprDoubleParamOp
                .setType(TwoParamsOpDynamicAnnotationExpression.Type.fromString(jp.getCurrentName()));

        jp.nextToken();
        for (; jp.getCurrentToken() != JsonToken.FIELD_NAME; jp.nextToken()) {
        }
        dynExprDoubleParamOp.setLeftExpression(jp.readValueAs(AbstractDynamicAnnotationExpression.class));
        dynExprDoubleParamOp.setRightExpression(jp.readValueAs(AbstractDynamicAnnotationExpression.class));
        for (; jp.getCurrentToken() != JsonToken.END_OBJECT
                || !jp.getCurrentName().equals(dynExprDoubleParamOp.getType().name()); jp.nextToken()) {
        }

        expression = dynExprDoubleParamOp;
    } else if (ArrayUtils.contains(EL_OR_ATTR, jp.getCurrentName())) {
        final AbstractElementOrAttributeExpression elOrAttr = getElementOrAttributeExpressio(
                jp.getCurrentName());
        elOrAttr.setValue(jp.nextTextValue());

        expression = elOrAttr;
    } else if (APPLY.equals(jp.getCurrentName())) {
        jp.nextToken();
        expression = jp.readValueAs(ApplyImpl.class);
    } else if (CAST.equals(jp.getCurrentName())) {
        jp.nextToken();
        expression = jp.readValueAs(CastImpl.class);
    } else if (COLLECTION.equals(jp.getCurrentName())) {
        jp.nextToken();
        expression = jp.readValueAs(CollectionImpl.class);
    } else if (IF.equals(jp.getCurrentName())) {
        jp.nextToken();
        jp.nextToken();

        final IfImpl _if = new IfImpl();
        _if.setGuard(parseConstOrEnumExpression(jp));
        _if.setThen(parseConstOrEnumExpression(jp));
        _if.setElse(parseConstOrEnumExpression(jp));

        expression = _if;
    } else if (IS_OF.equals(jp.getCurrentName())) {
        jp.nextToken();
        expression = jp.readValueAs(IsOfImpl.class);
    } else if (LABELED_ELEMENT.equals(jp.getCurrentName())) {
        jp.nextToken();
        expression = jp.readValueAs(LabeledElementImpl.class);
    } else if (NULL.equals(jp.getCurrentName())) {
        jp.nextToken();
        expression = jp.readValueAs(NullImpl.class);
    } else if (RECORD.equals(jp.getCurrentName())) {
        jp.nextToken();
        expression = jp.readValueAs(RecordImpl.class);
    } else if (URL_REF.equals(jp.getCurrentName())) {
        jp.nextToken();
        expression = jp.readValueAs(UrlRefImpl.class);
    }

    return expression;
}

From source file:org.apache.olingo.client.core.edm.xml.ComplexTypeDeserializer.java

@Override
protected AbstractComplexType doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
        throws IOException, JsonProcessingException {

    final AbstractComplexType complexType = ODataServiceVersion.V30 == version
            ? new org.apache.olingo.client.core.edm.xml.v3.ComplexTypeImpl()
            : new org.apache.olingo.client.core.edm.xml.v4.ComplexTypeImpl();

    for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
        final JsonToken token = jp.getCurrentToken();
        if (token == JsonToken.FIELD_NAME) {
            if ("Name".equals(jp.getCurrentName())) {
                complexType.setName(jp.nextTextValue());
            } else if ("Abstract".equals(jp.getCurrentName())) {
                ((org.apache.olingo.client.core.edm.xml.v4.ComplexTypeImpl) complexType)
                        .setAbstractEntityType(BooleanUtils.toBoolean(jp.nextTextValue()));
            } else if ("BaseType".equals(jp.getCurrentName())) {
                ((org.apache.olingo.client.core.edm.xml.v4.ComplexTypeImpl) complexType)
                        .setBaseType(jp.nextTextValue());
            } else if ("OpenType".equals(jp.getCurrentName())) {
                ((org.apache.olingo.client.core.edm.xml.v4.ComplexTypeImpl) complexType)
                        .setOpenType(BooleanUtils.toBoolean(jp.nextTextValue()));
            } else if ("Property".equals(jp.getCurrentName())) {
                jp.nextToken();/* www  . j a v a2  s  .c  om*/
                if (complexType instanceof org.apache.olingo.client.core.edm.xml.v3.ComplexTypeImpl) {
                    ((org.apache.olingo.client.core.edm.xml.v3.ComplexTypeImpl) complexType).getProperties()
                            .add(jp.readValueAs(org.apache.olingo.client.core.edm.xml.v3.PropertyImpl.class));
                } else {
                    ((org.apache.olingo.client.core.edm.xml.v4.ComplexTypeImpl) complexType).getProperties()
                            .add(jp.readValueAs(org.apache.olingo.client.core.edm.xml.v4.PropertyImpl.class));
                }
            } else if ("NavigationProperty".equals(jp.getCurrentName())) {
                jp.nextToken();
                ((org.apache.olingo.client.core.edm.xml.v4.ComplexTypeImpl) complexType)
                        .getNavigationProperties().add(jp.readValueAs(
                                org.apache.olingo.client.core.edm.xml.v4.NavigationPropertyImpl.class));
            } else if ("Annotation".equals(jp.getCurrentName())) {
                jp.nextToken();
                ((org.apache.olingo.client.core.edm.xml.v4.ComplexTypeImpl) complexType).getAnnotations()
                        .add(jp.readValueAs(AnnotationImpl.class));
            }
        }
    }

    return complexType;
}

From source file:org.apache.olingo.client.core.edm.xml.EntityContainerDeserializer.java

@Override
protected AbstractEntityContainer doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
        throws IOException, JsonProcessingException {

    final AbstractEntityContainer entityContainer = ODataServiceVersion.V30 == version
            ? new org.apache.olingo.client.core.edm.xml.v3.EntityContainerImpl()
            : new org.apache.olingo.client.core.edm.xml.v4.EntityContainerImpl();

    for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
        final JsonToken token = jp.getCurrentToken();
        if (token == JsonToken.FIELD_NAME) {
            if ("Name".equals(jp.getCurrentName())) {
                entityContainer.setName(jp.nextTextValue());
            } else if ("Extends".equals(jp.getCurrentName())) {
                entityContainer.setExtends(jp.nextTextValue());
            } else if ("LazyLoadingEnabled".equals(jp.getCurrentName())) {
                entityContainer.setLazyLoadingEnabled(BooleanUtils.toBoolean(jp.nextTextValue()));
            } else if ("IsDefaultEntityContainer".equals(jp.getCurrentName())) {
                entityContainer.setDefaultEntityContainer(BooleanUtils.toBoolean(jp.nextTextValue()));
            } else if ("EntitySet".equals(jp.getCurrentName())) {
                jp.nextToken();//from   w  ww  . j a  va  2 s .c o m
                if (entityContainer instanceof org.apache.olingo.client.core.edm.xml.v3.EntityContainerImpl) {
                    ((org.apache.olingo.client.core.edm.xml.v3.EntityContainerImpl) entityContainer)
                            .getEntitySets()
                            .add(jp.readValueAs(org.apache.olingo.client.core.edm.xml.v3.EntitySetImpl.class));
                } else {
                    ((org.apache.olingo.client.core.edm.xml.v4.EntityContainerImpl) entityContainer)
                            .getEntitySets()
                            .add(jp.readValueAs(org.apache.olingo.client.core.edm.xml.v4.EntitySetImpl.class));
                }
            } else if ("AssociationSet".equals(jp.getCurrentName())) {
                jp.nextToken();
                ((org.apache.olingo.client.core.edm.xml.v3.EntityContainerImpl) entityContainer)
                        .getAssociationSets().add(jp.readValueAs(AssociationSetImpl.class));
            } else if ("Singleton".equals(jp.getCurrentName())) {
                jp.nextToken();
                ((org.apache.olingo.client.core.edm.xml.v4.EntityContainerImpl) entityContainer).getSingletons()
                        .add(jp.readValueAs(SingletonImpl.class));
            } else if ("ActionImport".equals(jp.getCurrentName())) {
                jp.nextToken();
                ((org.apache.olingo.client.core.edm.xml.v4.EntityContainerImpl) entityContainer)
                        .getActionImports().add(jp.readValueAs(ActionImportImpl.class));
            } else if ("FunctionImport".equals(jp.getCurrentName())) {
                jp.nextToken();
                if (entityContainer instanceof org.apache.olingo.client.core.edm.xml.v3.EntityContainerImpl) {
                    ((org.apache.olingo.client.core.edm.xml.v3.EntityContainerImpl) entityContainer)
                            .getFunctionImports().add(jp.readValueAs(
                                    org.apache.olingo.client.core.edm.xml.v3.FunctionImportImpl.class));
                } else {
                    ((org.apache.olingo.client.core.edm.xml.v4.EntityContainerImpl) entityContainer)
                            .getFunctionImports().add(jp.readValueAs(
                                    org.apache.olingo.client.core.edm.xml.v4.FunctionImportImpl.class));
                }
            } else if ("Annotation".equals(jp.getCurrentName())) {
                jp.nextToken();
                ((org.apache.olingo.client.core.edm.xml.v4.EntityContainerImpl) entityContainer)
                        .getAnnotations().add(jp.readValueAs(AnnotationImpl.class));
            }
        }
    }

    return entityContainer;
}

From source file:org.apache.olingo.client.core.edm.xml.EntitySetDeserializer.java

@Override
protected AbstractEntitySet doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
        throws IOException, JsonProcessingException {

    final AbstractEntitySet entitySet = ODataServiceVersion.V30 == version
            ? new org.apache.olingo.client.core.edm.xml.v3.EntitySetImpl()
            : new org.apache.olingo.client.core.edm.xml.v4.EntitySetImpl();

    for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
        final JsonToken token = jp.getCurrentToken();
        if (token == JsonToken.FIELD_NAME) {
            if ("Name".equals(jp.getCurrentName())) {
                entitySet.setName(jp.nextTextValue());
            } else if ("EntityType".equals(jp.getCurrentName())) {
                entitySet.setEntityType(jp.nextTextValue());
            } else if ("IncludeInServiceDocument".equals(jp.getCurrentName())) {
                ((org.apache.olingo.client.core.edm.xml.v4.EntitySetImpl) entitySet)
                        .setIncludeInServiceDocument(BooleanUtils.toBoolean(jp.nextTextValue()));
            } else if ("NavigationPropertyBinding".equals(jp.getCurrentName())) {
                jp.nextToken();/*from w w w. ja  v a 2s  .  c  om*/
                ((org.apache.olingo.client.core.edm.xml.v4.EntitySetImpl) entitySet)
                        .getNavigationPropertyBindings()
                        .add(jp.readValueAs(NavigationPropertyBindingImpl.class));
            } else if ("Annotation".equals(jp.getCurrentName())) {
                jp.nextToken();
                ((org.apache.olingo.client.core.edm.xml.v4.EntitySetImpl) entitySet).getAnnotations()
                        .add(jp.readValueAs(AnnotationImpl.class));
            }
        }
    }

    return entitySet;
}

From source file:org.apache.olingo.client.core.edm.xml.EntityTypeDeserializer.java

@Override
protected AbstractEntityType doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
        throws IOException, JsonProcessingException {

    final AbstractEntityType entityType = ODataServiceVersion.V30 == version
            ? new org.apache.olingo.client.core.edm.xml.v3.EntityTypeImpl()
            : new org.apache.olingo.client.core.edm.xml.v4.EntityTypeImpl();

    for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
        final JsonToken token = jp.getCurrentToken();
        if (token == JsonToken.FIELD_NAME) {
            if ("Name".equals(jp.getCurrentName())) {
                entityType.setName(jp.nextTextValue());
            } else if ("Abstract".equals(jp.getCurrentName())) {
                entityType.setAbstractEntityType(BooleanUtils.toBoolean(jp.nextTextValue()));
            } else if ("BaseType".equals(jp.getCurrentName())) {
                entityType.setBaseType(jp.nextTextValue());
            } else if ("OpenType".equals(jp.getCurrentName())) {
                entityType.setOpenType(BooleanUtils.toBoolean(jp.nextTextValue()));
            } else if ("HasStream".equals(jp.getCurrentName())) {
                entityType.setHasStream(BooleanUtils.toBoolean(jp.nextTextValue()));
            } else if ("Key".equals(jp.getCurrentName())) {
                jp.nextToken();//from   w w  w.j  av  a 2  s.co m
                entityType.setKey(jp.readValueAs(EntityKeyImpl.class));
            } else if ("Property".equals(jp.getCurrentName())) {
                jp.nextToken();
                if (entityType instanceof org.apache.olingo.client.core.edm.xml.v3.EntityTypeImpl) {
                    ((org.apache.olingo.client.core.edm.xml.v3.EntityTypeImpl) entityType).getProperties()
                            .add(jp.readValueAs(org.apache.olingo.client.core.edm.xml.v3.PropertyImpl.class));
                } else {
                    ((org.apache.olingo.client.core.edm.xml.v4.EntityTypeImpl) entityType).getProperties()
                            .add(jp.readValueAs(org.apache.olingo.client.core.edm.xml.v4.PropertyImpl.class));
                }
            } else if ("NavigationProperty".equals(jp.getCurrentName())) {
                jp.nextToken();
                if (entityType instanceof org.apache.olingo.client.core.edm.xml.v3.EntityTypeImpl) {
                    ((org.apache.olingo.client.core.edm.xml.v3.EntityTypeImpl) entityType)
                            .getNavigationProperties().add(jp.readValueAs(
                                    org.apache.olingo.client.core.edm.xml.v3.NavigationPropertyImpl.class));
                } else {
                    ((org.apache.olingo.client.core.edm.xml.v4.EntityTypeImpl) entityType)
                            .getNavigationProperties().add(jp.readValueAs(
                                    org.apache.olingo.client.core.edm.xml.v4.NavigationPropertyImpl.class));
                }
            } else if ("Annotation".equals(jp.getCurrentName())) {
                jp.nextToken();
                ((org.apache.olingo.client.core.edm.xml.v4.EntityTypeImpl) entityType).getAnnotations()
                        .add(jp.readValueAs(AnnotationImpl.class));
            }
        }
    }

    return entityType;
}

From source file:org.apache.olingo.client.core.edm.xml.EnumTypeDeserializer.java

@Override
protected AbstractEnumType doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
        throws IOException, JsonProcessingException {

    final AbstractEnumType enumType = ODataServiceVersion.V30 == version
            ? new org.apache.olingo.client.core.edm.xml.v3.EnumTypeImpl()
            : new org.apache.olingo.client.core.edm.xml.v4.EnumTypeImpl();

    for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
        final JsonToken token = jp.getCurrentToken();
        if (token == JsonToken.FIELD_NAME) {
            if ("Name".equals(jp.getCurrentName())) {
                enumType.setName(jp.nextTextValue());
            } else if ("UnderlyingType".equals(jp.getCurrentName())) {
                enumType.setUnderlyingType(jp.nextTextValue());
            } else if ("IsFlags".equals(jp.getCurrentName())) {
                enumType.setFlags(BooleanUtils.toBoolean(jp.nextTextValue()));
            } else if ("Member".equals(jp.getCurrentName())) {
                jp.nextToken();//from   w  w  w  .  ja v a2  s  . co  m
                if (enumType instanceof org.apache.olingo.client.core.edm.xml.v3.EnumTypeImpl) {
                    ((org.apache.olingo.client.core.edm.xml.v3.EnumTypeImpl) enumType).getMembers()
                            .add(jp.readValueAs(org.apache.olingo.client.core.edm.xml.v3.MemberImpl.class));
                } else {
                    ((org.apache.olingo.client.core.edm.xml.v4.EnumTypeImpl) enumType).getMembers()
                            .add(jp.readValueAs(org.apache.olingo.client.core.edm.xml.v4.MemberImpl.class));
                }
            } else if ("Annotation".equals(jp.getCurrentName())) {
                jp.nextToken();
                ((org.apache.olingo.client.core.edm.xml.v4.EnumTypeImpl) enumType).getAnnotations()
                        .add(jp.readValueAs(AnnotationImpl.class));
            }
        }
    }

    return enumType;
}

From source file:org.apache.olingo.client.core.edm.xml.FunctionDeserializer.java

@Override
protected FunctionImpl doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
        throws IOException, JsonProcessingException {

    final FunctionImpl functionImpl = new FunctionImpl();

    for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
        final JsonToken token = jp.getCurrentToken();
        if (token == JsonToken.FIELD_NAME) {
            if ("Name".equals(jp.getCurrentName())) {
                functionImpl.setName(jp.nextTextValue());
            } else if ("IsBound".equals(jp.getCurrentName())) {
                functionImpl.setBound(BooleanUtils.toBoolean(jp.nextTextValue()));
            } else if ("IsComposable".equals(jp.getCurrentName())) {
                functionImpl.setComposable(BooleanUtils.toBoolean(jp.nextTextValue()));
            } else if ("EntitySetPath".equals(jp.getCurrentName())) {
                functionImpl.setEntitySetPath(jp.nextTextValue());
            } else if ("Parameter".equals(jp.getCurrentName())) {
                jp.nextToken();//www .j  ava2  s  . c  om
                functionImpl.getParameters().add(jp.readValueAs(ParameterImpl.class));
            } else if ("ReturnType".equals(jp.getCurrentName())) {
                functionImpl.setReturnType(parseReturnType(jp, "Function"));
            } else if ("Annotation".equals(jp.getCurrentName())) {
                jp.nextToken();
                functionImpl.getAnnotations().add(jp.readValueAs(AnnotationImpl.class));
            }
        }
    }

    return functionImpl;
}

From source file:org.apache.olingo.client.core.edm.xml.FunctionImportDeserializer.java

@Override
protected FunctionImportImpl doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
        throws IOException, JsonProcessingException {

    final FunctionImportImpl functImpImpl = new FunctionImportImpl();

    for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
        final JsonToken token = jp.getCurrentToken();
        if (token == JsonToken.FIELD_NAME) {
            if ("Name".equals(jp.getCurrentName())) {
                functImpImpl.setName(jp.nextTextValue());
            } else if ("Function".equals(jp.getCurrentName())) {
                functImpImpl.setFunction(jp.nextTextValue());
            } else if ("EntitySet".equals(jp.getCurrentName())) {
                functImpImpl.setEntitySet(jp.nextTextValue());
            } else if ("IncludeInServiceDocument".equals(jp.getCurrentName())) {
                functImpImpl.setIncludeInServiceDocument(BooleanUtils.toBoolean(jp.nextTextValue()));
            } else if ("Annotation".equals(jp.getCurrentName())) {
                jp.nextToken();//ww w.  jav  a 2s.c  o m
                functImpImpl.getAnnotations().add(jp.readValueAs(AnnotationImpl.class));
            }
        }
    }

    return functImpImpl;
}

From source file:org.apache.olingo.client.core.edm.xml.NavigationPropertyDeserializer.java

@Override
protected NavigationPropertyImpl doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
        throws IOException, JsonProcessingException {

    final NavigationPropertyImpl property = new NavigationPropertyImpl();

    for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
        final JsonToken token = jp.getCurrentToken();
        if (token == JsonToken.FIELD_NAME) {
            if ("Name".equals(jp.getCurrentName())) {
                property.setName(jp.nextTextValue());
            } else if ("Type".equals(jp.getCurrentName())) {
                property.setType(jp.nextTextValue());
            } else if ("Nullable".equals(jp.getCurrentName())) {
                property.setNullable(BooleanUtils.toBoolean(jp.nextTextValue()));
            } else if ("Partner".equals(jp.getCurrentName())) {
                property.setPartner(jp.nextTextValue());
            } else if ("ContainsTarget".equals(jp.getCurrentName())) {
                property.setContainsTarget(BooleanUtils.toBoolean(jp.nextTextValue()));
            } else if ("ReferentialConstraint".equals(jp.getCurrentName())) {
                jp.nextToken();//  w  ww . ja  va 2  s  . co  m
                property.getReferentialConstraints().add(jp.readValueAs(ReferentialConstraintImpl.class));
            } else if ("OnDelete".equals(jp.getCurrentName())) {
                jp.nextToken();
                property.setOnDelete(jp.readValueAs(OnDeleteImpl.class));
            } else if ("Annotation".equals(jp.getCurrentName())) {
                jp.nextToken();
                property.getAnnotations().add(jp.readValueAs(AnnotationImpl.class));
            }
        }
    }

    return property;
}

From source file:org.apache.olingo.client.core.edm.xml.ParameterDeserializer.java

@Override
protected AbstractParameter doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
        throws IOException, JsonProcessingException {

    final AbstractParameter parameter = ODataServiceVersion.V30 == version
            ? new org.apache.olingo.client.core.edm.xml.v3.ParameterImpl()
            : new org.apache.olingo.client.core.edm.xml.v4.ParameterImpl();

    for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
        final JsonToken token = jp.getCurrentToken();
        if (token == JsonToken.FIELD_NAME) {
            if ("Name".equals(jp.getCurrentName())) {
                parameter.setName(jp.nextTextValue());
            } else if ("Type".equals(jp.getCurrentName())) {
                parameter.setType(jp.nextTextValue());
            } else if ("Nullable".equals(jp.getCurrentName())) {
                parameter.setNullable(BooleanUtils.toBoolean(jp.nextTextValue()));
            } else if ("MaxLength".equals(jp.getCurrentName())) {
                final String maxLenght = jp.nextTextValue();
                parameter.setMaxLength(// www.  j a  v a2s.  c  om
                        maxLenght.equalsIgnoreCase("max") ? Integer.MAX_VALUE : Integer.valueOf(maxLenght));
            } else if ("Precision".equals(jp.getCurrentName())) {
                parameter.setPrecision(Integer.valueOf(jp.nextTextValue()));
            } else if ("Scale".equals(jp.getCurrentName())) {
                final String scale = jp.nextTextValue();
                parameter.setScale(scale.equalsIgnoreCase("variable") ? 0 : Integer.valueOf(scale));
            } else if ("Mode".equals(jp.getCurrentName())) {
                ((org.apache.olingo.client.core.edm.xml.v3.ParameterImpl) parameter)
                        .setMode(ParameterMode.valueOf(jp.nextTextValue()));
            } else if ("SRID".equals(jp.getCurrentName())) {
                final String srid = jp.nextTextValue();
                if (srid != null) {
                    ((org.apache.olingo.client.core.edm.xml.v4.ParameterImpl) parameter)
                            .setSrid(SRID.valueOf(srid));
                }
            } else if ("Annotation".equals(jp.getCurrentName())) {
                jp.nextToken();
                ((org.apache.olingo.client.core.edm.xml.v4.ParameterImpl) parameter).getAnnotations()
                        .add(jp.readValueAs(AnnotationImpl.class));
            }
        }
    }

    return parameter;
}