[OLINGO-564] Renamed 'ClientCsdl' classes
This commit is contained in:
parent
3c0990910a
commit
53b10f6b7f
|
@ -30,7 +30,7 @@ import org.apache.commons.io.IOUtils;
|
|||
import org.apache.olingo.client.api.EdmEnabledODataClient;
|
||||
import org.apache.olingo.client.api.edm.xml.XMLMetadata;
|
||||
import org.apache.olingo.client.core.ODataClientFactory;
|
||||
import org.apache.olingo.client.core.edm.ClientEdmProvider;
|
||||
import org.apache.olingo.client.core.edm.ClientCsdlEdmProvider;
|
||||
import org.apache.olingo.commons.api.ODataRuntimeException;
|
||||
import org.apache.olingo.commons.api.edm.Edm;
|
||||
import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion;
|
||||
|
@ -86,7 +86,7 @@ public abstract class AbstractService<C extends EdmEnabledODataClient> {
|
|||
}
|
||||
final Edm edm;
|
||||
if (metadata != null) {
|
||||
ClientEdmProvider provider = new ClientEdmProvider(metadata.getSchemaByNsOrAlias());
|
||||
ClientCsdlEdmProvider provider = new ClientCsdlEdmProvider(metadata.getSchemaByNsOrAlias());
|
||||
edm = new EdmProviderImpl(provider);
|
||||
}else{
|
||||
edm = null;
|
||||
|
|
|
@ -43,11 +43,11 @@ import org.apache.olingo.commons.api.edm.provider.CsdlSingleton;
|
|||
import org.apache.olingo.commons.api.edm.provider.CsdlTerm;
|
||||
import org.apache.olingo.commons.api.edm.provider.CsdlTypeDefinition;
|
||||
|
||||
public class ClientEdmProvider extends CsdlAbstractEdmProvider {
|
||||
public class ClientCsdlEdmProvider extends CsdlAbstractEdmProvider {
|
||||
|
||||
private final Map<String, CsdlSchema> xmlSchemas;
|
||||
|
||||
public ClientEdmProvider(Map<String, CsdlSchema> xmlSchemas) {
|
||||
public ClientCsdlEdmProvider(Map<String, CsdlSchema> xmlSchemas) {
|
||||
this.xmlSchemas = xmlSchemas;
|
||||
}
|
||||
|
|
@ -32,12 +32,12 @@ import org.apache.olingo.commons.api.edm.provider.CsdlSchema;
|
|||
/**
|
||||
* Entry point for access information about EDM metadata.
|
||||
*/
|
||||
public class ClientXMLMetadata extends CsdlAbstractEdmItem implements XMLMetadata {
|
||||
public class ClientCsdlXMLMetadata extends CsdlAbstractEdmItem implements XMLMetadata {
|
||||
|
||||
private static final long serialVersionUID = 6025723060298454901L;
|
||||
protected final Edmx edmx;
|
||||
|
||||
public ClientXMLMetadata(final Edmx edmx) {
|
||||
public ClientCsdlXMLMetadata(final Edmx edmx) {
|
||||
this.edmx = edmx;
|
||||
}
|
||||
|
|
@ -24,8 +24,8 @@ import java.util.List;
|
|||
import org.apache.olingo.commons.api.edm.provider.CsdlAnnotatable;
|
||||
import org.apache.olingo.commons.api.edm.provider.CsdlAnnotation;
|
||||
|
||||
abstract class AbstractClientAnnotatableDynamicAnnotationExpression
|
||||
extends AbstractClientDynamicAnnotationExpression implements CsdlAnnotatable {
|
||||
abstract class AbstractClientCsdlAnnotatableDynamicAnnotationExpression
|
||||
extends AbstractClientCsdlDynamicAnnotationExpression implements CsdlAnnotatable {
|
||||
|
||||
private static final long serialVersionUID = -450668773857358139L;
|
||||
|
|
@ -23,7 +23,7 @@ import org.apache.olingo.commons.api.edm.provider.annotation.AnnotationExpressio
|
|||
import org.apache.olingo.commons.api.edm.provider.annotation.ConstantAnnotationExpression;
|
||||
import org.apache.olingo.commons.api.edm.provider.annotation.DynamicAnnotationExpression;
|
||||
|
||||
abstract class AbstractClientAnnotationExpression extends CsdlAbstractEdmItem implements AnnotationExpression {
|
||||
abstract class AbstractClientCsdlAnnotationExpression extends CsdlAbstractEdmItem implements AnnotationExpression {
|
||||
|
||||
private static final long serialVersionUID = -4238652997159205377L;
|
||||
|
|
@ -48,9 +48,9 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
@JsonDeserialize(using = AbstractClientDynamicAnnotationExpression.DynamicAnnotationExpressionDeserializer.class)
|
||||
abstract class AbstractClientDynamicAnnotationExpression
|
||||
extends AbstractClientAnnotationExpression implements DynamicAnnotationExpression {
|
||||
@JsonDeserialize(using = AbstractClientCsdlDynamicAnnotationExpression.DynamicAnnotationExpressionDeserializer.class)
|
||||
abstract class AbstractClientCsdlDynamicAnnotationExpression
|
||||
extends AbstractClientCsdlAnnotationExpression implements DynamicAnnotationExpression {
|
||||
|
||||
private static final long serialVersionUID = 1093411847477874348L;
|
||||
|
||||
|
@ -226,7 +226,7 @@ abstract class AbstractClientDynamicAnnotationExpression
|
|||
}
|
||||
|
||||
static class DynamicAnnotationExpressionDeserializer
|
||||
extends AbstractClientEdmDeserializer<AbstractClientDynamicAnnotationExpression> {
|
||||
extends AbstractClientCsdlEdmDeserializer<AbstractClientCsdlDynamicAnnotationExpression> {
|
||||
|
||||
private static final String[] EL_OR_ATTR = {
|
||||
AnnotationPath.class.getSimpleName(), NavigationPropertyPath.class.getSimpleName(),
|
||||
|
@ -243,26 +243,26 @@ abstract class AbstractClientDynamicAnnotationExpression
|
|||
private static final String RECORD = Record.class.getSimpleName();
|
||||
private static final String URL_REF = UrlRef.class.getSimpleName();
|
||||
|
||||
private AbstractClientElementOrAttributeExpression getElementOrAttributeExpression(final String simpleClassName)
|
||||
private AbstractClientCsdlElementOrAttributeExpression getElementOrAttributeExpression(final String simpleClassName)
|
||||
throws JsonParseException {
|
||||
|
||||
try {
|
||||
@SuppressWarnings("unchecked")
|
||||
Class<? extends AbstractClientElementOrAttributeExpression> elOrAttrClass =
|
||||
(Class<? extends AbstractClientElementOrAttributeExpression>) ClassUtils.getClass(
|
||||
getClass().getPackage().getName() + ".Client" + simpleClassName);
|
||||
Class<? extends AbstractClientCsdlElementOrAttributeExpression> elOrAttrClass =
|
||||
(Class<? extends AbstractClientCsdlElementOrAttributeExpression>) ClassUtils.getClass(
|
||||
getClass().getPackage().getName() + ".ClientCsdl" + simpleClassName);
|
||||
return elOrAttrClass.newInstance();
|
||||
} catch (Exception e) {
|
||||
throw new JsonParseException("Could not instantiate " + simpleClassName, JsonLocation.NA, e);
|
||||
}
|
||||
}
|
||||
|
||||
private AbstractClientAnnotationExpression parseConstOrEnumExpression(final JsonParser jp) throws IOException {
|
||||
AbstractClientAnnotationExpression result;
|
||||
private AbstractClientCsdlAnnotationExpression parseConstOrEnumExpression(final JsonParser jp) throws IOException {
|
||||
AbstractClientCsdlAnnotationExpression result;
|
||||
if (isAnnotationConstExprConstruct(jp)) {
|
||||
result = parseAnnotationConstExprConstruct(jp);
|
||||
} else {
|
||||
result = jp.readValueAs(AbstractClientDynamicAnnotationExpression.class);
|
||||
result = jp.readValueAs(AbstractClientCsdlDynamicAnnotationExpression.class);
|
||||
}
|
||||
jp.nextToken();
|
||||
|
||||
|
@ -270,20 +270,20 @@ abstract class AbstractClientDynamicAnnotationExpression
|
|||
}
|
||||
|
||||
@Override
|
||||
protected AbstractClientDynamicAnnotationExpression doDeserialize(final JsonParser jp,
|
||||
protected AbstractClientCsdlDynamicAnnotationExpression doDeserialize(final JsonParser jp,
|
||||
final DeserializationContext ctxt) throws IOException {
|
||||
|
||||
AbstractClientDynamicAnnotationExpression expression = null;
|
||||
AbstractClientCsdlDynamicAnnotationExpression expression = null;
|
||||
|
||||
if ("Not".equals(jp.getCurrentName())) {
|
||||
final ClientNot not = new ClientNot();
|
||||
final ClientCsdlNot not = new ClientCsdlNot();
|
||||
|
||||
jp.nextToken();
|
||||
//Search for field name
|
||||
while (jp.getCurrentToken() != JsonToken.FIELD_NAME) {
|
||||
jp.nextToken();
|
||||
}
|
||||
not.setExpression(jp.readValueAs(AbstractClientDynamicAnnotationExpression.class));
|
||||
not.setExpression(jp.readValueAs(AbstractClientCsdlDynamicAnnotationExpression.class));
|
||||
//Search for end object
|
||||
while (jp.getCurrentToken() != JsonToken.END_OBJECT || !jp.getCurrentName().equals("Not")) {
|
||||
jp.nextToken();
|
||||
|
@ -291,8 +291,8 @@ abstract class AbstractClientDynamicAnnotationExpression
|
|||
|
||||
expression = not;
|
||||
} else if (TwoParamsOpDynamicAnnotationExpression.Type.fromString(jp.getCurrentName()) != null) {
|
||||
final ClientTwoParamsOpDynamicAnnotationExpression dynExprDoubleParamOp =
|
||||
new ClientTwoParamsOpDynamicAnnotationExpression();
|
||||
final ClientCsdlTwoParamsOpDynamicAnnotationExpression dynExprDoubleParamOp =
|
||||
new ClientCsdlTwoParamsOpDynamicAnnotationExpression();
|
||||
dynExprDoubleParamOp.setType(TwoParamsOpDynamicAnnotationExpression.Type.fromString(jp.getCurrentName()));
|
||||
|
||||
jp.nextToken();
|
||||
|
@ -300,8 +300,8 @@ abstract class AbstractClientDynamicAnnotationExpression
|
|||
while (jp.getCurrentToken() != JsonToken.FIELD_NAME) {
|
||||
jp.nextToken();
|
||||
}
|
||||
dynExprDoubleParamOp.setLeftExpression(jp.readValueAs(AbstractClientDynamicAnnotationExpression.class));
|
||||
dynExprDoubleParamOp.setRightExpression(jp.readValueAs(AbstractClientDynamicAnnotationExpression.class));
|
||||
dynExprDoubleParamOp.setLeftExpression(jp.readValueAs(AbstractClientCsdlDynamicAnnotationExpression.class));
|
||||
dynExprDoubleParamOp.setRightExpression(jp.readValueAs(AbstractClientCsdlDynamicAnnotationExpression.class));
|
||||
//Search for expression
|
||||
while (jp.getCurrentToken() != JsonToken.END_OBJECT || !jp.getCurrentName().equals(dynExprDoubleParamOp
|
||||
.getType().name())) {
|
||||
|
@ -310,24 +310,24 @@ abstract class AbstractClientDynamicAnnotationExpression
|
|||
|
||||
expression = dynExprDoubleParamOp;
|
||||
} else if (ArrayUtils.contains(EL_OR_ATTR, jp.getCurrentName())) {
|
||||
final AbstractClientElementOrAttributeExpression elOrAttr =
|
||||
final AbstractClientCsdlElementOrAttributeExpression elOrAttr =
|
||||
getElementOrAttributeExpression(jp.getCurrentName());
|
||||
elOrAttr.setValue(jp.nextTextValue());
|
||||
expression = elOrAttr;
|
||||
} else if (APPLY.equals(jp.getCurrentName())) {
|
||||
jp.nextToken();
|
||||
expression = jp.readValueAs(ClientApply.class);
|
||||
expression = jp.readValueAs(ClientCsdlApply.class);
|
||||
} else if (CAST.equals(jp.getCurrentName())) {
|
||||
jp.nextToken();
|
||||
expression = jp.readValueAs(ClientCast.class);
|
||||
expression = jp.readValueAs(ClientCsdlCast.class);
|
||||
} else if (COLLECTION.equals(jp.getCurrentName())) {
|
||||
jp.nextToken();
|
||||
expression = jp.readValueAs(ClientCollection.class);
|
||||
expression = jp.readValueAs(ClientCsdlCollection.class);
|
||||
} else if (IF.equals(jp.getCurrentName())) {
|
||||
jp.nextToken();
|
||||
jp.nextToken();
|
||||
|
||||
final ClientIf ifImpl = new ClientIf();
|
||||
final ClientCsdlIf ifImpl = new ClientCsdlIf();
|
||||
ifImpl.setGuard(parseConstOrEnumExpression(jp));
|
||||
ifImpl.setThen(parseConstOrEnumExpression(jp));
|
||||
ifImpl.setElse(parseConstOrEnumExpression(jp));
|
||||
|
@ -335,19 +335,19 @@ abstract class AbstractClientDynamicAnnotationExpression
|
|||
expression = ifImpl;
|
||||
} else if (IS_OF.equals(jp.getCurrentName())) {
|
||||
jp.nextToken();
|
||||
expression = jp.readValueAs(ClientIsOf.class);
|
||||
expression = jp.readValueAs(ClientCsdlIsOf.class);
|
||||
} else if (LABELED_ELEMENT.equals(jp.getCurrentName())) {
|
||||
jp.nextToken();
|
||||
expression = jp.readValueAs(ClientLabeledElement.class);
|
||||
expression = jp.readValueAs(ClientCsdlLabeledElement.class);
|
||||
} else if (NULL.equals(jp.getCurrentName())) {
|
||||
jp.nextToken();
|
||||
expression = jp.readValueAs(ClientNull.class);
|
||||
expression = jp.readValueAs(ClientCsdlNull.class);
|
||||
} else if (RECORD.equals(jp.getCurrentName())) {
|
||||
jp.nextToken();
|
||||
expression = jp.readValueAs(ClientRecord.class);
|
||||
expression = jp.readValueAs(ClientCsdlRecord.class);
|
||||
} else if (URL_REF.equals(jp.getCurrentName())) {
|
||||
jp.nextToken();
|
||||
expression = jp.readValueAs(ClientUrlRef.class);
|
||||
expression = jp.readValueAs(ClientCsdlUrlRef.class);
|
||||
}
|
||||
|
||||
return expression;
|
|
@ -25,28 +25,28 @@ import com.fasterxml.jackson.databind.DeserializationContext;
|
|||
import com.fasterxml.jackson.databind.JsonDeserializer;
|
||||
import com.fasterxml.jackson.dataformat.xml.deser.FromXmlParser;
|
||||
|
||||
abstract class AbstractClientEdmDeserializer<T> extends JsonDeserializer<T> {
|
||||
abstract class AbstractClientCsdlEdmDeserializer<T> extends JsonDeserializer<T> {
|
||||
|
||||
protected boolean isAnnotationConstExprConstruct(final JsonParser jp) throws IOException {
|
||||
return ClientConstantAnnotationExpression.Type.fromString(jp.getCurrentName()) != null;
|
||||
return ClientCsdlConstantAnnotationExpression.Type.fromString(jp.getCurrentName()) != null;
|
||||
}
|
||||
|
||||
protected ClientConstantAnnotationExpression parseAnnotationConstExprConstruct(final JsonParser jp)
|
||||
protected ClientCsdlConstantAnnotationExpression parseAnnotationConstExprConstruct(final JsonParser jp)
|
||||
throws IOException {
|
||||
final ClientConstantAnnotationExpression constExpr = new ClientConstantAnnotationExpression();
|
||||
constExpr.setType(ClientConstantAnnotationExpression.Type.fromString(jp.getCurrentName()));
|
||||
final ClientCsdlConstantAnnotationExpression constExpr = new ClientCsdlConstantAnnotationExpression();
|
||||
constExpr.setType(ClientCsdlConstantAnnotationExpression.Type.fromString(jp.getCurrentName()));
|
||||
constExpr.setValue(jp.nextTextValue());
|
||||
return constExpr;
|
||||
}
|
||||
|
||||
protected ClientReturnType parseReturnType(final JsonParser jp, final String elementName) throws IOException {
|
||||
final ClientReturnType returnType;
|
||||
protected ClientCsdlReturnType parseReturnType(final JsonParser jp, final String elementName) throws IOException {
|
||||
final ClientCsdlReturnType returnType;
|
||||
if (elementName.equals(((FromXmlParser) jp).getStaxReader().getLocalName())) {
|
||||
returnType = new ClientReturnType();
|
||||
returnType = new ClientCsdlReturnType();
|
||||
returnType.setType(jp.nextTextValue());
|
||||
} else {
|
||||
jp.nextToken();
|
||||
returnType = jp.readValueAs(ClientReturnType.class);
|
||||
returnType = jp.readValueAs(ClientCsdlReturnType.class);
|
||||
}
|
||||
return returnType;
|
||||
}
|
|
@ -21,7 +21,7 @@ package org.apache.olingo.client.core.edm.xml;
|
|||
/**
|
||||
* Groups dynamic expressions that may be provided using element notation or attribute notation.
|
||||
*/
|
||||
class AbstractClientElementOrAttributeExpression extends AbstractClientDynamicAnnotationExpression {
|
||||
class AbstractClientCsdlElementOrAttributeExpression extends AbstractClientCsdlDynamicAnnotationExpression {
|
||||
|
||||
private static final long serialVersionUID = 1588336268773032932L;
|
||||
|
|
@ -28,18 +28,18 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
@JsonDeserialize(using = ClientAction.ActionDeserializer.class)
|
||||
class ClientAction extends CsdlAction {
|
||||
@JsonDeserialize(using = ClientCsdlAction.ActionDeserializer.class)
|
||||
class ClientCsdlAction extends CsdlAction {
|
||||
|
||||
private static final long serialVersionUID = 5321541275349234088L;
|
||||
|
||||
static class ActionDeserializer extends AbstractClientEdmDeserializer<ClientAction> {
|
||||
static class ActionDeserializer extends AbstractClientCsdlEdmDeserializer<ClientCsdlAction> {
|
||||
|
||||
@Override
|
||||
protected ClientAction doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
|
||||
protected ClientCsdlAction doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
|
||||
throws IOException {
|
||||
|
||||
final ClientAction action = new ClientAction();
|
||||
final ClientCsdlAction action = new ClientCsdlAction();
|
||||
|
||||
for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
|
||||
final JsonToken token = jp.getCurrentToken();
|
||||
|
@ -52,12 +52,12 @@ class ClientAction extends CsdlAction {
|
|||
action.setEntitySetPath(jp.nextTextValue());
|
||||
} else if ("Parameter".equals(jp.getCurrentName())) {
|
||||
jp.nextToken();
|
||||
action.getParameters().add(jp.readValueAs(ClientParameter.class));
|
||||
action.getParameters().add(jp.readValueAs(ClientCsdlParameter.class));
|
||||
} else if ("ReturnType".equals(jp.getCurrentName())) {
|
||||
action.setReturnType(parseReturnType(jp, "Action"));
|
||||
} else if ("Annotation".equals(jp.getCurrentName())) {
|
||||
jp.nextToken();
|
||||
action.getAnnotations().add(jp.readValueAs(ClientAnnotation.class));
|
||||
action.getAnnotations().add(jp.readValueAs(ClientCsdlAnnotation.class));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -26,18 +26,18 @@ import org.apache.olingo.commons.api.edm.provider.CsdlActionImport;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
@JsonDeserialize(using = ClientActionImport.ActionImportDeserializer.class)
|
||||
class ClientActionImport extends CsdlActionImport {
|
||||
@JsonDeserialize(using = ClientCsdlActionImport.ActionImportDeserializer.class)
|
||||
class ClientCsdlActionImport extends CsdlActionImport {
|
||||
|
||||
private static final long serialVersionUID = 2971468441177647068L;
|
||||
|
||||
static class ActionImportDeserializer extends AbstractClientEdmDeserializer<ClientActionImport> {
|
||||
static class ActionImportDeserializer extends AbstractClientCsdlEdmDeserializer<ClientCsdlActionImport> {
|
||||
|
||||
@Override
|
||||
protected ClientActionImport doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
|
||||
protected ClientCsdlActionImport doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
|
||||
throws IOException {
|
||||
|
||||
final ClientActionImport action = new ClientActionImport();
|
||||
final ClientCsdlActionImport action = new ClientCsdlActionImport();
|
||||
|
||||
for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
|
||||
final JsonToken token = jp.getCurrentToken();
|
|
@ -27,18 +27,18 @@ import org.apache.olingo.commons.api.edm.provider.CsdlAnnotation;
|
|||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
||||
|
||||
@JsonDeserialize(using = ClientAnnotation.AnnotationDeserializer.class)
|
||||
class ClientAnnotation extends CsdlAnnotation {
|
||||
@JsonDeserialize(using = ClientCsdlAnnotation.AnnotationDeserializer.class)
|
||||
class ClientCsdlAnnotation extends CsdlAnnotation {
|
||||
|
||||
private static final long serialVersionUID = 5464714417411058033L;
|
||||
|
||||
static class AnnotationDeserializer extends AbstractClientEdmDeserializer<CsdlAnnotation> {
|
||||
static class AnnotationDeserializer extends AbstractClientCsdlEdmDeserializer<CsdlAnnotation> {
|
||||
|
||||
@Override
|
||||
protected CsdlAnnotation doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
|
||||
throws IOException {
|
||||
|
||||
final ClientAnnotation annotation = new ClientAnnotation();
|
||||
final ClientCsdlAnnotation annotation = new ClientCsdlAnnotation();
|
||||
|
||||
for (; jp.getCurrentToken() != null && jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
|
||||
final JsonToken token = jp.getCurrentToken();
|
||||
|
@ -49,13 +49,13 @@ class ClientAnnotation extends CsdlAnnotation {
|
|||
annotation.setQualifier(jp.nextTextValue());
|
||||
} else if ("Annotation".equals(jp.getCurrentName())) {
|
||||
jp.nextToken();
|
||||
annotation.getAnnotations().add(jp.readValueAs(ClientAnnotation.class));
|
||||
annotation.getAnnotations().add(jp.readValueAs(ClientCsdlAnnotation.class));
|
||||
} else if (isAnnotationConstExprConstruct(jp)) {
|
||||
// Constant Expressions
|
||||
annotation.setExpression(parseAnnotationConstExprConstruct(jp));
|
||||
} else {
|
||||
// Dynamic Expressions
|
||||
annotation.setExpression(jp.readValueAs(AbstractClientDynamicAnnotationExpression.class));
|
||||
annotation.setExpression(jp.readValueAs(AbstractClientCsdlDynamicAnnotationExpression.class));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -20,7 +20,7 @@ package org.apache.olingo.client.core.edm.xml;
|
|||
|
||||
import org.apache.olingo.commons.api.edm.provider.annotation.AnnotationPath;
|
||||
|
||||
class ClientAnnotationPath extends AbstractClientElementOrAttributeExpression implements AnnotationPath {
|
||||
class ClientCsdlAnnotationPath extends AbstractClientCsdlElementOrAttributeExpression implements AnnotationPath {
|
||||
|
||||
private static final long serialVersionUID = 5360735207353494466L;
|
||||
|
|
@ -27,18 +27,18 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
@JsonDeserialize(using = ClientAnnotations.AnnotationsDeserializer.class)
|
||||
class ClientAnnotations extends CsdlAnnotations {
|
||||
@JsonDeserialize(using = ClientCsdlAnnotations.AnnotationsDeserializer.class)
|
||||
class ClientCsdlAnnotations extends CsdlAnnotations {
|
||||
|
||||
private static final long serialVersionUID = -5961207981571644200L;
|
||||
|
||||
static class AnnotationsDeserializer extends AbstractClientEdmDeserializer<ClientAnnotations> {
|
||||
static class AnnotationsDeserializer extends AbstractClientCsdlEdmDeserializer<ClientCsdlAnnotations> {
|
||||
|
||||
@Override
|
||||
protected ClientAnnotations doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
|
||||
protected ClientCsdlAnnotations doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
|
||||
throws IOException {
|
||||
|
||||
final ClientAnnotations annotations = new ClientAnnotations();
|
||||
final ClientCsdlAnnotations annotations = new ClientCsdlAnnotations();
|
||||
|
||||
for (; jp.getCurrentToken() != null && jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
|
||||
final JsonToken token = jp.getCurrentToken();
|
||||
|
@ -49,7 +49,7 @@ class ClientAnnotations extends CsdlAnnotations {
|
|||
annotations.setQualifier(jp.nextTextValue());
|
||||
} else if ("Annotation".equals(jp.getCurrentName())) {
|
||||
jp.nextToken();
|
||||
annotations.getAnnotations().add(jp.readValueAs(ClientAnnotation.class));
|
||||
annotations.getAnnotations().add(jp.readValueAs(ClientCsdlAnnotation.class));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -30,8 +30,8 @@ import org.apache.olingo.commons.api.edm.provider.annotation.Apply;
|
|||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
||||
|
||||
@JsonDeserialize(using = ClientApply.ApplyDeserializer.class)
|
||||
class ClientApply extends AbstractClientAnnotatableDynamicAnnotationExpression implements Apply {
|
||||
@JsonDeserialize(using = ClientCsdlApply.ApplyDeserializer.class)
|
||||
class ClientCsdlApply extends AbstractClientCsdlAnnotatableDynamicAnnotationExpression implements Apply {
|
||||
|
||||
private static final long serialVersionUID = 4358398303405059879L;
|
||||
|
||||
|
@ -53,23 +53,23 @@ class ClientApply extends AbstractClientAnnotatableDynamicAnnotationExpression i
|
|||
return parameters;
|
||||
}
|
||||
|
||||
static class ApplyDeserializer extends AbstractClientEdmDeserializer<ClientApply> {
|
||||
static class ApplyDeserializer extends AbstractClientCsdlEdmDeserializer<ClientCsdlApply> {
|
||||
|
||||
@Override
|
||||
protected ClientApply doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
|
||||
protected ClientCsdlApply doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
|
||||
throws IOException {
|
||||
final ClientApply apply = new ClientApply();
|
||||
final ClientCsdlApply apply = new ClientCsdlApply();
|
||||
for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
|
||||
final JsonToken token = jp.getCurrentToken();
|
||||
if (token == JsonToken.FIELD_NAME) {
|
||||
if ("Function".equals(jp.getCurrentName())) {
|
||||
apply.setFunction(jp.nextTextValue());
|
||||
} else if ("Annotation".equals(jp.getCurrentName())) {
|
||||
apply.getAnnotations().add(jp.readValueAs(ClientAnnotation.class));
|
||||
apply.getAnnotations().add(jp.readValueAs(ClientCsdlAnnotation.class));
|
||||
} else if (isAnnotationConstExprConstruct(jp)) {
|
||||
apply.getParameters().add(parseAnnotationConstExprConstruct(jp));
|
||||
} else {
|
||||
apply.getParameters().add(jp.readValueAs(AbstractClientDynamicAnnotationExpression.class));
|
||||
apply.getParameters().add(jp.readValueAs(AbstractClientCsdlDynamicAnnotationExpression.class));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -29,8 +29,8 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
@JsonDeserialize(using = ClientCast.CastDeserializer.class)
|
||||
class ClientCast extends AbstractClientAnnotatableDynamicAnnotationExpression implements Cast {
|
||||
@JsonDeserialize(using = ClientCsdlCast.CastDeserializer.class)
|
||||
class ClientCsdlCast extends AbstractClientCsdlAnnotatableDynamicAnnotationExpression implements Cast {
|
||||
|
||||
private static final long serialVersionUID = 3312415984116005313L;
|
||||
|
||||
|
@ -100,19 +100,19 @@ class ClientCast extends AbstractClientAnnotatableDynamicAnnotationExpression im
|
|||
this.value = value;
|
||||
}
|
||||
|
||||
static class CastDeserializer extends AbstractClientEdmDeserializer<ClientCast> {
|
||||
static class CastDeserializer extends AbstractClientCsdlEdmDeserializer<ClientCsdlCast> {
|
||||
|
||||
@Override
|
||||
protected ClientCast doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
|
||||
protected ClientCsdlCast doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
|
||||
throws IOException {
|
||||
final ClientCast cast = new ClientCast();
|
||||
final ClientCsdlCast cast = new ClientCsdlCast();
|
||||
for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
|
||||
final JsonToken token = jp.getCurrentToken();
|
||||
if (token == JsonToken.FIELD_NAME) {
|
||||
if ("Type".equals(jp.getCurrentName())) {
|
||||
cast.setType(jp.nextTextValue());
|
||||
} else if ("Annotation".equals(jp.getCurrentName())) {
|
||||
cast.getAnnotations().add(jp.readValueAs(ClientAnnotation.class));
|
||||
cast.getAnnotations().add(jp.readValueAs(ClientCsdlAnnotation.class));
|
||||
} else if ("MaxLength".equals(jp.getCurrentName())) {
|
||||
final String maxLenght = jp.nextTextValue();
|
||||
cast.setMaxLength(maxLenght.equalsIgnoreCase("max") ? Integer.MAX_VALUE : Integer.valueOf(maxLenght));
|
||||
|
@ -127,7 +127,7 @@ class ClientCast extends AbstractClientAnnotatableDynamicAnnotationExpression im
|
|||
cast.setSrid(SRID.valueOf(srid));
|
||||
}
|
||||
} else {
|
||||
cast.setValue(jp.readValueAs(AbstractClientDynamicAnnotationExpression.class));
|
||||
cast.setValue(jp.readValueAs(AbstractClientCsdlDynamicAnnotationExpression.class));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -30,8 +30,8 @@ import org.apache.olingo.commons.api.edm.provider.annotation.Collection;
|
|||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
||||
|
||||
@JsonDeserialize(using = ClientCollection.CollectionDeserializer.class)
|
||||
class ClientCollection extends AbstractClientDynamicAnnotationExpression implements Collection {
|
||||
@JsonDeserialize(using = ClientCsdlCollection.CollectionDeserializer.class)
|
||||
class ClientCsdlCollection extends AbstractClientCsdlDynamicAnnotationExpression implements Collection {
|
||||
|
||||
private static final long serialVersionUID = -724749123749715643L;
|
||||
|
||||
|
@ -42,18 +42,18 @@ class ClientCollection extends AbstractClientDynamicAnnotationExpression impleme
|
|||
return items;
|
||||
}
|
||||
|
||||
static class CollectionDeserializer extends AbstractClientEdmDeserializer<ClientCollection> {
|
||||
static class CollectionDeserializer extends AbstractClientCsdlEdmDeserializer<ClientCsdlCollection> {
|
||||
@Override
|
||||
protected ClientCollection doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
|
||||
protected ClientCsdlCollection doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
|
||||
throws IOException {
|
||||
final ClientCollection collection = new ClientCollection();
|
||||
final ClientCsdlCollection collection = new ClientCsdlCollection();
|
||||
for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
|
||||
final JsonToken token = jp.getCurrentToken();
|
||||
if (token == JsonToken.FIELD_NAME) {
|
||||
if (isAnnotationConstExprConstruct(jp)) {
|
||||
collection.getItems().add(parseAnnotationConstExprConstruct(jp));
|
||||
} else {
|
||||
collection.getItems().add(jp.readValueAs(AbstractClientDynamicAnnotationExpression.class));
|
||||
collection.getItems().add(jp.readValueAs(AbstractClientCsdlDynamicAnnotationExpression.class));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -28,18 +28,18 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
@JsonDeserialize(using = ClientComplexType.ComplexTypeDeserializer.class)
|
||||
class ClientComplexType extends CsdlComplexType {
|
||||
@JsonDeserialize(using = ClientCsdlComplexType.ComplexTypeDeserializer.class)
|
||||
class ClientCsdlComplexType extends CsdlComplexType {
|
||||
|
||||
private static final long serialVersionUID = 4076944306925840115L;
|
||||
|
||||
static class ComplexTypeDeserializer extends AbstractClientEdmDeserializer<CsdlComplexType> {
|
||||
static class ComplexTypeDeserializer extends AbstractClientCsdlEdmDeserializer<CsdlComplexType> {
|
||||
|
||||
@Override
|
||||
protected CsdlComplexType doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
|
||||
throws IOException {
|
||||
|
||||
final ClientComplexType complexType = new ClientComplexType();
|
||||
final ClientCsdlComplexType complexType = new ClientCsdlComplexType();
|
||||
|
||||
for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
|
||||
final JsonToken token = jp.getCurrentToken();
|
||||
|
@ -54,13 +54,13 @@ class ClientComplexType extends CsdlComplexType {
|
|||
complexType.setOpenType(BooleanUtils.toBoolean(jp.nextTextValue()));
|
||||
} else if ("Property".equals(jp.getCurrentName())) {
|
||||
jp.nextToken();
|
||||
complexType.getProperties().add(jp.readValueAs(ClientProperty.class));
|
||||
complexType.getProperties().add(jp.readValueAs(ClientCsdlProperty.class));
|
||||
} else if ("NavigationProperty".equals(jp.getCurrentName())) {
|
||||
jp.nextToken();
|
||||
complexType.getNavigationProperties().add(jp.readValueAs(ClientNavigationProperty.class));
|
||||
complexType.getNavigationProperties().add(jp.readValueAs(ClientCsdlNavigationProperty.class));
|
||||
} else if ("Annotation".equals(jp.getCurrentName())) {
|
||||
jp.nextToken();
|
||||
complexType.getAnnotations().add(jp.readValueAs(ClientAnnotation.class));
|
||||
complexType.getAnnotations().add(jp.readValueAs(ClientCsdlAnnotation.class));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -20,8 +20,8 @@ package org.apache.olingo.client.core.edm.xml;
|
|||
|
||||
import org.apache.olingo.commons.api.edm.provider.annotation.ConstantAnnotationExpression;
|
||||
|
||||
class ClientConstantAnnotationExpression
|
||||
extends AbstractClientAnnotationExpression implements ConstantAnnotationExpression {
|
||||
class ClientCsdlConstantAnnotationExpression
|
||||
extends AbstractClientCsdlAnnotationExpression implements ConstantAnnotationExpression {
|
||||
|
||||
private static final long serialVersionUID = 5618680702707972904L;
|
||||
|
|
@ -31,8 +31,8 @@ import org.apache.olingo.commons.api.edm.provider.CsdlSchema;
|
|||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
||||
|
||||
@JsonDeserialize(using = ClientDataServices.DataServicesDeserializer.class)
|
||||
class ClientDataServices extends CsdlAbstractEdmItem implements DataServices {
|
||||
@JsonDeserialize(using = ClientCsdlDataServices.DataServicesDeserializer.class)
|
||||
class ClientCsdlDataServices extends CsdlAbstractEdmItem implements DataServices {
|
||||
|
||||
private static final long serialVersionUID = 4200317286476885204L;
|
||||
|
||||
|
@ -65,13 +65,13 @@ class ClientDataServices extends CsdlAbstractEdmItem implements DataServices {
|
|||
return schemas;
|
||||
}
|
||||
|
||||
static class DataServicesDeserializer extends AbstractClientEdmDeserializer<ClientDataServices> {
|
||||
static class DataServicesDeserializer extends AbstractClientCsdlEdmDeserializer<ClientCsdlDataServices> {
|
||||
|
||||
@Override
|
||||
protected ClientDataServices doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
|
||||
protected ClientCsdlDataServices doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
|
||||
throws IOException {
|
||||
|
||||
final ClientDataServices dataServices = new ClientDataServices();
|
||||
final ClientCsdlDataServices dataServices = new ClientCsdlDataServices();
|
||||
|
||||
for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
|
||||
final JsonToken token = jp.getCurrentToken();
|
||||
|
@ -82,7 +82,7 @@ class ClientDataServices extends CsdlAbstractEdmItem implements DataServices {
|
|||
dataServices.setMaxDataServiceVersion(jp.nextTextValue());
|
||||
} else if ("Schema".equals(jp.getCurrentName())) {
|
||||
jp.nextToken();
|
||||
dataServices.getSchemas().add(jp.readValueAs(ClientSchema.class));
|
||||
dataServices.getSchemas().add(jp.readValueAs(ClientCsdlSchema.class));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -32,8 +32,8 @@ import org.apache.olingo.commons.api.edm.provider.CsdlAbstractEdmItem;
|
|||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
||||
|
||||
@JsonDeserialize(using = ClientEdmx.EdmxDeserializer.class)
|
||||
public class ClientEdmx extends CsdlAbstractEdmItem implements Edmx {
|
||||
@JsonDeserialize(using = ClientCsdlEdmx.EdmxDeserializer.class)
|
||||
public class ClientCsdlEdmx extends CsdlAbstractEdmItem implements Edmx {
|
||||
|
||||
private static final long serialVersionUID = -6293476719276092572L;
|
||||
|
||||
|
@ -66,13 +66,13 @@ public class ClientEdmx extends CsdlAbstractEdmItem implements Edmx {
|
|||
return references;
|
||||
}
|
||||
|
||||
static class EdmxDeserializer extends AbstractClientEdmDeserializer<ClientEdmx> {
|
||||
static class EdmxDeserializer extends AbstractClientCsdlEdmDeserializer<ClientCsdlEdmx> {
|
||||
|
||||
@Override
|
||||
protected ClientEdmx doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
|
||||
protected ClientCsdlEdmx doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
|
||||
throws IOException {
|
||||
|
||||
final ClientEdmx edmx = new ClientEdmx();
|
||||
final ClientCsdlEdmx edmx = new ClientCsdlEdmx();
|
||||
|
||||
for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
|
||||
final JsonToken token = jp.getCurrentToken();
|
||||
|
@ -81,10 +81,10 @@ public class ClientEdmx extends CsdlAbstractEdmItem implements Edmx {
|
|||
edmx.setVersion(jp.nextTextValue());
|
||||
} else if ("DataServices".equals(jp.getCurrentName())) {
|
||||
jp.nextToken();
|
||||
edmx.setDataServices(jp.readValueAs(ClientDataServices.class));
|
||||
edmx.setDataServices(jp.readValueAs(ClientCsdlDataServices.class));
|
||||
} else if ("Reference".equals(jp.getCurrentName())) {
|
||||
jp.nextToken();
|
||||
edmx.getReferences().add(jp.readValueAs(ClientReference.class));
|
||||
edmx.getReferences().add(jp.readValueAs(ClientCsdlReference.class));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -27,18 +27,18 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
@JsonDeserialize(using = ClientEntityContainer.EntityContainerDeserializer.class)
|
||||
class ClientEntityContainer extends CsdlEntityContainer {
|
||||
@JsonDeserialize(using = ClientCsdlEntityContainer.EntityContainerDeserializer.class)
|
||||
class ClientCsdlEntityContainer extends CsdlEntityContainer {
|
||||
|
||||
private static final long serialVersionUID = 5631432527646955795L;
|
||||
|
||||
static class EntityContainerDeserializer extends AbstractClientEdmDeserializer<ClientEntityContainer> {
|
||||
static class EntityContainerDeserializer extends AbstractClientCsdlEdmDeserializer<ClientCsdlEntityContainer> {
|
||||
|
||||
@Override
|
||||
protected ClientEntityContainer doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
|
||||
protected ClientCsdlEntityContainer doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
|
||||
throws IOException {
|
||||
|
||||
final ClientEntityContainer entityContainer = new ClientEntityContainer();
|
||||
final ClientCsdlEntityContainer entityContainer = new ClientCsdlEntityContainer();
|
||||
|
||||
for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
|
||||
final JsonToken token = jp.getCurrentToken();
|
||||
|
@ -49,19 +49,19 @@ class ClientEntityContainer extends CsdlEntityContainer {
|
|||
entityContainer.setExtendsContainer(jp.nextTextValue());
|
||||
} else if ("EntitySet".equals(jp.getCurrentName())) {
|
||||
jp.nextToken();
|
||||
entityContainer.getEntitySets().add(jp.readValueAs(ClientEntitySet.class));
|
||||
entityContainer.getEntitySets().add(jp.readValueAs(ClientCsdlEntitySet.class));
|
||||
} else if ("Singleton".equals(jp.getCurrentName())) {
|
||||
jp.nextToken();
|
||||
entityContainer.getSingletons().add(jp.readValueAs(ClientSingleton.class));
|
||||
entityContainer.getSingletons().add(jp.readValueAs(ClientCsdlSingleton.class));
|
||||
} else if ("ActionImport".equals(jp.getCurrentName())) {
|
||||
jp.nextToken();
|
||||
entityContainer.getActionImports().add(jp.readValueAs(ClientActionImport.class));
|
||||
entityContainer.getActionImports().add(jp.readValueAs(ClientCsdlActionImport.class));
|
||||
} else if ("FunctionImport".equals(jp.getCurrentName())) {
|
||||
jp.nextToken();
|
||||
entityContainer.getFunctionImports().add(jp.readValueAs(ClientFunctionImport.class));
|
||||
entityContainer.getFunctionImports().add(jp.readValueAs(ClientCsdlFunctionImport.class));
|
||||
} else if ("Annotation".equals(jp.getCurrentName())) {
|
||||
jp.nextToken();
|
||||
entityContainer.getAnnotations().add(jp.readValueAs(ClientAnnotation.class));
|
||||
entityContainer.getAnnotations().add(jp.readValueAs(ClientCsdlAnnotation.class));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -30,8 +30,8 @@ import org.apache.olingo.commons.api.edm.provider.CsdlPropertyRef;
|
|||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
||||
|
||||
@JsonDeserialize(using = ClientEntityKey.EntityKeyDeserializer.class)
|
||||
class ClientEntityKey extends CsdlAbstractEdmItem {
|
||||
@JsonDeserialize(using = ClientCsdlEntityKey.EntityKeyDeserializer.class)
|
||||
class ClientCsdlEntityKey extends CsdlAbstractEdmItem {
|
||||
|
||||
private static final long serialVersionUID = 520227585458843347L;
|
||||
|
||||
|
@ -41,19 +41,19 @@ class ClientEntityKey extends CsdlAbstractEdmItem {
|
|||
return propertyRefs;
|
||||
}
|
||||
|
||||
static class EntityKeyDeserializer extends AbstractClientEdmDeserializer<ClientEntityKey> {
|
||||
static class EntityKeyDeserializer extends AbstractClientCsdlEdmDeserializer<ClientCsdlEntityKey> {
|
||||
@Override
|
||||
protected ClientEntityKey doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
|
||||
protected ClientCsdlEntityKey doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
|
||||
throws IOException {
|
||||
|
||||
final ClientEntityKey entityKey = new ClientEntityKey();
|
||||
final ClientCsdlEntityKey entityKey = new ClientCsdlEntityKey();
|
||||
|
||||
for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
|
||||
final JsonToken token = jp.getCurrentToken();
|
||||
|
||||
if (token == JsonToken.FIELD_NAME && "PropertyRef".equals(jp.getCurrentName())) {
|
||||
jp.nextToken();
|
||||
entityKey.getPropertyRefs().add(jp.readValueAs(ClientPropertyRef.class));
|
||||
entityKey.getPropertyRefs().add(jp.readValueAs(ClientCsdlPropertyRef.class));
|
||||
}
|
||||
}
|
||||
|
|
@ -28,17 +28,17 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
@JsonDeserialize(using = ClientEntitySet.EntitySetDeserializer.class)
|
||||
class ClientEntitySet extends CsdlEntitySet {
|
||||
@JsonDeserialize(using = ClientCsdlEntitySet.EntitySetDeserializer.class)
|
||||
class ClientCsdlEntitySet extends CsdlEntitySet {
|
||||
|
||||
private static final long serialVersionUID = -5553885465204370676L;
|
||||
|
||||
static class EntitySetDeserializer extends AbstractClientEdmDeserializer<CsdlEntitySet> {
|
||||
static class EntitySetDeserializer extends AbstractClientCsdlEdmDeserializer<CsdlEntitySet> {
|
||||
@Override
|
||||
protected CsdlEntitySet doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
|
||||
throws IOException {
|
||||
|
||||
final ClientEntitySet entitySet = new ClientEntitySet();
|
||||
final ClientCsdlEntitySet entitySet = new ClientCsdlEntitySet();
|
||||
|
||||
for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
|
||||
final JsonToken token = jp.getCurrentToken();
|
||||
|
@ -51,10 +51,10 @@ class ClientEntitySet extends CsdlEntitySet {
|
|||
entitySet.setIncludeInServiceDocument(BooleanUtils.toBoolean(jp.nextTextValue()));
|
||||
} else if ("NavigationPropertyBinding".equals(jp.getCurrentName())) {
|
||||
jp.nextToken();
|
||||
entitySet.getNavigationPropertyBindings().add(jp.readValueAs(ClientNavigationPropertyBinding.class));
|
||||
entitySet.getNavigationPropertyBindings().add(jp.readValueAs(ClientCsdlNavigationPropertyBinding.class));
|
||||
} else if ("Annotation".equals(jp.getCurrentName())) {
|
||||
jp.nextToken();
|
||||
entitySet.getAnnotations().add(jp.readValueAs(ClientAnnotation.class));
|
||||
entitySet.getAnnotations().add(jp.readValueAs(ClientCsdlAnnotation.class));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -28,17 +28,17 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
@JsonDeserialize(using = ClientEntityType.EntityTypeDeserializer.class)
|
||||
class ClientEntityType extends CsdlEntityType {
|
||||
@JsonDeserialize(using = ClientCsdlEntityType.EntityTypeDeserializer.class)
|
||||
class ClientCsdlEntityType extends CsdlEntityType {
|
||||
|
||||
private static final long serialVersionUID = -3986417775876689669L;
|
||||
|
||||
static class EntityTypeDeserializer extends AbstractClientEdmDeserializer<CsdlEntityType> {
|
||||
static class EntityTypeDeserializer extends AbstractClientCsdlEdmDeserializer<CsdlEntityType> {
|
||||
@Override
|
||||
protected CsdlEntityType doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
|
||||
throws IOException {
|
||||
|
||||
final ClientEntityType entityType = new ClientEntityType();
|
||||
final ClientCsdlEntityType entityType = new ClientCsdlEntityType();
|
||||
|
||||
for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
|
||||
final JsonToken token = jp.getCurrentToken();
|
||||
|
@ -55,17 +55,17 @@ class ClientEntityType extends CsdlEntityType {
|
|||
entityType.setHasStream(BooleanUtils.toBoolean(jp.nextTextValue()));
|
||||
} else if ("Key".equals(jp.getCurrentName())) {
|
||||
jp.nextToken();
|
||||
ClientEntityKey keyImpl = jp.readValueAs(ClientEntityKey.class);
|
||||
ClientCsdlEntityKey keyImpl = jp.readValueAs(ClientCsdlEntityKey.class);
|
||||
entityType.setKey(keyImpl.getPropertyRefs());
|
||||
} else if ("Property".equals(jp.getCurrentName())) {
|
||||
jp.nextToken();
|
||||
entityType.getProperties().add(jp.readValueAs(ClientProperty.class));
|
||||
entityType.getProperties().add(jp.readValueAs(ClientCsdlProperty.class));
|
||||
} else if ("NavigationProperty".equals(jp.getCurrentName())) {
|
||||
jp.nextToken();
|
||||
entityType.getNavigationProperties().add(jp.readValueAs(ClientNavigationProperty.class));
|
||||
entityType.getNavigationProperties().add(jp.readValueAs(ClientCsdlNavigationProperty.class));
|
||||
} else if ("Annotation".equals(jp.getCurrentName())) {
|
||||
jp.nextToken();
|
||||
entityType.getAnnotations().add(jp.readValueAs(ClientAnnotation.class));
|
||||
entityType.getAnnotations().add(jp.readValueAs(ClientCsdlAnnotation.class));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -26,12 +26,12 @@ import org.apache.olingo.commons.api.edm.provider.CsdlEnumMember;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
@JsonDeserialize(using = ClientEnumMember.EnumMemberDeserializer.class)
|
||||
class ClientEnumMember extends CsdlEnumMember {
|
||||
@JsonDeserialize(using = ClientCsdlEnumMember.EnumMemberDeserializer.class)
|
||||
class ClientCsdlEnumMember extends CsdlEnumMember {
|
||||
|
||||
private static final long serialVersionUID = -6138606817225829791L;
|
||||
|
||||
static class EnumMemberDeserializer extends AbstractClientEdmDeserializer<CsdlEnumMember> {
|
||||
static class EnumMemberDeserializer extends AbstractClientCsdlEdmDeserializer<CsdlEnumMember> {
|
||||
@Override
|
||||
protected CsdlEnumMember doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
|
||||
throws IOException {
|
||||
|
@ -47,7 +47,7 @@ class ClientEnumMember extends CsdlEnumMember {
|
|||
member.setValue(jp.nextTextValue());
|
||||
} else if ("Annotation".equals(jp.getCurrentName())) {
|
||||
jp.nextToken();
|
||||
member.getAnnotations().add(jp.readValueAs(ClientAnnotation.class));
|
||||
member.getAnnotations().add(jp.readValueAs(ClientCsdlAnnotation.class));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -28,17 +28,17 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
@JsonDeserialize(using = ClientEnumType.EnumTypeDeserializer.class)
|
||||
class ClientEnumType extends CsdlEnumType {
|
||||
@JsonDeserialize(using = ClientCsdlEnumType.EnumTypeDeserializer.class)
|
||||
class ClientCsdlEnumType extends CsdlEnumType {
|
||||
|
||||
private static final long serialVersionUID = 9191189755592743333L;
|
||||
|
||||
static class EnumTypeDeserializer extends AbstractClientEdmDeserializer<ClientEnumType> {
|
||||
static class EnumTypeDeserializer extends AbstractClientCsdlEdmDeserializer<ClientCsdlEnumType> {
|
||||
@Override
|
||||
protected ClientEnumType doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
|
||||
protected ClientCsdlEnumType doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
|
||||
throws IOException {
|
||||
|
||||
final ClientEnumType enumType = new ClientEnumType();
|
||||
final ClientCsdlEnumType enumType = new ClientCsdlEnumType();
|
||||
|
||||
for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
|
||||
final JsonToken token = jp.getCurrentToken();
|
||||
|
@ -51,10 +51,10 @@ class ClientEnumType extends CsdlEnumType {
|
|||
enumType.setFlags(BooleanUtils.toBoolean(jp.nextTextValue()));
|
||||
} else if ("Member".equals(jp.getCurrentName())) {
|
||||
jp.nextToken();
|
||||
enumType.getMembers().add(jp.readValueAs(ClientEnumMember.class));
|
||||
enumType.getMembers().add(jp.readValueAs(ClientCsdlEnumMember.class));
|
||||
} else if ("Annotation".equals(jp.getCurrentName())) {
|
||||
jp.nextToken();
|
||||
enumType.getAnnotations().add(jp.readValueAs(ClientAnnotation.class));
|
||||
enumType.getAnnotations().add(jp.readValueAs(ClientCsdlAnnotation.class));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -28,17 +28,17 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
@JsonDeserialize(using = ClientFunction.FunctionDeserializer.class)
|
||||
class ClientFunction extends CsdlFunction {
|
||||
@JsonDeserialize(using = ClientCsdlFunction.FunctionDeserializer.class)
|
||||
class ClientCsdlFunction extends CsdlFunction {
|
||||
|
||||
private static final long serialVersionUID = -5494898295282843362L;
|
||||
|
||||
static class FunctionDeserializer extends AbstractClientEdmDeserializer<ClientFunction> {
|
||||
static class FunctionDeserializer extends AbstractClientCsdlEdmDeserializer<ClientCsdlFunction> {
|
||||
@Override
|
||||
protected ClientFunction doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
|
||||
protected ClientCsdlFunction doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
|
||||
throws IOException {
|
||||
|
||||
final ClientFunction functionImpl = new ClientFunction();
|
||||
final ClientCsdlFunction functionImpl = new ClientCsdlFunction();
|
||||
|
||||
for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
|
||||
final JsonToken token = jp.getCurrentToken();
|
||||
|
@ -53,12 +53,12 @@ class ClientFunction extends CsdlFunction {
|
|||
functionImpl.setEntitySetPath(jp.nextTextValue());
|
||||
} else if ("Parameter".equals(jp.getCurrentName())) {
|
||||
jp.nextToken();
|
||||
functionImpl.getParameters().add(jp.readValueAs(ClientParameter.class));
|
||||
functionImpl.getParameters().add(jp.readValueAs(ClientCsdlParameter.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(ClientAnnotation.class));
|
||||
functionImpl.getAnnotations().add(jp.readValueAs(ClientCsdlAnnotation.class));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -28,17 +28,17 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
@JsonDeserialize(using = ClientFunctionImport.FunctionImportDeserializer.class)
|
||||
class ClientFunctionImport extends CsdlFunctionImport {
|
||||
@JsonDeserialize(using = ClientCsdlFunctionImport.FunctionImportDeserializer.class)
|
||||
class ClientCsdlFunctionImport extends CsdlFunctionImport {
|
||||
|
||||
private static final long serialVersionUID = -1686801084142932402L;
|
||||
|
||||
static class FunctionImportDeserializer extends AbstractClientEdmDeserializer<ClientFunctionImport> {
|
||||
static class FunctionImportDeserializer extends AbstractClientCsdlEdmDeserializer<ClientCsdlFunctionImport> {
|
||||
@Override
|
||||
protected ClientFunctionImport doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
|
||||
protected ClientCsdlFunctionImport doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
|
||||
throws IOException {
|
||||
|
||||
final ClientFunctionImport functImpImpl = new ClientFunctionImport();
|
||||
final ClientCsdlFunctionImport functImpImpl = new ClientCsdlFunctionImport();
|
||||
|
||||
for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
|
||||
final JsonToken token = jp.getCurrentToken();
|
||||
|
@ -53,7 +53,7 @@ class ClientFunctionImport extends CsdlFunctionImport {
|
|||
functImpImpl.setIncludeInServiceDocument(BooleanUtils.toBoolean(jp.nextTextValue()));
|
||||
} else if ("Annotation".equals(jp.getCurrentName())) {
|
||||
jp.nextToken();
|
||||
functImpImpl.getAnnotations().add(jp.readValueAs(ClientAnnotation.class));
|
||||
functImpImpl.getAnnotations().add(jp.readValueAs(ClientCsdlAnnotation.class));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -21,7 +21,7 @@ package org.apache.olingo.client.core.edm.xml;
|
|||
import org.apache.olingo.commons.api.edm.provider.annotation.AnnotationExpression;
|
||||
import org.apache.olingo.commons.api.edm.provider.annotation.If;
|
||||
|
||||
class ClientIf extends AbstractClientAnnotatableDynamicAnnotationExpression implements If {
|
||||
class ClientCsdlIf extends AbstractClientCsdlAnnotatableDynamicAnnotationExpression implements If {
|
||||
|
||||
private static final long serialVersionUID = -8571383625077590656L;
|
||||
|
|
@ -27,8 +27,8 @@ import org.apache.olingo.commons.api.edm.provider.CsdlAbstractEdmItem;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
@JsonDeserialize(using = ClientInclude.IncludeDeserializer.class)
|
||||
class ClientInclude extends CsdlAbstractEdmItem implements Include {
|
||||
@JsonDeserialize(using = ClientCsdlInclude.IncludeDeserializer.class)
|
||||
class ClientCsdlInclude extends CsdlAbstractEdmItem implements Include {
|
||||
|
||||
private static final long serialVersionUID = -5450008299655584221L;
|
||||
|
||||
|
@ -53,12 +53,12 @@ class ClientInclude extends CsdlAbstractEdmItem implements Include {
|
|||
this.alias = alias;
|
||||
}
|
||||
|
||||
static class IncludeDeserializer extends AbstractClientEdmDeserializer<Include> {
|
||||
static class IncludeDeserializer extends AbstractClientCsdlEdmDeserializer<Include> {
|
||||
@Override
|
||||
protected Include doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
|
||||
throws IOException {
|
||||
|
||||
final ClientInclude include = new ClientInclude();
|
||||
final ClientCsdlInclude include = new ClientCsdlInclude();
|
||||
|
||||
for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
|
||||
final JsonToken token = jp.getCurrentToken();
|
|
@ -27,8 +27,8 @@ import org.apache.olingo.commons.api.edm.provider.CsdlAbstractEdmItem;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
@JsonDeserialize(using = ClientIncludeAnnotations.IncludeAnnotationsDeserializer.class)
|
||||
class ClientIncludeAnnotations extends CsdlAbstractEdmItem implements IncludeAnnotations {
|
||||
@JsonDeserialize(using = ClientCsdlIncludeAnnotations.IncludeAnnotationsDeserializer.class)
|
||||
class ClientCsdlIncludeAnnotations extends CsdlAbstractEdmItem implements IncludeAnnotations {
|
||||
|
||||
private static final long serialVersionUID = -8157841387011422396L;
|
||||
|
||||
|
@ -63,12 +63,12 @@ class ClientIncludeAnnotations extends CsdlAbstractEdmItem implements IncludeAnn
|
|||
this.targetNamespace = targetNamespace;
|
||||
}
|
||||
|
||||
static class IncludeAnnotationsDeserializer extends AbstractClientEdmDeserializer<IncludeAnnotations> {
|
||||
static class IncludeAnnotationsDeserializer extends AbstractClientCsdlEdmDeserializer<IncludeAnnotations> {
|
||||
@Override
|
||||
protected IncludeAnnotations doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
|
||||
throws IOException {
|
||||
|
||||
final ClientIncludeAnnotations member = new ClientIncludeAnnotations();
|
||||
final ClientCsdlIncludeAnnotations member = new ClientCsdlIncludeAnnotations();
|
||||
|
||||
for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
|
||||
final JsonToken token = jp.getCurrentToken();
|
|
@ -29,8 +29,8 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
@JsonDeserialize(using = ClientIsOf.IsOfDeserializer.class)
|
||||
class ClientIsOf extends AbstractClientAnnotatableDynamicAnnotationExpression implements IsOf {
|
||||
@JsonDeserialize(using = ClientCsdlIsOf.IsOfDeserializer.class)
|
||||
class ClientCsdlIsOf extends AbstractClientCsdlAnnotatableDynamicAnnotationExpression implements IsOf {
|
||||
|
||||
private static final long serialVersionUID = -893355856129761174L;
|
||||
|
||||
|
@ -100,18 +100,18 @@ class ClientIsOf extends AbstractClientAnnotatableDynamicAnnotationExpression im
|
|||
this.value = value;
|
||||
}
|
||||
|
||||
static class IsOfDeserializer extends AbstractClientEdmDeserializer<ClientIsOf> {
|
||||
static class IsOfDeserializer extends AbstractClientCsdlEdmDeserializer<ClientCsdlIsOf> {
|
||||
@Override
|
||||
protected ClientIsOf doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
|
||||
protected ClientCsdlIsOf doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
|
||||
throws IOException {
|
||||
final ClientIsOf isof = new ClientIsOf();
|
||||
final ClientCsdlIsOf isof = new ClientCsdlIsOf();
|
||||
for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
|
||||
final JsonToken token = jp.getCurrentToken();
|
||||
if (token == JsonToken.FIELD_NAME) {
|
||||
if ("Type".equals(jp.getCurrentName())) {
|
||||
isof.setType(jp.nextTextValue());
|
||||
} else if ("Annotation".equals(jp.getCurrentName())) {
|
||||
isof.getAnnotations().add(jp.readValueAs(ClientAnnotation.class));
|
||||
isof.getAnnotations().add(jp.readValueAs(ClientCsdlAnnotation.class));
|
||||
} else if ("MaxLength".equals(jp.getCurrentName())) {
|
||||
final String maxLenght = jp.nextTextValue();
|
||||
isof.setMaxLength(maxLenght.equalsIgnoreCase("max") ? Integer.MAX_VALUE : Integer.valueOf(maxLenght));
|
||||
|
@ -126,7 +126,7 @@ class ClientIsOf extends AbstractClientAnnotatableDynamicAnnotationExpression im
|
|||
isof.setSrid(SRID.valueOf(srid));
|
||||
}
|
||||
} else {
|
||||
isof.setValue(jp.readValueAs(AbstractClientDynamicAnnotationExpression.class));
|
||||
isof.setValue(jp.readValueAs(AbstractClientCsdlDynamicAnnotationExpression.class));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -28,9 +28,9 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
@JsonDeserialize(using = ClientLabeledElement.LabeledElementDeserializer.class)
|
||||
class ClientLabeledElement
|
||||
extends AbstractClientAnnotatableDynamicAnnotationExpression implements LabeledElement {
|
||||
@JsonDeserialize(using = ClientCsdlLabeledElement.LabeledElementDeserializer.class)
|
||||
class ClientCsdlLabeledElement
|
||||
extends AbstractClientCsdlAnnotatableDynamicAnnotationExpression implements LabeledElement {
|
||||
|
||||
private static final long serialVersionUID = 4909387630253341824L;
|
||||
|
||||
|
@ -56,20 +56,20 @@ class ClientLabeledElement
|
|||
this.value = value;
|
||||
}
|
||||
|
||||
static class LabeledElementDeserializer extends AbstractClientEdmDeserializer<ClientLabeledElement> {
|
||||
static class LabeledElementDeserializer extends AbstractClientCsdlEdmDeserializer<ClientCsdlLabeledElement> {
|
||||
@Override
|
||||
protected ClientLabeledElement doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
|
||||
protected ClientCsdlLabeledElement doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
|
||||
throws IOException {
|
||||
final ClientLabeledElement element = new ClientLabeledElement();
|
||||
final ClientCsdlLabeledElement element = new ClientCsdlLabeledElement();
|
||||
for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
|
||||
final JsonToken token = jp.getCurrentToken();
|
||||
if (token == JsonToken.FIELD_NAME) {
|
||||
if ("Name".equals(jp.getCurrentName())) {
|
||||
element.setName(jp.nextTextValue());
|
||||
} else if ("Annotation".equals(jp.getCurrentName())) {
|
||||
element.getAnnotations().add(jp.readValueAs(ClientAnnotation.class));
|
||||
element.getAnnotations().add(jp.readValueAs(ClientCsdlAnnotation.class));
|
||||
} else {
|
||||
element.setValue(jp.readValueAs(AbstractClientDynamicAnnotationExpression.class));
|
||||
element.setValue(jp.readValueAs(AbstractClientCsdlDynamicAnnotationExpression.class));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -20,8 +20,8 @@ package org.apache.olingo.client.core.edm.xml;
|
|||
|
||||
import org.apache.olingo.commons.api.edm.provider.annotation.LabeledElementReference;
|
||||
|
||||
class ClientLabeledElementReference
|
||||
extends AbstractClientElementOrAttributeExpression implements LabeledElementReference {
|
||||
class ClientCsdlLabeledElementReference
|
||||
extends AbstractClientCsdlElementOrAttributeExpression implements LabeledElementReference {
|
||||
|
||||
private static final long serialVersionUID = 7560525604021670529L;
|
||||
|
|
@ -28,18 +28,18 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
@JsonDeserialize(using = ClientNavigationProperty.NavigationPropertyDeserializer.class)
|
||||
class ClientNavigationProperty extends CsdlNavigationProperty {
|
||||
@JsonDeserialize(using = ClientCsdlNavigationProperty.NavigationPropertyDeserializer.class)
|
||||
class ClientCsdlNavigationProperty extends CsdlNavigationProperty {
|
||||
|
||||
private static final long serialVersionUID = 6240231735592427582L;
|
||||
|
||||
static class NavigationPropertyDeserializer extends AbstractClientEdmDeserializer<CsdlNavigationProperty> {
|
||||
static class NavigationPropertyDeserializer extends AbstractClientCsdlEdmDeserializer<CsdlNavigationProperty> {
|
||||
|
||||
@Override
|
||||
protected CsdlNavigationProperty doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
|
||||
throws IOException {
|
||||
|
||||
final CsdlNavigationProperty property = new ClientNavigationProperty();
|
||||
final CsdlNavigationProperty property = new ClientCsdlNavigationProperty();
|
||||
|
||||
for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
|
||||
final JsonToken token = jp.getCurrentToken();
|
||||
|
@ -64,13 +64,13 @@ class ClientNavigationProperty extends CsdlNavigationProperty {
|
|||
property.setContainsTarget(BooleanUtils.toBoolean(jp.nextTextValue()));
|
||||
} else if ("ReferentialConstraint".equals(jp.getCurrentName())) {
|
||||
jp.nextToken();
|
||||
property.getReferentialConstraints().add(jp.readValueAs(ClientReferentialConstraint.class));
|
||||
property.getReferentialConstraints().add(jp.readValueAs(ClientCsdlReferentialConstraint.class));
|
||||
} else if ("OnDelete".equals(jp.getCurrentName())) {
|
||||
jp.nextToken();
|
||||
property.setOnDelete(jp.readValueAs(ClientOnDelete.class));
|
||||
property.setOnDelete(jp.readValueAs(ClientCsdlOnDelete.class));
|
||||
} else if ("Annotation".equals(jp.getCurrentName())) {
|
||||
jp.nextToken();
|
||||
property.getAnnotations().add(jp.readValueAs(ClientAnnotation.class));
|
||||
property.getAnnotations().add(jp.readValueAs(ClientCsdlAnnotation.class));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -26,8 +26,8 @@ import org.apache.olingo.commons.api.edm.provider.CsdlNavigationPropertyBinding;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
@JsonDeserialize(using = ClientNavigationPropertyBinding.NavigationPropertyBindingDeserializer.class)
|
||||
class ClientNavigationPropertyBinding extends CsdlNavigationPropertyBinding {
|
||||
@JsonDeserialize(using = ClientCsdlNavigationPropertyBinding.NavigationPropertyBindingDeserializer.class)
|
||||
class ClientCsdlNavigationPropertyBinding extends CsdlNavigationPropertyBinding {
|
||||
|
||||
private static final long serialVersionUID = -7056978592235483660L;
|
||||
|
||||
|
@ -44,12 +44,12 @@ class ClientNavigationPropertyBinding extends CsdlNavigationPropertyBinding {
|
|||
}
|
||||
|
||||
static class NavigationPropertyBindingDeserializer extends
|
||||
AbstractClientEdmDeserializer<CsdlNavigationPropertyBinding> {
|
||||
AbstractClientCsdlEdmDeserializer<CsdlNavigationPropertyBinding> {
|
||||
@Override
|
||||
protected CsdlNavigationPropertyBinding doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
|
||||
throws IOException {
|
||||
|
||||
final ClientNavigationPropertyBinding member = new ClientNavigationPropertyBinding();
|
||||
final ClientCsdlNavigationPropertyBinding member = new ClientCsdlNavigationPropertyBinding();
|
||||
|
||||
for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
|
||||
final JsonToken token = jp.getCurrentToken();
|
|
@ -20,7 +20,7 @@ package org.apache.olingo.client.core.edm.xml;
|
|||
|
||||
import org.apache.olingo.commons.api.edm.provider.annotation.NavigationPropertyPath;
|
||||
|
||||
class ClientNavigationPropertyPath extends AbstractClientElementOrAttributeExpression
|
||||
class ClientCsdlNavigationPropertyPath extends AbstractClientCsdlElementOrAttributeExpression
|
||||
implements NavigationPropertyPath {
|
||||
|
||||
private static final long serialVersionUID = 879840502446301312L;
|
|
@ -21,7 +21,7 @@ package org.apache.olingo.client.core.edm.xml;
|
|||
import org.apache.olingo.commons.api.edm.provider.annotation.DynamicAnnotationExpression;
|
||||
import org.apache.olingo.commons.api.edm.provider.annotation.Not;
|
||||
|
||||
class ClientNot extends AbstractClientDynamicAnnotationExpression implements Not {
|
||||
class ClientCsdlNot extends AbstractClientCsdlDynamicAnnotationExpression implements Not {
|
||||
|
||||
private static final long serialVersionUID = -437788415922966812L;
|
||||
|
|
@ -27,21 +27,21 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
@JsonDeserialize(using = ClientNull.NullDeserializer.class)
|
||||
class ClientNull extends AbstractClientAnnotatableDynamicAnnotationExpression implements Null {
|
||||
@JsonDeserialize(using = ClientCsdlNull.NullDeserializer.class)
|
||||
class ClientCsdlNull extends AbstractClientCsdlAnnotatableDynamicAnnotationExpression implements Null {
|
||||
|
||||
private static final long serialVersionUID = -3148516847180393142L;
|
||||
|
||||
static class NullDeserializer extends AbstractClientEdmDeserializer<ClientNull> {
|
||||
static class NullDeserializer extends AbstractClientCsdlEdmDeserializer<ClientCsdlNull> {
|
||||
@Override
|
||||
protected ClientNull doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
|
||||
protected ClientCsdlNull doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
|
||||
throws IOException {
|
||||
final ClientNull _null = new ClientNull();
|
||||
final ClientCsdlNull _null = new ClientCsdlNull();
|
||||
for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
|
||||
final JsonToken token = jp.getCurrentToken();
|
||||
if (token == JsonToken.FIELD_NAME) {
|
||||
if ("Annotation".equals(jp.getCurrentName())) {
|
||||
_null.getAnnotations().add(jp.readValueAs(ClientAnnotation.class));
|
||||
_null.getAnnotations().add(jp.readValueAs(ClientCsdlAnnotation.class));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -27,17 +27,17 @@ import org.apache.olingo.commons.api.edm.provider.CsdlOnDeleteAction;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
@JsonDeserialize(using = ClientOnDelete.OnDeleteDeserializer.class)
|
||||
class ClientOnDelete extends CsdlOnDelete {
|
||||
@JsonDeserialize(using = ClientCsdlOnDelete.OnDeleteDeserializer.class)
|
||||
class ClientCsdlOnDelete extends CsdlOnDelete {
|
||||
|
||||
private static final long serialVersionUID = -7130889202653716784L;
|
||||
|
||||
static class OnDeleteDeserializer extends AbstractClientEdmDeserializer<CsdlOnDelete> {
|
||||
static class OnDeleteDeserializer extends AbstractClientCsdlEdmDeserializer<CsdlOnDelete> {
|
||||
@Override
|
||||
protected CsdlOnDelete doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
|
||||
throws IOException {
|
||||
|
||||
final CsdlOnDelete ondelete = new ClientOnDelete();
|
||||
final CsdlOnDelete ondelete = new ClientCsdlOnDelete();
|
||||
|
||||
for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
|
||||
final JsonToken token = jp.getCurrentToken();
|
|
@ -29,17 +29,17 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
@JsonDeserialize(using = ClientParameter.ParameterDeserializer.class)
|
||||
class ClientParameter extends CsdlParameter {
|
||||
@JsonDeserialize(using = ClientCsdlParameter.ParameterDeserializer.class)
|
||||
class ClientCsdlParameter extends CsdlParameter {
|
||||
|
||||
private static final long serialVersionUID = 7119478691341167904L;
|
||||
|
||||
static class ParameterDeserializer extends AbstractClientEdmDeserializer<ClientParameter> {
|
||||
static class ParameterDeserializer extends AbstractClientCsdlEdmDeserializer<ClientCsdlParameter> {
|
||||
@Override
|
||||
protected ClientParameter doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
|
||||
protected ClientCsdlParameter doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
|
||||
throws IOException {
|
||||
|
||||
final ClientParameter parameter = new ClientParameter();
|
||||
final ClientCsdlParameter parameter = new ClientCsdlParameter();
|
||||
|
||||
for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
|
||||
final JsonToken token = jp.getCurrentToken();
|
||||
|
@ -73,7 +73,7 @@ class ClientParameter extends CsdlParameter {
|
|||
}
|
||||
} else if ("Annotation".equals(jp.getCurrentName())) {
|
||||
jp.nextToken();
|
||||
parameter.getAnnotations().add(jp.readValueAs(ClientAnnotation.class));
|
||||
parameter.getAnnotations().add(jp.readValueAs(ClientCsdlAnnotation.class));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -20,7 +20,7 @@ package org.apache.olingo.client.core.edm.xml;
|
|||
|
||||
import org.apache.olingo.commons.api.edm.provider.annotation.Path;
|
||||
|
||||
class ClientPath extends AbstractClientElementOrAttributeExpression implements Path {
|
||||
class ClientCsdlPath extends AbstractClientCsdlElementOrAttributeExpression implements Path {
|
||||
|
||||
private static final long serialVersionUID = 6020168217561402545L;
|
||||
|
|
@ -29,17 +29,17 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
@JsonDeserialize(using = ClientProperty.PropertyDeserializer.class)
|
||||
class ClientProperty extends CsdlProperty {
|
||||
@JsonDeserialize(using = ClientCsdlProperty.PropertyDeserializer.class)
|
||||
class ClientCsdlProperty extends CsdlProperty {
|
||||
|
||||
private static final long serialVersionUID = -4521766603286651372L;
|
||||
|
||||
static class PropertyDeserializer extends AbstractClientEdmDeserializer<ClientProperty> {
|
||||
static class PropertyDeserializer extends AbstractClientCsdlEdmDeserializer<ClientCsdlProperty> {
|
||||
@Override
|
||||
protected ClientProperty doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
|
||||
protected ClientCsdlProperty doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
|
||||
throws IOException {
|
||||
|
||||
final ClientProperty property = new ClientProperty();
|
||||
final ClientCsdlProperty property = new ClientCsdlProperty();
|
||||
|
||||
for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
|
||||
final JsonToken token = jp.getCurrentToken();
|
||||
|
@ -77,7 +77,7 @@ class ClientProperty extends CsdlProperty {
|
|||
}
|
||||
} else if ("Annotation".equals(jp.getCurrentName())) {
|
||||
jp.nextToken();
|
||||
property.getAnnotations().add(jp.readValueAs(ClientAnnotation.class));
|
||||
property.getAnnotations().add(jp.readValueAs(ClientCsdlAnnotation.class));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -20,7 +20,7 @@ package org.apache.olingo.client.core.edm.xml;
|
|||
|
||||
import org.apache.olingo.commons.api.edm.provider.annotation.PropertyPath;
|
||||
|
||||
class ClientPropertyPath extends AbstractClientElementOrAttributeExpression implements PropertyPath {
|
||||
class ClientCsdlPropertyPath extends AbstractClientCsdlElementOrAttributeExpression implements PropertyPath {
|
||||
|
||||
private static final long serialVersionUID = -9133862135834738470L;
|
||||
|
|
@ -26,17 +26,17 @@ import org.apache.olingo.commons.api.edm.provider.CsdlPropertyRef;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
@JsonDeserialize(using = ClientPropertyRef.PropertyRefDeserializer.class)
|
||||
class ClientPropertyRef extends CsdlPropertyRef {
|
||||
@JsonDeserialize(using = ClientCsdlPropertyRef.PropertyRefDeserializer.class)
|
||||
class ClientCsdlPropertyRef extends CsdlPropertyRef {
|
||||
|
||||
private static final long serialVersionUID = 1504095609268590326L;
|
||||
|
||||
static class PropertyRefDeserializer extends AbstractClientEdmDeserializer<CsdlPropertyRef> {
|
||||
static class PropertyRefDeserializer extends AbstractClientCsdlEdmDeserializer<CsdlPropertyRef> {
|
||||
@Override
|
||||
protected CsdlPropertyRef doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
|
||||
throws IOException {
|
||||
|
||||
final CsdlPropertyRef propertyRef = new ClientPropertyRef();
|
||||
final CsdlPropertyRef propertyRef = new ClientCsdlPropertyRef();
|
||||
|
||||
for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
|
||||
final JsonToken token = jp.getCurrentToken();
|
|
@ -28,8 +28,9 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
@JsonDeserialize(using = ClientPropertyValue.PropertyValueDeserializer.class)
|
||||
class ClientPropertyValue extends AbstractClientAnnotatableDynamicAnnotationExpression implements PropertyValue {
|
||||
@JsonDeserialize(using = ClientCsdlPropertyValue.PropertyValueDeserializer.class)
|
||||
class ClientCsdlPropertyValue extends AbstractClientCsdlAnnotatableDynamicAnnotationExpression
|
||||
implements PropertyValue {
|
||||
|
||||
private static final long serialVersionUID = -8437649215282645228L;
|
||||
|
||||
|
@ -55,22 +56,22 @@ class ClientPropertyValue extends AbstractClientAnnotatableDynamicAnnotationExpr
|
|||
this.value = value;
|
||||
}
|
||||
|
||||
static class PropertyValueDeserializer extends AbstractClientEdmDeserializer<ClientPropertyValue> {
|
||||
static class PropertyValueDeserializer extends AbstractClientCsdlEdmDeserializer<ClientCsdlPropertyValue> {
|
||||
@Override
|
||||
protected ClientPropertyValue doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
|
||||
protected ClientCsdlPropertyValue doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
|
||||
throws IOException {
|
||||
final ClientPropertyValue propValue = new ClientPropertyValue();
|
||||
final ClientCsdlPropertyValue propValue = new ClientCsdlPropertyValue();
|
||||
for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
|
||||
final JsonToken token = jp.getCurrentToken();
|
||||
if (token == JsonToken.FIELD_NAME) {
|
||||
if ("Property".equals(jp.getCurrentName())) {
|
||||
propValue.setProperty(jp.nextTextValue());
|
||||
} else if ("Annotation".equals(jp.getCurrentName())) {
|
||||
propValue.getAnnotations().add(jp.readValueAs(ClientAnnotation.class));
|
||||
propValue.getAnnotations().add(jp.readValueAs(ClientCsdlAnnotation.class));
|
||||
} else if (isAnnotationConstExprConstruct(jp)) {
|
||||
propValue.setValue(parseAnnotationConstExprConstruct(jp));
|
||||
} else {
|
||||
propValue.setValue(jp.readValueAs(AbstractClientDynamicAnnotationExpression.class));
|
||||
propValue.setValue(jp.readValueAs(AbstractClientCsdlDynamicAnnotationExpression.class));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -30,8 +30,8 @@ import org.apache.olingo.commons.api.edm.provider.annotation.Record;
|
|||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
||||
|
||||
@JsonDeserialize(using = ClientRecord.RecordDeserializer.class)
|
||||
class ClientRecord extends AbstractClientAnnotatableDynamicAnnotationExpression implements Record {
|
||||
@JsonDeserialize(using = ClientCsdlRecord.RecordDeserializer.class)
|
||||
class ClientCsdlRecord extends AbstractClientCsdlAnnotatableDynamicAnnotationExpression implements Record {
|
||||
|
||||
private static final long serialVersionUID = 4275271751615410709L;
|
||||
|
||||
|
@ -53,20 +53,20 @@ class ClientRecord extends AbstractClientAnnotatableDynamicAnnotationExpression
|
|||
return propertyValues;
|
||||
}
|
||||
|
||||
static class RecordDeserializer extends AbstractClientEdmDeserializer<ClientRecord> {
|
||||
static class RecordDeserializer extends AbstractClientCsdlEdmDeserializer<ClientCsdlRecord> {
|
||||
@Override
|
||||
protected ClientRecord doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
|
||||
protected ClientCsdlRecord doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
|
||||
throws IOException {
|
||||
final ClientRecord record = new ClientRecord();
|
||||
final ClientCsdlRecord record = new ClientCsdlRecord();
|
||||
for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
|
||||
final JsonToken token = jp.getCurrentToken();
|
||||
if (token == JsonToken.FIELD_NAME) {
|
||||
if ("Type".equals(jp.getCurrentName())) {
|
||||
record.setType(jp.nextTextValue());
|
||||
} else if ("Annotation".equals(jp.getCurrentName())) {
|
||||
record.getAnnotations().add(jp.readValueAs(ClientAnnotation.class));
|
||||
record.getAnnotations().add(jp.readValueAs(ClientCsdlAnnotation.class));
|
||||
} else {
|
||||
record.getPropertyValues().add(jp.readValueAs(ClientPropertyValue.class));
|
||||
record.getPropertyValues().add(jp.readValueAs(ClientCsdlPropertyValue.class));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -34,8 +34,8 @@ import org.apache.olingo.commons.api.edm.provider.CsdlAnnotation;
|
|||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
||||
|
||||
@JsonDeserialize(using = ClientReference.ReferenceDeserializer.class)
|
||||
class ClientReference extends CsdlAbstractEdmItem implements Reference {
|
||||
@JsonDeserialize(using = ClientCsdlReference.ReferenceDeserializer.class)
|
||||
class ClientCsdlReference extends CsdlAbstractEdmItem implements Reference {
|
||||
|
||||
private static final long serialVersionUID = 7720274712545267654L;
|
||||
|
||||
|
@ -68,11 +68,11 @@ class ClientReference extends CsdlAbstractEdmItem implements Reference {
|
|||
return includeAnnotations;
|
||||
}
|
||||
|
||||
static class ReferenceDeserializer extends AbstractClientEdmDeserializer<ClientReference> {
|
||||
static class ReferenceDeserializer extends AbstractClientCsdlEdmDeserializer<ClientCsdlReference> {
|
||||
@Override
|
||||
protected ClientReference doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
|
||||
protected ClientCsdlReference doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
|
||||
throws IOException {
|
||||
final ClientReference reference = new ClientReference();
|
||||
final ClientCsdlReference reference = new ClientCsdlReference();
|
||||
|
||||
for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
|
||||
final JsonToken token = jp.getCurrentToken();
|
||||
|
@ -81,13 +81,13 @@ class ClientReference extends CsdlAbstractEdmItem implements Reference {
|
|||
reference.setUri(URI.create(jp.nextTextValue()));
|
||||
} else if ("Include".equals(jp.getCurrentName())) {
|
||||
jp.nextToken();
|
||||
reference.getIncludes().add(jp.readValueAs( ClientInclude.class));
|
||||
reference.getIncludes().add(jp.readValueAs( ClientCsdlInclude.class));
|
||||
} else if ("IncludeAnnotations".equals(jp.getCurrentName())) {
|
||||
jp.nextToken();
|
||||
reference.getIncludeAnnotations().add(jp.readValueAs( ClientIncludeAnnotations.class));
|
||||
reference.getIncludeAnnotations().add(jp.readValueAs( ClientCsdlIncludeAnnotations.class));
|
||||
} else if ("Annotation".equals(jp.getCurrentName())) {
|
||||
jp.nextToken();
|
||||
reference.getAnnotations().add(jp.readValueAs( ClientAnnotation.class));
|
||||
reference.getAnnotations().add(jp.readValueAs( ClientCsdlAnnotation.class));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -26,17 +26,17 @@ import org.apache.olingo.commons.api.edm.provider.CsdlReferentialConstraint;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
@JsonDeserialize(using = ClientReferentialConstraint.ReferentialConstraintDeserializer.class)
|
||||
class ClientReferentialConstraint extends CsdlReferentialConstraint {
|
||||
@JsonDeserialize(using = ClientCsdlReferentialConstraint.ReferentialConstraintDeserializer.class)
|
||||
class ClientCsdlReferentialConstraint extends CsdlReferentialConstraint {
|
||||
|
||||
private static final long serialVersionUID = -5822115908069878139L;
|
||||
|
||||
static class ReferentialConstraintDeserializer extends AbstractClientEdmDeserializer<CsdlReferentialConstraint> {
|
||||
static class ReferentialConstraintDeserializer extends AbstractClientCsdlEdmDeserializer<CsdlReferentialConstraint> {
|
||||
@Override
|
||||
protected CsdlReferentialConstraint doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
|
||||
throws IOException {
|
||||
|
||||
final CsdlReferentialConstraint refConst = new ClientReferentialConstraint();
|
||||
final CsdlReferentialConstraint refConst = new ClientCsdlReferentialConstraint();
|
||||
|
||||
for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
|
||||
final JsonToken token = jp.getCurrentToken();
|
|
@ -29,16 +29,16 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
@JsonDeserialize(using = ClientReturnType.ReturnTypeDeserializer.class)
|
||||
class ClientReturnType extends CsdlReturnType {
|
||||
@JsonDeserialize(using = ClientCsdlReturnType.ReturnTypeDeserializer.class)
|
||||
class ClientCsdlReturnType extends CsdlReturnType {
|
||||
|
||||
private static final long serialVersionUID = 6261092793901735110L;
|
||||
|
||||
static class ReturnTypeDeserializer extends AbstractClientEdmDeserializer<ClientReturnType> {
|
||||
static class ReturnTypeDeserializer extends AbstractClientCsdlEdmDeserializer<ClientCsdlReturnType> {
|
||||
@Override
|
||||
protected ClientReturnType doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
|
||||
protected ClientCsdlReturnType doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
|
||||
throws IOException {
|
||||
final ClientReturnType returnType = new ClientReturnType();
|
||||
final ClientCsdlReturnType returnType = new ClientCsdlReturnType();
|
||||
|
||||
for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
|
||||
final JsonToken token = jp.getCurrentToken();
|
|
@ -27,16 +27,16 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
@JsonDeserialize(using = ClientSchema.SchemaDeserializer.class)
|
||||
class ClientSchema extends CsdlSchema {
|
||||
@JsonDeserialize(using = ClientCsdlSchema.SchemaDeserializer.class)
|
||||
class ClientCsdlSchema extends CsdlSchema {
|
||||
|
||||
private static final long serialVersionUID = 1911087363912024939L;
|
||||
|
||||
static class SchemaDeserializer extends AbstractClientEdmDeserializer<ClientSchema> {
|
||||
static class SchemaDeserializer extends AbstractClientCsdlEdmDeserializer<ClientCsdlSchema> {
|
||||
@Override
|
||||
protected ClientSchema doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
|
||||
protected ClientCsdlSchema doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
|
||||
throws IOException {
|
||||
final ClientSchema schema = new ClientSchema();
|
||||
final ClientCsdlSchema schema = new ClientCsdlSchema();
|
||||
|
||||
for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
|
||||
final JsonToken token = jp.getCurrentToken();
|
||||
|
@ -47,36 +47,36 @@ class ClientSchema extends CsdlSchema {
|
|||
schema.setAlias(jp.nextTextValue());
|
||||
} else if ("ComplexType".equals(jp.getCurrentName())) {
|
||||
jp.nextToken();
|
||||
schema.getComplexTypes().add(jp.readValueAs(ClientComplexType.class));
|
||||
schema.getComplexTypes().add(jp.readValueAs(ClientCsdlComplexType.class));
|
||||
} else if ("EntityType".equals(jp.getCurrentName())) {
|
||||
jp.nextToken();
|
||||
schema.getEntityTypes().add(jp.readValueAs(ClientEntityType.class));
|
||||
schema.getEntityTypes().add(jp.readValueAs(ClientCsdlEntityType.class));
|
||||
} else if ("EnumType".equals(jp.getCurrentName())) {
|
||||
jp.nextToken();
|
||||
schema.getEnumTypes().add(jp.readValueAs(ClientEnumType.class));
|
||||
schema.getEnumTypes().add(jp.readValueAs(ClientCsdlEnumType.class));
|
||||
} else if ("EntityContainer".equals(jp.getCurrentName())) {
|
||||
jp.nextToken();
|
||||
ClientEntityContainer entityContainer = jp.readValueAs(ClientEntityContainer.class);
|
||||
ClientCsdlEntityContainer entityContainer = jp.readValueAs(ClientCsdlEntityContainer.class);
|
||||
schema.setEntityContainer(entityContainer);
|
||||
} else if ("Action".equals(jp.getCurrentName())) {
|
||||
jp.nextToken();
|
||||
schema.getActions().add(jp.readValueAs(ClientAction.class));
|
||||
schema.getActions().add(jp.readValueAs(ClientCsdlAction.class));
|
||||
} else if ("Function".equals(jp.getCurrentName())) {
|
||||
jp.nextToken();
|
||||
schema.getFunctions().add(jp.readValueAs(ClientFunction.class));
|
||||
schema.getFunctions().add(jp.readValueAs(ClientCsdlFunction.class));
|
||||
} else if ("TypeDefinition".equals(jp.getCurrentName())) {
|
||||
jp.nextToken();
|
||||
schema.getTypeDefinitions().add(jp.readValueAs(ClientTypeDefinition.class));
|
||||
schema.getTypeDefinitions().add(jp.readValueAs(ClientCsdlTypeDefinition.class));
|
||||
}
|
||||
} else if ("Annotations".equals(jp.getCurrentName())) {
|
||||
jp.nextToken();
|
||||
schema.getAnnotationGroups().add(jp.readValueAs(ClientAnnotations.class));
|
||||
schema.getAnnotationGroups().add(jp.readValueAs(ClientCsdlAnnotations.class));
|
||||
} else if ("Annotation".equals(jp.getCurrentName())) {
|
||||
jp.nextToken();
|
||||
schema.getAnnotations().add(jp.readValueAs(ClientAnnotation.class));
|
||||
schema.getAnnotations().add(jp.readValueAs(ClientCsdlAnnotation.class));
|
||||
} else if ("Term".equals(jp.getCurrentName())) {
|
||||
jp.nextToken();
|
||||
schema.getTerms().add(jp.readValueAs(ClientTerm.class));
|
||||
schema.getTerms().add(jp.readValueAs(ClientCsdlTerm.class));
|
||||
}
|
||||
}
|
||||
|
|
@ -27,16 +27,16 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
@JsonDeserialize(using = ClientSingleton.SingletonDeserializer.class)
|
||||
class ClientSingleton extends CsdlSingleton {
|
||||
@JsonDeserialize(using = ClientCsdlSingleton.SingletonDeserializer.class)
|
||||
class ClientCsdlSingleton extends CsdlSingleton {
|
||||
|
||||
private static final long serialVersionUID = 1656749615107151921L;
|
||||
|
||||
static class SingletonDeserializer extends AbstractClientEdmDeserializer<ClientSingleton> {
|
||||
static class SingletonDeserializer extends AbstractClientCsdlEdmDeserializer<ClientCsdlSingleton> {
|
||||
@Override
|
||||
protected ClientSingleton doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
|
||||
protected ClientCsdlSingleton doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
|
||||
throws IOException {
|
||||
final ClientSingleton singleton = new ClientSingleton();
|
||||
final ClientCsdlSingleton singleton = new ClientCsdlSingleton();
|
||||
|
||||
for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
|
||||
final JsonToken token = jp.getCurrentToken();
|
||||
|
@ -48,10 +48,10 @@ class ClientSingleton extends CsdlSingleton {
|
|||
} else if ("NavigationPropertyBinding".equals(jp.getCurrentName())) {
|
||||
jp.nextToken();
|
||||
singleton.getNavigationPropertyBindings().add(
|
||||
jp.readValueAs(ClientNavigationPropertyBinding.class));
|
||||
jp.readValueAs(ClientCsdlNavigationPropertyBinding.class));
|
||||
} else if ("Annotation".equals(jp.getCurrentName())) {
|
||||
jp.nextToken();
|
||||
singleton.getAnnotations().add(jp.readValueAs(ClientAnnotation.class));
|
||||
singleton.getAnnotations().add(jp.readValueAs(ClientCsdlAnnotation.class));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -31,16 +31,16 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
|||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
|
||||
@JsonDeserialize(using = ClientTerm.TermDeserializer.class)
|
||||
class ClientTerm extends CsdlTerm {
|
||||
@JsonDeserialize(using = ClientCsdlTerm.TermDeserializer.class)
|
||||
class ClientCsdlTerm extends CsdlTerm {
|
||||
|
||||
private static final long serialVersionUID = -8350072064720586186L;
|
||||
|
||||
static class TermDeserializer extends AbstractClientEdmDeserializer<ClientTerm> {
|
||||
static class TermDeserializer extends AbstractClientCsdlEdmDeserializer<ClientCsdlTerm> {
|
||||
@Override
|
||||
protected ClientTerm doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
|
||||
protected ClientCsdlTerm doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
|
||||
throws IOException {
|
||||
final ClientTerm term = new ClientTerm();
|
||||
final ClientCsdlTerm term = new ClientCsdlTerm();
|
||||
|
||||
for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
|
||||
final JsonToken token = jp.getCurrentToken();
|
||||
|
@ -72,7 +72,7 @@ class ClientTerm extends CsdlTerm {
|
|||
term.getAppliesTo().addAll(Arrays.asList(StringUtils.split(jp.nextTextValue())));
|
||||
} else if ("Annotation".equals(jp.getCurrentName())) {
|
||||
jp.nextToken();
|
||||
term.getAnnotations().add(jp.readValueAs(ClientAnnotation.class));
|
||||
term.getAnnotations().add(jp.readValueAs(ClientCsdlAnnotation.class));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -21,8 +21,8 @@ package org.apache.olingo.client.core.edm.xml;
|
|||
import org.apache.olingo.commons.api.edm.provider.annotation.DynamicAnnotationExpression;
|
||||
import org.apache.olingo.commons.api.edm.provider.annotation.TwoParamsOpDynamicAnnotationExpression;
|
||||
|
||||
class ClientTwoParamsOpDynamicAnnotationExpression
|
||||
extends AbstractClientDynamicAnnotationExpression implements TwoParamsOpDynamicAnnotationExpression {
|
||||
class ClientCsdlTwoParamsOpDynamicAnnotationExpression
|
||||
extends AbstractClientCsdlDynamicAnnotationExpression implements TwoParamsOpDynamicAnnotationExpression {
|
||||
|
||||
private static final long serialVersionUID = 6241842185452451946L;
|
||||
|
|
@ -29,16 +29,16 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
@JsonDeserialize(using = ClientTypeDefinition.TypeDefinitionDeserializer.class)
|
||||
class ClientTypeDefinition extends CsdlTypeDefinition {
|
||||
@JsonDeserialize(using = ClientCsdlTypeDefinition.TypeDefinitionDeserializer.class)
|
||||
class ClientCsdlTypeDefinition extends CsdlTypeDefinition {
|
||||
|
||||
private static final long serialVersionUID = -902407149079419602L;
|
||||
|
||||
static class TypeDefinitionDeserializer extends AbstractClientEdmDeserializer<ClientTypeDefinition> {
|
||||
static class TypeDefinitionDeserializer extends AbstractClientCsdlEdmDeserializer<ClientCsdlTypeDefinition> {
|
||||
@Override
|
||||
protected ClientTypeDefinition doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
|
||||
protected ClientCsdlTypeDefinition doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
|
||||
throws IOException {
|
||||
final ClientTypeDefinition typeDefinition = new ClientTypeDefinition();
|
||||
final ClientCsdlTypeDefinition typeDefinition = new ClientCsdlTypeDefinition();
|
||||
|
||||
for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
|
||||
final JsonToken token = jp.getCurrentToken();
|
||||
|
@ -63,7 +63,7 @@ class ClientTypeDefinition extends CsdlTypeDefinition {
|
|||
}
|
||||
} else if ("Annotation".equals(jp.getCurrentName())) {
|
||||
jp.nextToken();
|
||||
typeDefinition.getAnnotations().add(jp.readValueAs(ClientAnnotation.class));
|
||||
typeDefinition.getAnnotations().add(jp.readValueAs(ClientCsdlAnnotation.class));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -28,8 +28,8 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
@JsonDeserialize(using = ClientUrlRef.UrlRefDeserializer.class)
|
||||
class ClientUrlRef extends AbstractClientDynamicAnnotationExpression implements UrlRef {
|
||||
@JsonDeserialize(using = ClientCsdlUrlRef.UrlRefDeserializer.class)
|
||||
class ClientCsdlUrlRef extends AbstractClientCsdlDynamicAnnotationExpression implements UrlRef {
|
||||
|
||||
private static final long serialVersionUID = -7693224811739000440L;
|
||||
|
||||
|
@ -44,18 +44,18 @@ class ClientUrlRef extends AbstractClientDynamicAnnotationExpression implements
|
|||
this.value = value;
|
||||
}
|
||||
|
||||
static class UrlRefDeserializer extends AbstractClientEdmDeserializer<ClientUrlRef> {
|
||||
static class UrlRefDeserializer extends AbstractClientCsdlEdmDeserializer<ClientCsdlUrlRef> {
|
||||
@Override
|
||||
protected ClientUrlRef doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
|
||||
protected ClientCsdlUrlRef doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
|
||||
throws IOException {
|
||||
final ClientUrlRef urlref = new ClientUrlRef();
|
||||
final ClientCsdlUrlRef urlref = new ClientCsdlUrlRef();
|
||||
for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
|
||||
final JsonToken token = jp.getCurrentToken();
|
||||
if (token == JsonToken.FIELD_NAME) {
|
||||
if (isAnnotationConstExprConstruct(jp)) {
|
||||
urlref.setValue(parseAnnotationConstExprConstruct(jp));
|
||||
} else {
|
||||
urlref.setValue(jp.readValueAs(AbstractClientDynamicAnnotationExpression.class));
|
||||
urlref.setValue(jp.readValueAs(AbstractClientCsdlDynamicAnnotationExpression.class));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -28,8 +28,8 @@ import org.apache.olingo.client.api.edm.xml.XMLMetadata;
|
|||
import org.apache.olingo.client.api.serialization.ClientODataDeserializer;
|
||||
import org.apache.olingo.client.core.data.JSONServiceDocumentDeserializer;
|
||||
import org.apache.olingo.client.core.data.XMLServiceDocumentDeserializer;
|
||||
import org.apache.olingo.client.core.edm.xml.ClientEdmx;
|
||||
import org.apache.olingo.client.core.edm.ClientXMLMetadata;
|
||||
import org.apache.olingo.client.core.edm.xml.ClientCsdlEdmx;
|
||||
import org.apache.olingo.client.core.edm.ClientCsdlXMLMetadata;
|
||||
import org.apache.olingo.commons.api.data.Delta;
|
||||
import org.apache.olingo.commons.api.data.Entity;
|
||||
import org.apache.olingo.commons.api.data.EntityCollection;
|
||||
|
@ -114,7 +114,7 @@ public class ClientODataDeserializerImpl implements ClientODataDeserializer {
|
|||
@Override
|
||||
public XMLMetadata toMetadata(final InputStream input) {
|
||||
try {
|
||||
return new ClientXMLMetadata(getXmlMapper().readValue(input, ClientEdmx.class));
|
||||
return new ClientCsdlXMLMetadata(getXmlMapper().readValue(input, ClientCsdlEdmx.class));
|
||||
} catch (Exception e) {
|
||||
throw new IllegalArgumentException("Could not parse as Edmx document", e);
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ import org.apache.olingo.client.api.data.ServiceDocument;
|
|||
import org.apache.olingo.client.api.domain.ODataEntitySetIterator;
|
||||
import org.apache.olingo.client.api.edm.xml.XMLMetadata;
|
||||
import org.apache.olingo.client.api.serialization.ODataReader;
|
||||
import org.apache.olingo.client.core.edm.ClientEdmProvider;
|
||||
import org.apache.olingo.client.core.edm.ClientCsdlEdmProvider;
|
||||
import org.apache.olingo.commons.api.data.Entity;
|
||||
import org.apache.olingo.commons.api.data.EntityCollection;
|
||||
import org.apache.olingo.commons.api.data.Property;
|
||||
|
@ -68,7 +68,7 @@ public class ODataReaderImpl implements ODataReader {
|
|||
|
||||
@Override
|
||||
public Edm readMetadata(final Map<String, CsdlSchema> xmlSchemas) {
|
||||
ClientEdmProvider prov = new ClientEdmProvider(xmlSchemas);
|
||||
ClientCsdlEdmProvider prov = new ClientCsdlEdmProvider(xmlSchemas);
|
||||
return new EdmProviderImpl(prov);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue