http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/TermDeserializer.java ---------------------------------------------------------------------- diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/TermDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/TermDeserializer.java deleted file mode 100644 index 7a2a0cd..0000000 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/TermDeserializer.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.olingo.client.core.edm.xml.v4; - -import java.io.IOException; -import java.util.Arrays; - -import org.apache.commons.lang3.BooleanUtils; -import org.apache.commons.lang3.StringUtils; -import org.apache.olingo.client.core.edm.xml.AbstractEdmDeserializer; -import org.apache.olingo.commons.api.edm.geo.SRID; - -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.core.JsonToken; -import com.fasterxml.jackson.databind.DeserializationContext; - -public class TermDeserializer extends AbstractEdmDeserializer<TermImpl> { - - @Override - protected TermImpl doDeserialize(final JsonParser jp, final DeserializationContext ctxt) - throws IOException, JsonProcessingException { - - final TermImpl term = new TermImpl(); - - for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) { - final JsonToken token = jp.getCurrentToken(); - if (token == JsonToken.FIELD_NAME) { - if ("Name".equals(jp.getCurrentName())) { - term.setName(jp.nextTextValue()); - } else if ("Type".equals(jp.getCurrentName())) { - term.setType(jp.nextTextValue()); - } else if ("BaseTerm".equals(jp.getCurrentName())) { - term.setBaseTerm(jp.nextTextValue()); - } else if ("DefaultValue".equals(jp.getCurrentName())) { - term.setDefaultValue(jp.nextTextValue()); - } else if ("Nullable".equals(jp.getCurrentName())) { - term.setNullable(BooleanUtils.toBoolean(jp.nextTextValue())); - } else if ("MaxLength".equals(jp.getCurrentName())) { - final String maxLenght = jp.nextTextValue(); - term.setMaxLength(maxLenght.equalsIgnoreCase("max") ? Integer.MAX_VALUE : Integer.valueOf(maxLenght)); - } else if ("Precision".equals(jp.getCurrentName())) { - term.setPrecision(Integer.valueOf(jp.nextTextValue())); - } else if ("Scale".equals(jp.getCurrentName())) { - final String scale = jp.nextTextValue(); - term.setScale(scale.equalsIgnoreCase("variable") ? 0 : Integer.valueOf(scale)); - } else if ("SRID".equals(jp.getCurrentName())) { - final String srid = jp.nextTextValue(); - if (srid != null) { - term.setSrid(SRID.valueOf(srid)); - } - } else if ("AppliesTo".equals(jp.getCurrentName())) { - term.getAppliesTo().addAll(Arrays.asList(StringUtils.split(jp.nextTextValue()))); - } else if ("Annotation".equals(jp.getCurrentName())) { - jp.nextToken(); - term.getAnnotations().add(jp.readValueAs(AnnotationImpl.class)); - } - } - } - - return term; - } - -}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/TermImpl.java ---------------------------------------------------------------------- diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/TermImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/TermImpl.java deleted file mode 100644 index 9aa0bf6..0000000 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/TermImpl.java +++ /dev/null @@ -1,140 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.olingo.client.core.edm.xml.v4; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.olingo.client.api.edm.xml.v4.Term; -import org.apache.olingo.commons.api.edm.geo.SRID; - -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; - -@JsonDeserialize(using = TermDeserializer.class) -public class TermImpl extends AbstractAnnotatable implements Term { - - private static final long serialVersionUID = -8350072064720586186L; - - private String name; - - private String type; - - private String baseTerm; - - private String defaultValue; - - private boolean nullable = true; - - private Integer maxLength; - - private Integer precision; - - private Integer scale; - - private SRID srid; - - private final List<String> appliesTo = new ArrayList<String>(); - - @Override - public String getName() { - return name; - } - - public void setName(final String name) { - this.name = name; - } - - @Override - public String getType() { - return type; - } - - public void setType(final String type) { - this.type = type; - } - - @Override - public String getBaseTerm() { - return baseTerm; - } - - public void setBaseTerm(final String baseTerm) { - this.baseTerm = baseTerm; - } - - @Override - public String getDefaultValue() { - return defaultValue; - } - - public void setDefaultValue(final String defaultValue) { - this.defaultValue = defaultValue; - } - - @Override - public boolean isNullable() { - return nullable; - } - - public void setNullable(final boolean nullable) { - this.nullable = nullable; - } - - @Override - public Integer getMaxLength() { - return maxLength; - } - - public void setMaxLength(final Integer maxLength) { - this.maxLength = maxLength; - } - - @Override - public Integer getPrecision() { - return precision; - } - - public void setPrecision(final Integer precision) { - this.precision = precision; - } - - @Override - public Integer getScale() { - return scale; - } - - public void setScale(final Integer scale) { - this.scale = scale; - } - - @Override - public SRID getSrid() { - return srid; - } - - public void setSrid(final SRID srid) { - this.srid = srid; - } - - @Override - public List<String> getAppliesTo() { - return appliesTo; - } - -} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/TypeDefinitionDeserializer.java ---------------------------------------------------------------------- diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/TypeDefinitionDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/TypeDefinitionDeserializer.java deleted file mode 100644 index 381ce01..0000000 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/TypeDefinitionDeserializer.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.olingo.client.core.edm.xml.v4; - -import java.io.IOException; - -import org.apache.commons.lang3.BooleanUtils; -import org.apache.olingo.client.core.edm.xml.AbstractEdmDeserializer; -import org.apache.olingo.commons.api.edm.geo.SRID; - -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.core.JsonToken; -import com.fasterxml.jackson.databind.DeserializationContext; - -public class TypeDefinitionDeserializer extends AbstractEdmDeserializer<TypeDefinitionImpl> { - - @Override - protected TypeDefinitionImpl doDeserialize(final JsonParser jp, final DeserializationContext ctxt) - throws IOException, JsonProcessingException { - - final TypeDefinitionImpl typeDefinition = new TypeDefinitionImpl(); - - for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) { - final JsonToken token = jp.getCurrentToken(); - if (token == JsonToken.FIELD_NAME) { - if ("Name".equals(jp.getCurrentName())) { - typeDefinition.setName(jp.nextTextValue()); - } else if ("UnderlyingType".equals(jp.getCurrentName())) { - typeDefinition.setUnderlyingType(jp.nextTextValue()); - } else if ("MaxLength".equals(jp.getCurrentName())) { - typeDefinition.setMaxLength(jp.nextIntValue(0)); - } else if ("Unicode".equals(jp.getCurrentName())) { - typeDefinition.setUnicode(BooleanUtils.toBoolean(jp.nextTextValue())); - } else if ("Precision".equals(jp.getCurrentName())) { - typeDefinition.setPrecision(jp.nextIntValue(0)); - } else if ("Scale".equals(jp.getCurrentName())) { - final String scale = jp.nextTextValue(); - typeDefinition.setScale(scale.equalsIgnoreCase("variable") ? 0 : Integer.valueOf(scale)); - } else if ("SRID".equals(jp.getCurrentName())) { - final String srid = jp.nextTextValue(); - if (srid != null) { - typeDefinition.setSrid(SRID.valueOf(srid)); - } - } else if ("Annotation".equals(jp.getCurrentName())) { - jp.nextToken(); - typeDefinition.getAnnotations().add(jp.readValueAs(AnnotationImpl.class)); - } - } - } - - return typeDefinition; - } - -} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/TypeDefinitionImpl.java ---------------------------------------------------------------------- diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/TypeDefinitionImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/TypeDefinitionImpl.java deleted file mode 100644 index c7e6653..0000000 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/TypeDefinitionImpl.java +++ /dev/null @@ -1,120 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.olingo.client.core.edm.xml.v4; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.olingo.client.api.edm.xml.v4.Annotation; -import org.apache.olingo.client.api.edm.xml.v4.TypeDefinition; -import org.apache.olingo.client.core.edm.xml.AbstractEdmItem; -import org.apache.olingo.commons.api.edm.geo.SRID; - -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; - -@JsonDeserialize(using = TypeDefinitionDeserializer.class) -public class TypeDefinitionImpl extends AbstractEdmItem implements TypeDefinition { - - private static final long serialVersionUID = -902407149079419602L; - - private String name; - - private String underlyingType; - - private Integer maxLength; - - private Integer precision; - - private Integer scale; - - private boolean unicode = true; - - private SRID srid; - - private final List<Annotation> annotations = new ArrayList<Annotation>(); - - @Override - public String getName() { - return name; - } - - public void setName(final String name) { - this.name = name; - } - - @Override - public String getUnderlyingType() { - return underlyingType; - } - - public void setUnderlyingType(final String underlyingType) { - this.underlyingType = underlyingType; - } - - @Override - public Integer getMaxLength() { - return maxLength; - } - - public void setMaxLength(final Integer maxLength) { - this.maxLength = maxLength; - } - - @Override - public Integer getPrecision() { - return precision; - } - - public void setPrecision(final Integer precision) { - this.precision = precision; - } - - @Override - public Integer getScale() { - return scale; - } - - public void setScale(final Integer scale) { - this.scale = scale; - } - - @Override - public boolean isUnicode() { - return unicode; - } - - public void setUnicode(final boolean unicode) { - this.unicode = unicode; - } - - @Override - public SRID getSrid() { - return srid; - } - - public void setSrid(final SRID srid) { - this.srid = srid; - } - - @Override - public List<Annotation> getAnnotations() { - return annotations; - } - -} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/XMLMetadataImpl.java ---------------------------------------------------------------------- diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/XMLMetadataImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/XMLMetadataImpl.java deleted file mode 100644 index c6a1587..0000000 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/XMLMetadataImpl.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.olingo.client.core.edm.xml.v4; - -import java.util.List; - -import org.apache.olingo.client.api.edm.xml.v4.Edmx; -import org.apache.olingo.client.api.edm.xml.v4.Reference; -import org.apache.olingo.client.api.edm.xml.v4.Schema; -import org.apache.olingo.client.api.edm.xml.v4.XMLMetadata; -import org.apache.olingo.client.core.edm.xml.AbstractXMLMetadata; - -public class XMLMetadataImpl extends AbstractXMLMetadata implements XMLMetadata { - - private static final long serialVersionUID = 6025723060298454901L; - - public XMLMetadataImpl(final EdmxImpl edmx) { - super(edmx); - } - - @Override - @SuppressWarnings("unchecked") - public List<Schema> getSchemas() { - return (List<Schema>) super.getSchemas(); - } - - @Override - public Schema getSchema(final int index) { - return (Schema) super.getSchema(index); - } - - @Override - public Schema getSchema(final String key) { - return (Schema) super.getSchema(key); - } - - @Override - public List<Reference> getReferences() { - return ((Edmx) this.edmx).getReferences(); - } -} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/AbstractAnnotatableDynamicAnnotationExpression.java ---------------------------------------------------------------------- diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/AbstractAnnotatableDynamicAnnotationExpression.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/AbstractAnnotatableDynamicAnnotationExpression.java deleted file mode 100644 index 19dfb37..0000000 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/AbstractAnnotatableDynamicAnnotationExpression.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.olingo.client.core.edm.xml.v4.annotation; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.olingo.client.api.edm.xml.v4.Annotatable; -import org.apache.olingo.client.api.edm.xml.v4.Annotation; - -abstract class AbstractAnnotatableDynamicAnnotationExpression - extends AbstractDynamicAnnotationExpression implements Annotatable { - - private static final long serialVersionUID = -450668773857358139L; - - private final List<Annotation> annotations = new ArrayList<Annotation>(); - - @Override - public List<Annotation> getAnnotations() { - return annotations; - } -} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/AbstractAnnotationExpression.java ---------------------------------------------------------------------- diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/AbstractAnnotationExpression.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/AbstractAnnotationExpression.java deleted file mode 100644 index 629212b..0000000 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/AbstractAnnotationExpression.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.olingo.client.core.edm.xml.v4.annotation; - -import org.apache.olingo.client.api.edm.xml.v4.annotation.AnnotationExpression; -import org.apache.olingo.client.api.edm.xml.v4.annotation.ConstantAnnotationExpression; -import org.apache.olingo.client.api.edm.xml.v4.annotation.DynamicAnnotationExpression; -import org.apache.olingo.client.core.edm.xml.AbstractEdmItem; - -public abstract class AbstractAnnotationExpression extends AbstractEdmItem implements AnnotationExpression { - - private static final long serialVersionUID = -4238652997159205377L; - - @Override - public boolean isConstant() { - return this instanceof ConstantAnnotationExpression; - } - - @Override - public ConstantAnnotationExpression asConstant() { - return isConstant() ? (ConstantAnnotationExpression) this : null; - } - - @Override - public boolean isDynamic() { - return this instanceof DynamicAnnotationExpression; - } - - @Override - public DynamicAnnotationExpression asDynamic() { - return isDynamic() ? (DynamicAnnotationExpression) this : null; - } -} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/AbstractDynamicAnnotationExpression.java ---------------------------------------------------------------------- diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/AbstractDynamicAnnotationExpression.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/AbstractDynamicAnnotationExpression.java deleted file mode 100644 index bdba869..0000000 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/AbstractDynamicAnnotationExpression.java +++ /dev/null @@ -1,218 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.olingo.client.core.edm.xml.v4.annotation; - -import org.apache.olingo.client.api.edm.xml.v4.annotation.AnnotationPath; -import org.apache.olingo.client.api.edm.xml.v4.annotation.Apply; -import org.apache.olingo.client.api.edm.xml.v4.annotation.Cast; -import org.apache.olingo.client.api.edm.xml.v4.annotation.Collection; -import org.apache.olingo.client.api.edm.xml.v4.annotation.DynamicAnnotationExpression; -import org.apache.olingo.client.api.edm.xml.v4.annotation.If; -import org.apache.olingo.client.api.edm.xml.v4.annotation.IsOf; -import org.apache.olingo.client.api.edm.xml.v4.annotation.LabeledElement; -import org.apache.olingo.client.api.edm.xml.v4.annotation.LabeledElementReference; -import org.apache.olingo.client.api.edm.xml.v4.annotation.NavigationPropertyPath; -import org.apache.olingo.client.api.edm.xml.v4.annotation.Not; -import org.apache.olingo.client.api.edm.xml.v4.annotation.Null; -import org.apache.olingo.client.api.edm.xml.v4.annotation.Path; -import org.apache.olingo.client.api.edm.xml.v4.annotation.PropertyPath; -import org.apache.olingo.client.api.edm.xml.v4.annotation.PropertyValue; -import org.apache.olingo.client.api.edm.xml.v4.annotation.Record; -import org.apache.olingo.client.api.edm.xml.v4.annotation.TwoParamsOpDynamicAnnotationExpression; -import org.apache.olingo.client.api.edm.xml.v4.annotation.UrlRef; - -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; - -@JsonDeserialize(using = DynamicAnnotationExpressionDeserializer.class) -public abstract class AbstractDynamicAnnotationExpression - extends AbstractAnnotationExpression implements DynamicAnnotationExpression { - - private static final long serialVersionUID = 1093411847477874348L; - - @Override - public boolean isNot() { - return this instanceof Not; - } - - @Override - public Not asNot() { - return isNot() ? (Not) this : null; - - } - - @Override - public boolean isTwoParamsOp() { - return this instanceof TwoParamsOpDynamicAnnotationExpression; - } - - @Override - public TwoParamsOpDynamicAnnotationExpression asTwoParamsOp() { - return isTwoParamsOp() ? (TwoParamsOpDynamicAnnotationExpression) this : null; - } - - @Override - public boolean isAnnotationPath() { - return this instanceof AnnotationPath; - } - - @Override - public AnnotationPath asAnnotationPath() { - return isAnnotationPath() ? (AnnotationPath) this : null; - } - - @Override - public boolean isApply() { - return this instanceof Apply; - } - - @Override - public Apply asApply() { - return isApply() ? (Apply) this : null; - } - - @Override - public boolean isCast() { - return this instanceof Cast; - } - - @Override - public Cast asCast() { - return isCast() ? (Cast) this : null; - } - - @Override - public boolean isCollection() { - return this instanceof Collection; - } - - @Override - public Collection asCollection() { - return isCollection() ? (Collection) this : null; - } - - @Override - public boolean isIf() { - return this instanceof If; - } - - @Override - public If asIf() { - return isIf() ? (If) this : null; - } - - @Override - public boolean isIsOf() { - return this instanceof IsOf; - } - - @Override - public IsOf asIsOf() { - return isIsOf() ? (IsOf) this : null; - } - - @Override - public boolean isLabeledElement() { - return this instanceof LabeledElement; - } - - @Override - public LabeledElement asLabeledElement() { - return isLabeledElement() ? (LabeledElement) this : null; - } - - @Override - public boolean isLabeledElementReference() { - return this instanceof LabeledElementReference; - } - - @Override - public LabeledElementReference asLabeledElementReference() { - return isLabeledElementReference() ? (LabeledElementReference) this : null; - } - - @Override - public boolean isNull() { - return this instanceof Null; - } - - @Override - public Null asNull() { - return isNull() ? (Null) this : null; - } - - @Override - public boolean isNavigationPropertyPath() { - return this instanceof NavigationPropertyPath; - } - - @Override - public NavigationPropertyPath asNavigationPropertyPath() { - return isNavigationPropertyPath() ? (NavigationPropertyPath) this : null; - } - - @Override - public boolean isPath() { - return this instanceof Path; - } - - @Override - public Path asPath() { - return isPath() ? (Path) this : null; - } - - @Override - public boolean isPropertyPath() { - return this instanceof PropertyPath; - } - - @Override - public PropertyPath asPropertyPath() { - return isPropertyPath() ? (PropertyPath) this : null; - } - - @Override - public boolean isPropertyValue() { - return this instanceof PropertyValue; - } - - @Override - public PropertyValue asPropertyValue() { - return isPropertyValue() ? (PropertyValue) this : null; - } - - @Override - public boolean isRecord() { - return this instanceof Record; - } - - @Override - public Record asRecord() { - return isRecord() ? (Record) this : null; - } - - @Override - public boolean isUrlRef() { - return this instanceof UrlRef; - } - - @Override - public UrlRef asUrlRef() { - return isUrlRef() ? (UrlRef) this : null; - } -} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/AbstractElementOrAttributeExpression.java ---------------------------------------------------------------------- diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/AbstractElementOrAttributeExpression.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/AbstractElementOrAttributeExpression.java deleted file mode 100644 index 872cf4e..0000000 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/AbstractElementOrAttributeExpression.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.olingo.client.core.edm.xml.v4.annotation; - -/** - * Groups dynamic expressions that may be provided using element notation or attribute notation. - */ -abstract class AbstractElementOrAttributeExpression extends AbstractDynamicAnnotationExpression { - - private static final long serialVersionUID = 1588336268773032932L; - - private String value; - - public String getValue() { - return value; - } - - public void setValue(final String value) { - this.value = value; - } -} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/AnnotationPathImpl.java ---------------------------------------------------------------------- diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/AnnotationPathImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/AnnotationPathImpl.java deleted file mode 100644 index 423d387..0000000 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/AnnotationPathImpl.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.olingo.client.core.edm.xml.v4.annotation; - -import org.apache.olingo.client.api.edm.xml.v4.annotation.AnnotationPath; - -public class AnnotationPathImpl extends AbstractElementOrAttributeExpression implements AnnotationPath { - - private static final long serialVersionUID = 5360735207353494466L; - -} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/ApplyDeserializer.java ---------------------------------------------------------------------- diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/ApplyDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/ApplyDeserializer.java deleted file mode 100644 index 8247110..0000000 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/ApplyDeserializer.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.olingo.client.core.edm.xml.v4.annotation; - -import java.io.IOException; - -import org.apache.olingo.client.core.edm.xml.AbstractEdmDeserializer; -import org.apache.olingo.client.core.edm.xml.v4.AnnotationImpl; - -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.core.JsonToken; -import com.fasterxml.jackson.databind.DeserializationContext; - -public class ApplyDeserializer extends AbstractEdmDeserializer<ApplyImpl> { - - @Override - protected ApplyImpl doDeserialize(final JsonParser jp, final DeserializationContext ctxt) - throws IOException, JsonProcessingException { - - final ApplyImpl apply = new ApplyImpl(); - - 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(AnnotationImpl.class)); - } else if (isAnnotationConstExprConstruct(jp)) { - apply.getParameters().add(parseAnnotationConstExprConstruct(jp)); - } else { - apply.getParameters().add(jp.readValueAs(AbstractDynamicAnnotationExpression.class)); - } - } - } - - return apply; - } - -} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/ApplyImpl.java ---------------------------------------------------------------------- diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/ApplyImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/ApplyImpl.java deleted file mode 100644 index 4b6f31c..0000000 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/ApplyImpl.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.olingo.client.core.edm.xml.v4.annotation; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.olingo.client.api.edm.xml.v4.annotation.AnnotationExpression; -import org.apache.olingo.client.api.edm.xml.v4.annotation.Apply; - -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; - -@JsonDeserialize(using = ApplyDeserializer.class) -public class ApplyImpl extends AbstractAnnotatableDynamicAnnotationExpression implements Apply { - - private static final long serialVersionUID = 4358398303405059879L; - - private String function; - - private final List<AnnotationExpression> parameters = new ArrayList<AnnotationExpression>(); - - @Override - public String getFunction() { - return function; - } - - public void setFunction(final String function) { - this.function = function; - } - - @Override - public List<AnnotationExpression> getParameters() { - return parameters; - } - -} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/CastDeserializer.java ---------------------------------------------------------------------- diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/CastDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/CastDeserializer.java deleted file mode 100644 index 75ae989..0000000 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/CastDeserializer.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.olingo.client.core.edm.xml.v4.annotation; - -import java.io.IOException; - -import org.apache.olingo.client.core.edm.xml.AbstractEdmDeserializer; -import org.apache.olingo.client.core.edm.xml.v4.AnnotationImpl; -import org.apache.olingo.commons.api.edm.geo.SRID; - -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.core.JsonToken; -import com.fasterxml.jackson.databind.DeserializationContext; - -public class CastDeserializer extends AbstractEdmDeserializer<CastImpl> { - - @Override - protected CastImpl doDeserialize(final JsonParser jp, final DeserializationContext ctxt) - throws IOException, JsonProcessingException { - - final CastImpl cast = new CastImpl(); - - 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(AnnotationImpl.class)); - } else if ("MaxLength".equals(jp.getCurrentName())) { - final String maxLenght = jp.nextTextValue(); - cast.setMaxLength(maxLenght.equalsIgnoreCase("max") ? Integer.MAX_VALUE : Integer.valueOf(maxLenght)); - } else if ("Precision".equals(jp.getCurrentName())) { - cast.setPrecision(Integer.valueOf(jp.nextTextValue())); - } else if ("Scale".equals(jp.getCurrentName())) { - final String scale = jp.nextTextValue(); - cast.setScale(scale.equalsIgnoreCase("variable") ? 0 : Integer.valueOf(scale)); - } else if ("SRID".equals(jp.getCurrentName())) { - final String srid = jp.nextTextValue(); - if (srid != null) { - cast.setSrid(SRID.valueOf(srid)); - } - } else { - cast.setValue(jp.readValueAs(AbstractDynamicAnnotationExpression.class)); - } - } - } - - return cast; - } - -} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/CastImpl.java ---------------------------------------------------------------------- diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/CastImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/CastImpl.java deleted file mode 100644 index 4db619f..0000000 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/CastImpl.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.olingo.client.core.edm.xml.v4.annotation; - -import org.apache.olingo.client.api.edm.xml.v4.annotation.Cast; -import org.apache.olingo.client.api.edm.xml.v4.annotation.DynamicAnnotationExpression; -import org.apache.olingo.commons.api.edm.geo.SRID; - -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; - -@JsonDeserialize(using = CastDeserializer.class) -public class CastImpl extends AbstractAnnotatableDynamicAnnotationExpression implements Cast { - - private static final long serialVersionUID = 3312415984116005313L; - - private String type; - - private Integer maxLength; - - private Integer precision; - - private Integer scale; - - private SRID srid; - - private DynamicAnnotationExpression value; - - @Override - public String getType() { - return type; - } - - public void setType(final String type) { - this.type = type; - } - - @Override - public Integer getMaxLength() { - return maxLength; - } - - public void setMaxLength(final Integer maxLength) { - this.maxLength = maxLength; - } - - @Override - public Integer getPrecision() { - return precision; - } - - public void setPrecision(final Integer precision) { - this.precision = precision; - } - - @Override - public Integer getScale() { - return scale; - } - - public void setScale(final Integer scale) { - this.scale = scale; - } - - @Override - public SRID getSrid() { - return srid; - } - - public void setSrid(final SRID srid) { - this.srid = srid; - } - - @Override - public DynamicAnnotationExpression getValue() { - return value; - } - - public void setValue(final DynamicAnnotationExpression value) { - this.value = value; - } - -} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/CollectionDeserializer.java ---------------------------------------------------------------------- diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/CollectionDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/CollectionDeserializer.java deleted file mode 100644 index a606987..0000000 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/CollectionDeserializer.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.olingo.client.core.edm.xml.v4.annotation; - -import java.io.IOException; - -import org.apache.olingo.client.core.edm.xml.AbstractEdmDeserializer; - -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.core.JsonToken; -import com.fasterxml.jackson.databind.DeserializationContext; - -public class CollectionDeserializer extends AbstractEdmDeserializer<CollectionImpl> { - - @Override - protected CollectionImpl doDeserialize(final JsonParser jp, final DeserializationContext ctxt) - throws IOException, JsonProcessingException { - - final CollectionImpl collection = new CollectionImpl(); - - 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(AbstractDynamicAnnotationExpression.class)); - } - } - } - - return collection; - } - -} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/CollectionImpl.java ---------------------------------------------------------------------- diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/CollectionImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/CollectionImpl.java deleted file mode 100644 index b8f7614..0000000 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/CollectionImpl.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.olingo.client.core.edm.xml.v4.annotation; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.olingo.client.api.edm.xml.v4.annotation.AnnotationExpression; -import org.apache.olingo.client.api.edm.xml.v4.annotation.Collection; - -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; - -@JsonDeserialize(using = CollectionDeserializer.class) -public class CollectionImpl extends AbstractDynamicAnnotationExpression implements Collection { - - private static final long serialVersionUID = -724749123749715643L; - - private final List<AnnotationExpression> items = new ArrayList<AnnotationExpression>(); - - @Override - public List<AnnotationExpression> getItems() { - return items; - } - -} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/ConstantAnnotationExpressionImpl.java ---------------------------------------------------------------------- diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/ConstantAnnotationExpressionImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/ConstantAnnotationExpressionImpl.java deleted file mode 100644 index d210899..0000000 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/ConstantAnnotationExpressionImpl.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.olingo.client.core.edm.xml.v4.annotation; - -import org.apache.olingo.client.api.edm.xml.v4.annotation.ConstantAnnotationExpression; - -public class ConstantAnnotationExpressionImpl - extends AbstractAnnotationExpression implements ConstantAnnotationExpression { - - private static final long serialVersionUID = 5618680702707972904L; - - private Type type; - - private String value; - - @Override - public Type getType() { - return type; - } - - @Override - public void setType(final Type type) { - this.type = type; - } - - @Override - public String getValue() { - return value; - } - - @Override - public void setValue(final String value) { - this.value = value; - } - -} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/DynamicAnnotationExpressionDeserializer.java ---------------------------------------------------------------------- diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/DynamicAnnotationExpressionDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/DynamicAnnotationExpressionDeserializer.java deleted file mode 100644 index a03b98d..0000000 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/DynamicAnnotationExpressionDeserializer.java +++ /dev/null @@ -1,175 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.olingo.client.core.edm.xml.v4.annotation; - -import java.io.IOException; - -import org.apache.commons.lang3.ArrayUtils; -import org.apache.commons.lang3.ClassUtils; -import org.apache.olingo.client.api.edm.xml.v4.annotation.AnnotationPath; -import org.apache.olingo.client.api.edm.xml.v4.annotation.Apply; -import org.apache.olingo.client.api.edm.xml.v4.annotation.Cast; -import org.apache.olingo.client.api.edm.xml.v4.annotation.Collection; -import org.apache.olingo.client.api.edm.xml.v4.annotation.If; -import org.apache.olingo.client.api.edm.xml.v4.annotation.IsOf; -import org.apache.olingo.client.api.edm.xml.v4.annotation.LabeledElement; -import org.apache.olingo.client.api.edm.xml.v4.annotation.NavigationPropertyPath; -import org.apache.olingo.client.api.edm.xml.v4.annotation.Null; -import org.apache.olingo.client.api.edm.xml.v4.annotation.Path; -import org.apache.olingo.client.api.edm.xml.v4.annotation.PropertyPath; -import org.apache.olingo.client.api.edm.xml.v4.annotation.Record; -import org.apache.olingo.client.api.edm.xml.v4.annotation.TwoParamsOpDynamicAnnotationExpression; -import org.apache.olingo.client.api.edm.xml.v4.annotation.UrlRef; -import org.apache.olingo.client.core.edm.xml.AbstractEdmDeserializer; - -import com.fasterxml.jackson.core.JsonLocation; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.core.JsonToken; -import com.fasterxml.jackson.databind.DeserializationContext; - -public class DynamicAnnotationExpressionDeserializer - extends AbstractEdmDeserializer<AbstractDynamicAnnotationExpression> { - - private static final String[] EL_OR_ATTR = { - AnnotationPath.class.getSimpleName(), NavigationPropertyPath.class.getSimpleName(), - Path.class.getSimpleName(), PropertyPath.class.getSimpleName() - }; - - private static final String APPLY = Apply.class.getSimpleName(); - - private static final String CAST = Cast.class.getSimpleName(); - - private static final String COLLECTION = Collection.class.getSimpleName(); - - private static final String IF = If.class.getSimpleName(); - - private static final String IS_OF = IsOf.class.getSimpleName(); - - private static final String LABELED_ELEMENT = LabeledElement.class.getSimpleName(); - - private static final String NULL = Null.class.getSimpleName(); - - private static final String RECORD = Record.class.getSimpleName(); - - private static final String URL_REF = UrlRef.class.getSimpleName(); - - private AbstractElementOrAttributeExpression getElementOrAttributeExpressio(final String simpleClassName) - throws JsonParseException { - - try { - @SuppressWarnings("unchecked") - Class<? extends AbstractElementOrAttributeExpression> elOrAttrClass = - (Class<? extends AbstractElementOrAttributeExpression>) ClassUtils.getClass( - getClass().getPackage().getName() + "." + simpleClassName + "Impl"); - return elOrAttrClass.newInstance(); - } catch (Exception e) { - throw new JsonParseException("Could not instantiate " + simpleClassName, JsonLocation.NA, e); - } - } - - private AbstractAnnotationExpression parseConstOrEnumExpression(final JsonParser jp) throws IOException { - AbstractAnnotationExpression result; - if (isAnnotationConstExprConstruct(jp)) { - result = parseAnnotationConstExprConstruct(jp); - } else { - result = jp.readValueAs(AbstractDynamicAnnotationExpression.class); - } - jp.nextToken(); - - return result; - } - - @Override - protected AbstractDynamicAnnotationExpression doDeserialize(final JsonParser jp, final DeserializationContext ctxt) - throws IOException, JsonProcessingException { - - AbstractDynamicAnnotationExpression expression = null; - - if ("Not".equals(jp.getCurrentName())) { - final NotImpl not = new NotImpl(); - - jp.nextToken(); - for (; jp.getCurrentToken() != JsonToken.FIELD_NAME; jp.nextToken()) { - } - not.setExpression(jp.readValueAs(AbstractDynamicAnnotationExpression.class)); - for (; jp.getCurrentToken() != JsonToken.END_OBJECT || !jp.getCurrentName().equals("Not"); jp.nextToken()) { - } - - expression = not; - } else if (TwoParamsOpDynamicAnnotationExpression.Type.fromString(jp.getCurrentName()) != null) { - final TwoParamsOpDynamicAnnotationExpressionImpl dynExprDoubleParamOp = - new TwoParamsOpDynamicAnnotationExpressionImpl(); - dynExprDoubleParamOp.setType(TwoParamsOpDynamicAnnotationExpression.Type.fromString(jp.getCurrentName())); - - jp.nextToken(); - for (; jp.getCurrentToken() != JsonToken.FIELD_NAME; jp.nextToken()) { - } - dynExprDoubleParamOp.setLeftExpression(jp.readValueAs(AbstractDynamicAnnotationExpression.class)); - dynExprDoubleParamOp.setRightExpression(jp.readValueAs(AbstractDynamicAnnotationExpression.class)); - for (; jp.getCurrentToken() != JsonToken.END_OBJECT - || !jp.getCurrentName().equals(dynExprDoubleParamOp.getType().name()); jp.nextToken()) { - } - - expression = dynExprDoubleParamOp; - } else if (ArrayUtils.contains(EL_OR_ATTR, jp.getCurrentName())) { - final AbstractElementOrAttributeExpression elOrAttr = getElementOrAttributeExpressio(jp.getCurrentName()); - elOrAttr.setValue(jp.nextTextValue()); - - expression = elOrAttr; - } else if (APPLY.equals(jp.getCurrentName())) { - jp.nextToken(); - expression = jp.readValueAs(ApplyImpl.class); - } else if (CAST.equals(jp.getCurrentName())) { - jp.nextToken(); - expression = jp.readValueAs(CastImpl.class); - } else if (COLLECTION.equals(jp.getCurrentName())) { - jp.nextToken(); - expression = jp.readValueAs(CollectionImpl.class); - } else if (IF.equals(jp.getCurrentName())) { - jp.nextToken(); - jp.nextToken(); - - final IfImpl _if = new IfImpl(); - _if.setGuard(parseConstOrEnumExpression(jp)); - _if.setThen(parseConstOrEnumExpression(jp)); - _if.setElse(parseConstOrEnumExpression(jp)); - - expression = _if; - } else if (IS_OF.equals(jp.getCurrentName())) { - jp.nextToken(); - expression = jp.readValueAs(IsOfImpl.class); - } else if (LABELED_ELEMENT.equals(jp.getCurrentName())) { - jp.nextToken(); - expression = jp.readValueAs(LabeledElementImpl.class); - } else if (NULL.equals(jp.getCurrentName())) { - jp.nextToken(); - expression = jp.readValueAs(NullImpl.class); - } else if (RECORD.equals(jp.getCurrentName())) { - jp.nextToken(); - expression = jp.readValueAs(RecordImpl.class); - } else if (URL_REF.equals(jp.getCurrentName())) { - jp.nextToken(); - expression = jp.readValueAs(UrlRefImpl.class); - } - - return expression; - } -} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/IfImpl.java ---------------------------------------------------------------------- diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/IfImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/IfImpl.java deleted file mode 100644 index 1092280..0000000 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/IfImpl.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.olingo.client.core.edm.xml.v4.annotation; - -import org.apache.olingo.client.api.edm.xml.v4.annotation.AnnotationExpression; -import org.apache.olingo.client.api.edm.xml.v4.annotation.If; - -public class IfImpl extends AbstractAnnotatableDynamicAnnotationExpression implements If { - - private static final long serialVersionUID = -8571383625077590656L; - - private AnnotationExpression guard; - - private AnnotationExpression _then; - - private AnnotationExpression _else; - - @Override - public AnnotationExpression getGuard() { - return guard; - } - - public void setGuard(final AnnotationExpression guard) { - this.guard = guard; - } - - @Override - public AnnotationExpression getThen() { - return _then; - } - - public void setThen(final AnnotationExpression _then) { - this._then = _then; - } - - @Override - public AnnotationExpression getElse() { - return _else; - } - - public void setElse(final AnnotationExpression _else) { - this._else = _else; - } - -} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/IsOfDeserializer.java ---------------------------------------------------------------------- diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/IsOfDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/IsOfDeserializer.java deleted file mode 100644 index 8af18b3..0000000 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/IsOfDeserializer.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.olingo.client.core.edm.xml.v4.annotation; - -import java.io.IOException; - -import org.apache.olingo.client.core.edm.xml.AbstractEdmDeserializer; -import org.apache.olingo.client.core.edm.xml.v4.AnnotationImpl; -import org.apache.olingo.commons.api.edm.geo.SRID; - -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.core.JsonToken; -import com.fasterxml.jackson.databind.DeserializationContext; - -public class IsOfDeserializer extends AbstractEdmDeserializer<IsOfImpl> { - - @Override - protected IsOfImpl doDeserialize(final JsonParser jp, final DeserializationContext ctxt) - throws IOException, JsonProcessingException { - - final IsOfImpl isof = new IsOfImpl(); - - 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(AnnotationImpl.class)); - } else if ("MaxLength".equals(jp.getCurrentName())) { - final String maxLenght = jp.nextTextValue(); - isof.setMaxLength(maxLenght.equalsIgnoreCase("max") ? Integer.MAX_VALUE : Integer.valueOf(maxLenght)); - } else if ("Precision".equals(jp.getCurrentName())) { - isof.setPrecision(Integer.valueOf(jp.nextTextValue())); - } else if ("Scale".equals(jp.getCurrentName())) { - final String scale = jp.nextTextValue(); - isof.setScale(scale.equalsIgnoreCase("variable") ? 0 : Integer.valueOf(scale)); - } else if ("SRID".equals(jp.getCurrentName())) { - final String srid = jp.nextTextValue(); - if (srid != null) { - isof.setSrid(SRID.valueOf(srid)); - } - } else { - isof.setValue(jp.readValueAs(AbstractDynamicAnnotationExpression.class)); - } - } - } - - return isof; - } - -} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/IsOfImpl.java ---------------------------------------------------------------------- diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/IsOfImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/IsOfImpl.java deleted file mode 100644 index d3a2b09..0000000 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/IsOfImpl.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.olingo.client.core.edm.xml.v4.annotation; - -import org.apache.olingo.client.api.edm.xml.v4.annotation.DynamicAnnotationExpression; -import org.apache.olingo.client.api.edm.xml.v4.annotation.IsOf; -import org.apache.olingo.commons.api.edm.geo.SRID; - -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; - -@JsonDeserialize(using = IsOfDeserializer.class) -public class IsOfImpl extends AbstractAnnotatableDynamicAnnotationExpression implements IsOf { - - private static final long serialVersionUID = -893355856129761174L; - - private String type; - - private Integer maxLength; - - private Integer precision; - - private Integer scale; - - private SRID srid; - - private DynamicAnnotationExpression value; - - @Override - public String getType() { - return type; - } - - public void setType(final String type) { - this.type = type; - } - - @Override - public Integer getMaxLength() { - return maxLength; - } - - public void setMaxLength(final Integer maxLength) { - this.maxLength = maxLength; - } - - @Override - public Integer getPrecision() { - return precision; - } - - public void setPrecision(final Integer precision) { - this.precision = precision; - } - - @Override - public Integer getScale() { - return scale; - } - - public void setScale(final Integer scale) { - this.scale = scale; - } - - @Override - public SRID getSrid() { - return srid; - } - - public void setSrid(final SRID srid) { - this.srid = srid; - } - - @Override - public DynamicAnnotationExpression getValue() { - return value; - } - - public void setValue(final DynamicAnnotationExpression value) { - this.value = value; - } - -} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/LabeledElementDeserializer.java ---------------------------------------------------------------------- diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/LabeledElementDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/LabeledElementDeserializer.java deleted file mode 100644 index 97d128f..0000000 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/LabeledElementDeserializer.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.olingo.client.core.edm.xml.v4.annotation; - -import java.io.IOException; - -import org.apache.olingo.client.core.edm.xml.AbstractEdmDeserializer; -import org.apache.olingo.client.core.edm.xml.v4.AnnotationImpl; - -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.core.JsonToken; -import com.fasterxml.jackson.databind.DeserializationContext; - -public class LabeledElementDeserializer extends AbstractEdmDeserializer<LabeledElementImpl> { - - @Override - protected LabeledElementImpl doDeserialize(final JsonParser jp, final DeserializationContext ctxt) - throws IOException, JsonProcessingException { - - final LabeledElementImpl element = new LabeledElementImpl(); - - 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(AnnotationImpl.class)); - } else { - element.setValue(jp.readValueAs(AbstractDynamicAnnotationExpression.class)); - } - } - } - - return element; - } - -} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/LabeledElementImpl.java ---------------------------------------------------------------------- diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/LabeledElementImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/LabeledElementImpl.java deleted file mode 100644 index 2e6096c..0000000 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/LabeledElementImpl.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.olingo.client.core.edm.xml.v4.annotation; - -import org.apache.olingo.client.api.edm.xml.v4.annotation.DynamicAnnotationExpression; -import org.apache.olingo.client.api.edm.xml.v4.annotation.LabeledElement; - -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; - -@JsonDeserialize(using = LabeledElementDeserializer.class) -public class LabeledElementImpl - extends AbstractAnnotatableDynamicAnnotationExpression implements LabeledElement { - - private static final long serialVersionUID = 4909387630253341824L; - - private String name; - - private DynamicAnnotationExpression value; - - @Override - public String getName() { - return name; - } - - public void setName(final String name) { - this.name = name; - } - - @Override - public DynamicAnnotationExpression getValue() { - return value; - } - - public void setValue(final DynamicAnnotationExpression value) { - this.value = value; - } - -} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/LabeledElementReferenceImpl.java ---------------------------------------------------------------------- diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/LabeledElementReferenceImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/LabeledElementReferenceImpl.java deleted file mode 100644 index 0f0d24d..0000000 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/LabeledElementReferenceImpl.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.olingo.client.core.edm.xml.v4.annotation; - -import org.apache.olingo.client.api.edm.xml.v4.annotation.LabeledElementReference; - -public class LabeledElementReferenceImpl - extends AbstractElementOrAttributeExpression implements LabeledElementReference { - - private static final long serialVersionUID = 7560525604021670529L; - -} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/NavigationPropertyPathImpl.java ---------------------------------------------------------------------- diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/NavigationPropertyPathImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/NavigationPropertyPathImpl.java deleted file mode 100644 index 3cedc6b..0000000 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/NavigationPropertyPathImpl.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.olingo.client.core.edm.xml.v4.annotation; - -import org.apache.olingo.client.api.edm.xml.v4.annotation.NavigationPropertyPath; - -public class NavigationPropertyPathImpl extends AbstractElementOrAttributeExpression implements NavigationPropertyPath { - - private static final long serialVersionUID = 879840502446301312L; - -} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/NotImpl.java ---------------------------------------------------------------------- diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/NotImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/NotImpl.java deleted file mode 100644 index f6a230b..0000000 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/NotImpl.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.olingo.client.core.edm.xml.v4.annotation; - -import org.apache.olingo.client.api.edm.xml.v4.annotation.DynamicAnnotationExpression; -import org.apache.olingo.client.api.edm.xml.v4.annotation.Not; - -public class NotImpl extends AbstractDynamicAnnotationExpression implements Not { - - private static final long serialVersionUID = -437788415922966812L; - - private DynamicAnnotationExpression expression; - - @Override - public DynamicAnnotationExpression getExpression() { - return expression; - } - - public void setExpression(final DynamicAnnotationExpression expression) { - this.expression = expression; - } - -} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/NullDeserializer.java ---------------------------------------------------------------------- diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/NullDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/NullDeserializer.java deleted file mode 100644 index 66d46a6..0000000 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/NullDeserializer.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.olingo.client.core.edm.xml.v4.annotation; - -import java.io.IOException; - -import org.apache.olingo.client.core.edm.xml.AbstractEdmDeserializer; -import org.apache.olingo.client.core.edm.xml.v4.AnnotationImpl; - -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.core.JsonToken; -import com.fasterxml.jackson.databind.DeserializationContext; - -public class NullDeserializer extends AbstractEdmDeserializer<NullImpl> { - - @Override - protected NullImpl doDeserialize(final JsonParser jp, final DeserializationContext ctxt) - throws IOException, JsonProcessingException { - - final NullImpl _null = new NullImpl(); - - 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(AnnotationImpl.class)); - } - } - } - - return _null; - } - -} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/NullImpl.java ---------------------------------------------------------------------- diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/NullImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/NullImpl.java deleted file mode 100644 index 3d3bfb0..0000000 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/NullImpl.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.olingo.client.core.edm.xml.v4.annotation; - -import org.apache.olingo.client.api.edm.xml.v4.annotation.Null; - -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; - -@JsonDeserialize(using = NullDeserializer.class) -public class NullImpl extends AbstractAnnotatableDynamicAnnotationExpression implements Null { - - private static final long serialVersionUID = -3148516847180393142L; - -} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/PathImpl.java ---------------------------------------------------------------------- diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/PathImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/PathImpl.java deleted file mode 100644 index fb01a25..0000000 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/PathImpl.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.olingo.client.core.edm.xml.v4.annotation; - -import org.apache.olingo.client.api.edm.xml.v4.annotation.Path; - -public class PathImpl extends AbstractElementOrAttributeExpression implements Path { - - private static final long serialVersionUID = 6020168217561402545L; - -} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/PropertyPathImpl.java ---------------------------------------------------------------------- diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/PropertyPathImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/PropertyPathImpl.java deleted file mode 100644 index ef6619f..0000000 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/PropertyPathImpl.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.olingo.client.core.edm.xml.v4.annotation; - -import org.apache.olingo.client.api.edm.xml.v4.annotation.PropertyPath; - -public class PropertyPathImpl extends AbstractElementOrAttributeExpression implements PropertyPath { - - private static final long serialVersionUID = -9133862135834738470L; - -}
