http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/BatchResponseSerializer.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/BatchResponseSerializer.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/BatchResponseSerializer.java index d99d943..a5afba1 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/BatchResponseSerializer.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/BatchResponseSerializer.java @@ -6,9 +6,9 @@ * 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 @@ -110,24 +110,24 @@ public class BatchResponseSerializer { private void appendHeader(final String name, final String value, final BodyBuilder builder) { builder.append(name) - .append(COLON) - .append(SP) - .append(value) - .append(CRLF); + .append(COLON) + .append(SP) + .append(value) + .append(CRLF); } private void appendStatusLine(final ODataResponse response, final BodyBuilder builder) { builder.append("HTTP/1.1") - .append(SP) - .append(response.getStatusCode()) - .append(SP) - .append(getStatusCodeInfo(response)) - .append(CRLF); + .append(SP) + .append(response.getStatusCode()) + .append(SP) + .append(getStatusCodeInfo(response)) + .append(CRLF); } - private String getStatusCodeInfo(ODataResponse response) { + private String getStatusCodeInfo(final ODataResponse response) { HttpStatusCode status = HttpStatusCode.fromStatusCode(response.getStatusCode()); - if(status == null) { + if (status == null) { throw new ODataRuntimeException("Invalid status code in response '" + response.getStatusCode() + "'"); } return status.getInfo(); @@ -189,17 +189,17 @@ public class BatchResponseSerializer { return tmp; } - public BodyBuilder append(String string) { - byte [] b = string.getBytes(CHARSET_ISO_8859_1); + public BodyBuilder append(final String string) { + byte[] b = string.getBytes(CHARSET_ISO_8859_1); put(b); return this; } - private void put(byte[] b) { - if(isClosed) { + private void put(final byte[] b) { + if (isClosed) { throw new RuntimeException("BodyBuilder is closed."); } - if(buffer.remaining() < b.length) { + if (buffer.remaining() < b.length) { buffer.flip(); int newSize = (buffer.limit() * 2) + b.length; ByteBuffer tmp = ByteBuffer.allocate(newSize); @@ -209,15 +209,16 @@ public class BatchResponseSerializer { buffer.put(b); } - public BodyBuilder append(int statusCode) { + public BodyBuilder append(final int statusCode) { return append(String.valueOf(statusCode)); } - public BodyBuilder append(Body body) { + public BodyBuilder append(final Body body) { put(body.getContent()); return this; } + @Override public String toString() { return new String(buffer.array(), 0, buffer.position(), CHARSET_ISO_8859_1); } @@ -229,8 +230,8 @@ public class BatchResponseSerializer { private class Body { private final byte[] content; - public Body(ODataResponse response) { - this.content = getBody(response); + public Body(final ODataResponse response) { + content = getBody(response); } public int getLength() {
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/FixedFormatSerializerImpl.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/FixedFormatSerializerImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/FixedFormatSerializerImpl.java index 3066839..f21f064 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/FixedFormatSerializerImpl.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/FixedFormatSerializerImpl.java @@ -6,9 +6,9 @@ * 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 @@ -67,7 +67,7 @@ public class FixedFormatSerializerImpl implements FixedFormatSerializer { } @Override - public InputStream asyncResponse(ODataResponse odataResponse) throws SerializerException { + public InputStream asyncResponse(final ODataResponse odataResponse) throws SerializerException { AsyncResponseSerializer serializer = new AsyncResponseSerializer(); return serializer.serialize(odataResponse); } http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/SerializerResultImpl.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/SerializerResultImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/SerializerResultImpl.java index 53dca19..0d35f2c 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/SerializerResultImpl.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/SerializerResultImpl.java @@ -6,9 +6,9 @@ * 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 http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/json/ODataErrorSerializer.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/json/ODataErrorSerializer.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/json/ODataErrorSerializer.java index c3c39d0..9a84c27 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/json/ODataErrorSerializer.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/json/ODataErrorSerializer.java @@ -6,9 +6,9 @@ * 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 http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/json/ODataJsonSerializer.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/json/ODataJsonSerializer.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/json/ODataJsonSerializer.java index b5a2c6a..a912862 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/json/ODataJsonSerializer.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/json/ODataJsonSerializer.java @@ -6,9 +6,9 @@ * 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 @@ -78,8 +78,8 @@ public class ODataJsonSerializer extends AbstractODataSerializer { private final boolean isODataMetadataNone; public ODataJsonSerializer(final ContentType contentType) { - this.isIEEE754Compatible = isODataIEEE754Compatible(contentType); - this.isODataMetadataNone = ContentTypeHelper.isODataMetadataNone(contentType); + isIEEE754Compatible = isODataIEEE754Compatible(contentType); + isODataMetadataNone = ContentTypeHelper.isODataMetadataNone(contentType); } @Override @@ -187,9 +187,9 @@ public class ODataJsonSerializer extends AbstractODataSerializer { JsonGenerator json = new JsonFactory().createGenerator(outputStream); writeEntity(metadata, entityType, entity, contextURL, options == null ? null : options.getExpand(), - options == null ? null : options.getSelect(), - options == null ? false : options.getWriteOnlyReferences(), - json); + options == null ? null : options.getSelect(), + options == null ? false : options.getWriteOnlyReferences(), + json); json.close(); outputStream.close(); @@ -232,7 +232,7 @@ public class ODataJsonSerializer extends AbstractODataSerializer { protected void writeEntity(final ServiceMetadata metadata, final EdmEntityType entityType, final Entity entity, final ContextURL contextURL, final ExpandOption expand, final SelectOption select, final boolean onlyReference, final JsonGenerator json) - throws IOException, SerializerException { + throws IOException, SerializerException { json.writeStartObject(); if (!isODataMetadataNone) { if (contextURL != null) { // top-level entity @@ -291,7 +291,7 @@ public class ODataJsonSerializer extends AbstractODataSerializer { } throw new SerializerException("Wrong base type", SerializerException.MessageKeys.WRONG_BASE_TYPE, derivedTypeName, baseType - .getFullQualifiedName().getFullQualifiedNameAsString()); + .getFullQualifiedName().getFullQualifiedNameAsString()); } protected EdmComplexType resolveComplexType(final ServiceMetadata metadata, final EdmComplexType baseType, @@ -315,21 +315,21 @@ public class ODataJsonSerializer extends AbstractODataSerializer { } throw new SerializerException("Wrong base type", SerializerException.MessageKeys.WRONG_BASE_TYPE, derivedTypeName, baseType - .getFullQualifiedName().getFullQualifiedNameAsString()); + .getFullQualifiedName().getFullQualifiedNameAsString()); } protected void writeProperties(final EdmStructuredType type, final List<Property> properties, final SelectOption select, final JsonGenerator json) - throws IOException, SerializerException { + throws IOException, SerializerException { final boolean all = ExpandSelectHelper.isAll(select); final Set<String> selected = all ? new HashSet<String>() : - ExpandSelectHelper.getSelectedPropertyNames(select.getSelectItems()); + ExpandSelectHelper.getSelectedPropertyNames(select.getSelectItems()); for (final String propertyName : type.getPropertyNames()) { if (all || selected.contains(propertyName)) { final EdmProperty edmProperty = type.getStructuralProperty(propertyName); final Property property = findProperty(propertyName, properties); final Set<List<String>> selectedPaths = all || edmProperty.isPrimitive() ? null : - ExpandSelectHelper.getSelectedPaths(select.getSelectItems(), propertyName); + ExpandSelectHelper.getSelectedPaths(select.getSelectItems(), propertyName); writeProperty(edmProperty, property, selectedPaths, json); } } @@ -341,20 +341,20 @@ public class ODataJsonSerializer extends AbstractODataSerializer { if (ExpandSelectHelper.hasExpand(expand)) { final boolean expandAll = ExpandSelectHelper.isExpandAll(expand); final Set<String> expanded = expandAll ? new HashSet<String>() : - ExpandSelectHelper.getExpandedPropertyNames(expand.getExpandItems()); + ExpandSelectHelper.getExpandedPropertyNames(expand.getExpandItems()); for (final String propertyName : type.getNavigationPropertyNames()) { if (expandAll || expanded.contains(propertyName)) { final EdmNavigationProperty property = type.getNavigationProperty(propertyName); final Link navigationLink = linked.getNavigationLink(property.getName()); final ExpandItem innerOptions = expandAll ? null : - ExpandSelectHelper.getExpandItem(expand.getExpandItems(), propertyName); + ExpandSelectHelper.getExpandItem(expand.getExpandItems(), propertyName); if (innerOptions != null && innerOptions.getLevelsOption() != null) { throw new SerializerException("Expand option $levels is not supported.", SerializerException.MessageKeys.NOT_IMPLEMENTED); } writeExpandedNavigationProperty(metadata, property, navigationLink, innerOptions == null ? null : innerOptions.getExpandOption(), - innerOptions == null ? null : innerOptions.getSelectOption(), json); + innerOptions == null ? null : innerOptions.getSelectOption(), json); } } } @@ -384,17 +384,17 @@ public class ODataJsonSerializer extends AbstractODataSerializer { protected void writeProperty(final EdmProperty edmProperty, final Property property, final Set<List<String>> selectedPaths, final JsonGenerator json) - throws IOException, SerializerException { + throws IOException, SerializerException { json.writeFieldName(edmProperty.getName()); if (property == null || property.isNull()) { if (edmProperty.isNullable() == Boolean.FALSE) { throw new SerializerException("Non-nullable property not present!", SerializerException.MessageKeys.MISSING_PROPERTY, edmProperty.getName()); } else { - if(edmProperty.isCollection()){ + if (edmProperty.isCollection()) { json.writeStartArray(); json.writeEndArray(); - }else { + } else { json.writeNull(); } } @@ -405,7 +405,7 @@ public class ODataJsonSerializer extends AbstractODataSerializer { private void writePropertyValue(final EdmProperty edmProperty, final Property property, final Set<List<String>> selectedPaths, final JsonGenerator json) - throws IOException, SerializerException { + throws IOException, SerializerException { final EdmType type = edmProperty.getType(); try { if (edmProperty.isPrimitive() @@ -439,7 +439,7 @@ public class ODataJsonSerializer extends AbstractODataSerializer { private void writePrimitiveCollection(final EdmPrimitiveType type, final Property property, final Boolean isNullable, final Integer maxLength, final Integer precision, final Integer scale, final Boolean isUnicode, final JsonGenerator json) - throws IOException, SerializerException { + throws IOException, SerializerException { json.writeStartArray(); for (Object value : property.asCollection()) { switch (property.getValueType()) { @@ -466,7 +466,7 @@ public class ODataJsonSerializer extends AbstractODataSerializer { private void writeComplexCollection(final EdmComplexType type, final Property property, final Set<List<String>> selectedPaths, final JsonGenerator json) - throws IOException, SerializerException { + throws IOException, SerializerException { json.writeStartArray(); for (Object value : property.asCollection()) { switch (property.getValueType()) { @@ -484,7 +484,7 @@ public class ODataJsonSerializer extends AbstractODataSerializer { private void writePrimitive(final EdmPrimitiveType type, final Property property, final Boolean isNullable, final Integer maxLength, final Integer precision, final Integer scale, final Boolean isUnicode, final JsonGenerator json) - throws EdmPrimitiveTypeException, IOException, SerializerException { + throws EdmPrimitiveTypeException, IOException, SerializerException { if (property.isPrimitive()) { writePrimitiveValue(type, property.asPrimitive(), isNullable, maxLength, precision, scale, isUnicode, json); @@ -526,14 +526,14 @@ public class ODataJsonSerializer extends AbstractODataSerializer { protected void writeComplexValue(final EdmComplexType type, final List<Property> properties, final Set<List<String>> selectedPaths, final JsonGenerator json) - throws IOException, SerializerException { + throws IOException, SerializerException { json.writeStartObject(); for (final String propertyName : type.getPropertyNames()) { final Property property = findProperty(propertyName, properties); if (selectedPaths == null || ExpandSelectHelper.isSelected(selectedPaths, propertyName)) { writeProperty((EdmProperty) type.getProperty(propertyName), property, selectedPaths == null ? null : ExpandSelectHelper.getReducedSelectedPaths(selectedPaths, propertyName), - json); + json); } } json.writeEndObject(); @@ -567,10 +567,10 @@ public class ODataJsonSerializer extends AbstractODataSerializer { json.writeFieldName(Constants.VALUE); writePrimitive(type, property, options == null ? null : options.isNullable(), - options == null ? null : options.getMaxLength(), - options == null ? null : options.getPrecision(), - options == null ? null : options.getScale(), - options == null ? null : options.isUnicode(), json); + options == null ? null : options.getMaxLength(), + options == null ? null : options.getPrecision(), + options == null ? null : options.getScale(), + options == null ? null : options.isUnicode(), json); } json.writeEndObject(); @@ -610,16 +610,16 @@ public class ODataJsonSerializer extends AbstractODataSerializer { } final List<Property> values = property.isNull() ? Collections.<Property> emptyList() : property.asComplex().getValue(); - writeProperties(type, values, options == null ? null : options.getSelect(), json); - if (!property.isNull() && property.isComplex()) { - writeNavigationProperties(metadata, type, property.asComplex(), - options == null ? null : options.getExpand(), json); - } - json.writeEndObject(); + writeProperties(type, values, options == null ? null : options.getSelect(), json); + if (!property.isNull() && property.isComplex()) { + writeNavigationProperties(metadata, type, property.asComplex(), + options == null ? null : options.getExpand(), json); + } + json.writeEndObject(); - json.close(); - outputStream.close(); - return SerializerResultImpl.with().content(buffer.getInputStream()).build(); + json.close(); + outputStream.close(); + return SerializerResultImpl.with().content(buffer.getInputStream()).build(); } catch (final IOException e) { cachedException = new SerializerException(IO_EXCEPTION_TEXT, e, SerializerException.MessageKeys.IO_EXCEPTION); @@ -645,10 +645,10 @@ public class ODataJsonSerializer extends AbstractODataSerializer { json.writeFieldName(Constants.VALUE); writePrimitiveCollection(type, property, options == null ? null : options.isNullable(), - options == null ? null : options.getMaxLength(), - options == null ? null : options.getPrecision(), - options == null ? null : options.getScale(), - options == null ? null : options.isUnicode(), json); + options == null ? null : options.getMaxLength(), + options == null ? null : options.getPrecision(), + options == null ? null : options.getScale(), + options == null ? null : options.isUnicode(), json); json.writeEndObject(); json.close(); @@ -725,7 +725,7 @@ public class ODataJsonSerializer extends AbstractODataSerializer { @Override public SerializerResult referenceCollection(final ServiceMetadata metadata, final EdmEntitySet edmEntitySet, final EntityCollection entityCollection, final ReferenceCollectionSerializerOptions options) - throws SerializerException { + throws SerializerException { OutputStream outputStream = null; SerializerException cachedException = null; @@ -767,13 +767,13 @@ public class ODataJsonSerializer extends AbstractODataSerializer { } - private void writeContextURL(final ContextURL contextURL, JsonGenerator json) throws IOException { + private void writeContextURL(final ContextURL contextURL, final JsonGenerator json) throws IOException { if (!isODataMetadataNone && contextURL != null) { json.writeStringField(Constants.JSON_CONTEXT, ContextURLBuilder.create(contextURL).toASCIIString()); } } - private void writeMetadataETag(final ServiceMetadata metadata, JsonGenerator json) throws IOException { + private void writeMetadataETag(final ServiceMetadata metadata, final JsonGenerator json) throws IOException { if (!isODataMetadataNone && metadata != null && metadata.getServiceMetadataETagSupport() != null @@ -783,7 +783,7 @@ public class ODataJsonSerializer extends AbstractODataSerializer { } } - private void writeCount(final EntityCollection entityCollection, JsonGenerator json) throws IOException { + private void writeCount(final EntityCollection entityCollection, final JsonGenerator json) throws IOException { if (entityCollection.getCount() != null) { if (isIEEE754Compatible) { json.writeStringField(Constants.JSON_COUNT, entityCollection.getCount().toString()); @@ -793,7 +793,7 @@ public class ODataJsonSerializer extends AbstractODataSerializer { } } - private void writeNextLink(final EntityCollection entitySet, JsonGenerator json) throws IOException { + private void writeNextLink(final EntityCollection entitySet, final JsonGenerator json) throws IOException { if (entitySet.getNext() != null) { json.writeStringField(Constants.JSON_NEXT_LINK, entitySet.getNext().toASCIIString()); } http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/json/ServiceDocumentJsonSerializer.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/json/ServiceDocumentJsonSerializer.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/json/ServiceDocumentJsonSerializer.java index 9625a4c..682e478 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/json/ServiceDocumentJsonSerializer.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/json/ServiceDocumentJsonSerializer.java @@ -6,9 +6,9 @@ * 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 @@ -58,8 +58,8 @@ public class ServiceDocumentJsonSerializer { if (!isODataMetadataNone) { final String metadataUri = (serviceRoot == null ? "" : - serviceRoot.endsWith("/") ? serviceRoot : (serviceRoot + "/")) - + Constants.METADATA; + serviceRoot.endsWith("/") ? serviceRoot : (serviceRoot + "/")) + + Constants.METADATA; gen.writeObjectField(Constants.JSON_CONTEXT, metadataUri); if (metadata != null @@ -100,9 +100,9 @@ public class ServiceDocumentJsonSerializer { } } - private void writeElement(JsonGenerator gen, final String kind, final String reference, final String name, + private void writeElement(final JsonGenerator gen, final String kind, final String reference, final String name, final String title) - throws IOException { + throws IOException { gen.writeStartObject(); gen.writeObjectField(Constants.JSON_NAME, name); if (title != null) { http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/utils/CircleStreamBuffer.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/utils/CircleStreamBuffer.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/utils/CircleStreamBuffer.java index 20d9ca5..ac91b84 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/utils/CircleStreamBuffer.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/utils/CircleStreamBuffer.java @@ -6,9 +6,9 @@ * 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 http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/utils/ContentTypeHelper.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/utils/ContentTypeHelper.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/utils/ContentTypeHelper.java index 8710158..68d85f7 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/utils/ContentTypeHelper.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/utils/ContentTypeHelper.java @@ -6,9 +6,9 @@ * 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 @@ -21,13 +21,13 @@ package org.apache.olingo.server.core.serializer.utils; import org.apache.olingo.commons.api.format.ContentType; public class ContentTypeHelper { - - private ContentTypeHelper (){ - //Private constructor for utility classes + + private ContentTypeHelper() { + // Private constructor for utility classes } - + public static boolean isODataMetadataNone(final ContentType contentType) { - return contentType.isCompatible(ContentType.APPLICATION_JSON) - && ContentType.VALUE_ODATA_METADATA_NONE.equals(contentType.getParameter(ContentType.PARAMETER_ODATA_METADATA)); + return contentType.isCompatible(ContentType.APPLICATION_JSON) + && ContentType.VALUE_ODATA_METADATA_NONE.equals(contentType.getParameter(ContentType.PARAMETER_ODATA_METADATA)); } } http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/utils/ContextURLBuilder.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/utils/ContextURLBuilder.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/utils/ContextURLBuilder.java index 8c7a8d5..39649ab 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/utils/ContextURLBuilder.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/utils/ContextURLBuilder.java @@ -6,9 +6,9 @@ * 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 @@ -31,17 +31,17 @@ import org.apache.olingo.commons.core.Encoder; */ public final class ContextURLBuilder { - private ContextURLBuilder() { /* private ctor for helper class */ } + private ContextURLBuilder() { /* private ctor for helper class */} public static URI create(final ContextURL contextURL) { StringBuilder result = new StringBuilder(); if (contextURL.getServiceRoot() != null) { result.append(contextURL.getServiceRoot()); - } else if(contextURL.getODataPath() != null) { + } else if (contextURL.getODataPath() != null) { String oDataPath = contextURL.getODataPath(); char[] chars = oDataPath.toCharArray(); - for (int i = 1; i < chars.length-1; i++) { - if(chars[i] == '/' && chars[i-1] != '/') { + for (int i = 1; i < chars.length - 1; i++) { + if (chars[i] == '/' && chars[i - 1] != '/') { result.append("../"); } } @@ -52,8 +52,8 @@ public final class ContextURLBuilder { result.append('#'); if (contextURL.isCollection()) { result.append("Collection(") - .append(Encoder.encode(contextURL.getEntitySetOrSingletonOrType())) - .append(")"); + .append(Encoder.encode(contextURL.getEntitySetOrSingletonOrType())) + .append(")"); } else { result.append(Encoder.encode(contextURL.getEntitySetOrSingletonOrType())); } @@ -79,9 +79,9 @@ public final class ContextURLBuilder { } if (contextURL.isCollection()) { result.append('#') - .append("Collection(") - .append(ContextURL.Suffix.REFERENCE.getRepresentation()) - .append(")"); + .append("Collection(") + .append(ContextURL.Suffix.REFERENCE.getRepresentation()) + .append(")"); } else { result.append('#').append(ContextURL.Suffix.REFERENCE.getRepresentation()); } http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/utils/ContextURLHelper.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/utils/ContextURLHelper.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/utils/ContextURLHelper.java index 22a2301..129f242 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/utils/ContextURLHelper.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/utils/ContextURLHelper.java @@ -6,9 +6,9 @@ * 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 @@ -38,7 +38,7 @@ import org.apache.olingo.server.api.uri.queryoption.SelectOption; public final class ContextURLHelper { - private ContextURLHelper() { /* private ctor for helper class */ } + private ContextURLHelper() { /* private ctor for helper class */} /** * Builds a list of selected Properties for the ContextURL, @@ -123,12 +123,12 @@ public final class ContextURLHelper { } } else { final List<UriResource> resourceParts = expandItem.getResourcePath().getUriResourceParts(); - if(resourceParts.size() > 1) { + if (resourceParts.size() > 1) { if (result.length() > 0) { result.append(','); - } + } final List<String> path = getPropertyPath(resourceParts); - String propertyPath = buildPropertyPath(path); + String propertyPath = buildPropertyPath(path); result.append(Encoder.encode(propertyName)); result.append("/").append(propertyPath); } @@ -152,8 +152,9 @@ public final class ContextURLHelper { for (final String segment : path) { result.append(result.length() == 0 ? "" : '/').append(Encoder.encode(segment)); //$NON-NLS-1$ } - return result.length() == 0?null:result.toString(); - } + return result.length() == 0 ? null : result.toString(); + } + private static List<List<String>> getComplexSelectedPaths(final EdmProperty edmProperty, final Set<List<String>> selectedPaths) { List<List<String>> result = new ArrayList<List<String>>(); http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/utils/ExpandSelectHelper.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/utils/ExpandSelectHelper.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/utils/ExpandSelectHelper.java index 30810f0..13e158f 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/utils/ExpandSelectHelper.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/utils/ExpandSelectHelper.java @@ -6,9 +6,9 @@ * 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 http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/xml/MetadataDocumentXmlSerializer.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/xml/MetadataDocumentXmlSerializer.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/xml/MetadataDocumentXmlSerializer.java index 4a3a6ef..a0fd021 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/xml/MetadataDocumentXmlSerializer.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/xml/MetadataDocumentXmlSerializer.java @@ -226,7 +226,7 @@ public class MetadataDocumentXmlSerializer { writer.writeEndElement(); } - private void appendTerms(XMLStreamWriter writer, List<EdmTerm> terms) throws XMLStreamException { + private void appendTerms(final XMLStreamWriter writer, final List<EdmTerm> terms) throws XMLStreamException { for (EdmTerm term : terms) { writer.writeStartElement(XML_TERM_ATT); @@ -238,15 +238,15 @@ public class MetadataDocumentXmlSerializer { writer.writeAttribute(XML_BASE_TERM, getAliasedFullQualifiedName(term.getBaseTerm().getFullQualifiedName(), false)); } - - if(term.getAppliesTo() != null && !term.getAppliesTo().isEmpty()){ + + if (term.getAppliesTo() != null && !term.getAppliesTo().isEmpty()) { String appliesToString = ""; boolean first = true; - for(TargetType target : term.getAppliesTo()){ - if(first){ + for (TargetType target : term.getAppliesTo()) { + if (first) { first = false; appliesToString = target.toString(); - }else{ + } else { appliesToString = appliesToString + " " + target.toString(); } } @@ -273,20 +273,20 @@ public class MetadataDocumentXmlSerializer { if (term.getScale() != null) { writer.writeAttribute(XML_SCALE, "" + term.getScale()); } - + appendAnnotations(writer, term); writer.writeEndElement(); } } - private void appendAnnotationGroups(XMLStreamWriter writer, List<EdmAnnotations> annotationGroups) + private void appendAnnotationGroups(final XMLStreamWriter writer, final List<EdmAnnotations> annotationGroups) throws XMLStreamException { for (EdmAnnotations annotationGroup : annotationGroups) { appendAnnotationGroup(writer, annotationGroup); } } - private void appendAnnotationGroup(XMLStreamWriter writer, EdmAnnotations annotationGroup) + private void appendAnnotationGroup(final XMLStreamWriter writer, final EdmAnnotations annotationGroup) throws XMLStreamException { writer.writeStartElement(XML_ANNOTATIONS); writer.writeAttribute(XML_TARGET, annotationGroup.getTargetPath()); @@ -297,7 +297,8 @@ public class MetadataDocumentXmlSerializer { writer.writeEndElement(); } - private void appendAnnotations(XMLStreamWriter writer, EdmAnnotatable annotatable) throws XMLStreamException { + private void appendAnnotations(final XMLStreamWriter writer, final EdmAnnotatable annotatable) + throws XMLStreamException { List<EdmAnnotation> annotations = annotatable.getAnnotations(); if (annotations != null && !annotations.isEmpty()) { for (EdmAnnotation annotation : annotations) { @@ -316,7 +317,8 @@ public class MetadataDocumentXmlSerializer { } } - private void appendExpression(XMLStreamWriter writer, EdmExpression expression) throws XMLStreamException { + private void appendExpression(final XMLStreamWriter writer, + final EdmExpression expression) throws XMLStreamException { if (expression == null) { return; } @@ -329,7 +331,8 @@ public class MetadataDocumentXmlSerializer { } } - private void appendDynamicExpression(XMLStreamWriter writer, EdmDynamicExpression dynExp) throws XMLStreamException { + private void appendDynamicExpression(final XMLStreamWriter writer, final EdmDynamicExpression dynExp) + throws XMLStreamException { writer.writeStartElement(dynExp.getExpressionName()); switch (dynExp.getExpressionType()) { // Logical @@ -469,19 +472,20 @@ public class MetadataDocumentXmlSerializer { writer.writeEndElement(); } - private void appendNotExpression(XMLStreamWriter writer, EdmNot exp) throws XMLStreamException { + private void appendNotExpression(final XMLStreamWriter writer, final EdmNot exp) throws XMLStreamException { appendExpression(writer, exp.getLeftExpression()); appendAnnotations(writer, exp); } - private void appendLogicalOrComparisonExpression(XMLStreamWriter writer, EdmLogicalOrComparisonExpression exp) + private void appendLogicalOrComparisonExpression(final XMLStreamWriter writer, + final EdmLogicalOrComparisonExpression exp) throws XMLStreamException { appendExpression(writer, exp.getLeftExpression()); appendExpression(writer, exp.getRightExpression()); appendAnnotations(writer, exp); } - private void appendConstantExpression(XMLStreamWriter writer, EdmConstantExpression constExp) + private void appendConstantExpression(final XMLStreamWriter writer, final EdmConstantExpression constExp) throws XMLStreamException { writer.writeStartElement(constExp.getExpressionName()); writer.writeCharacters(constExp.getValueAsString()); @@ -928,12 +932,12 @@ public class MetadataDocumentXmlSerializer { for (String memberName : enumType.getMemberNames()) { writer.writeEmptyElement(XML_MEMBER); writer.writeAttribute(XML_NAME, memberName); - + EdmMember member = enumType.getMember(memberName); if (member.getValue() != null) { writer.writeAttribute(XML_VALUE, member.getValue()); } - + appendAnnotations(writer, member); } http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/xml/ODataXmlSerializer.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/xml/ODataXmlSerializer.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/xml/ODataXmlSerializer.java index 2af8ede..52d12e4 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/xml/ODataXmlSerializer.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/xml/ODataXmlSerializer.java @@ -187,7 +187,8 @@ public class ODataXmlSerializer extends AbstractODataSerializer { } } - private void writeErrorDetails(String code, String message, String target, XMLStreamWriter writer) + private void writeErrorDetails(final String code, final String message, final String target, + final XMLStreamWriter writer) throws XMLStreamException { if (code != null) { writer.writeStartElement(Constants.ERROR_CODE); @@ -323,7 +324,7 @@ public class ODataXmlSerializer extends AbstractODataSerializer { return contextURL; } - private void writeMetadataETag(final ServiceMetadata metadata, XMLStreamWriter writer) + private void writeMetadataETag(final ServiceMetadata metadata, final XMLStreamWriter writer) throws XMLStreamException { if (metadata != null && metadata.getServiceMetadataETagSupport() != null @@ -344,7 +345,7 @@ public class ODataXmlSerializer extends AbstractODataSerializer { protected void writeEntity(final ServiceMetadata metadata, final EdmEntityType entityType, final Entity entity, final ContextURL contextURL, final ExpandOption expand, final SelectOption select, final XMLStreamWriter writer, final boolean top) - throws XMLStreamException, SerializerException { + throws XMLStreamException, SerializerException { writer.writeStartElement(ATOM, Constants.ATOM_ELEM_ENTRY, NS_ATOM); if (top) { @@ -622,17 +623,18 @@ public class ODataXmlSerializer extends AbstractODataSerializer { writer.writeEndElement(); } - private String collectionType(EdmType type) { + private String collectionType(final EdmType type) { return "#Collection(" + type.getFullQualifiedName().getFullQualifiedNameAsString() + ")"; } - private String complexType(ServiceMetadata metadata, EdmComplexType baseType, String definedType) + private String complexType(final ServiceMetadata metadata, final EdmComplexType baseType, final String definedType) throws SerializerException { EdmComplexType type = resolveComplexType(metadata, baseType, definedType); return type.getFullQualifiedName().getFullQualifiedNameAsString(); } - private String derivedComplexType(EdmComplexType baseType, String definedType) throws SerializerException { + private String derivedComplexType(final EdmComplexType baseType, + final String definedType) throws SerializerException { String derived = baseType.getFullQualifiedName().getFullQualifiedNameAsString(); if (derived.equals(definedType)) { return null; @@ -987,7 +989,7 @@ public class ODataXmlSerializer extends AbstractODataSerializer { return entityReference(entity, options); } - protected SerializerResult entityReference(final Entity entity, ReferenceSerializerOptions options) + protected SerializerResult entityReference(final Entity entity, final ReferenceSerializerOptions options) throws SerializerException { OutputStream outputStream = null; SerializerException cachedException = null; @@ -1016,7 +1018,8 @@ public class ODataXmlSerializer extends AbstractODataSerializer { } } - private void writeReference(Entity entity, ContextURL contextURL, XMLStreamWriter writer, boolean top) + private void writeReference(final Entity entity, final ContextURL contextURL, final XMLStreamWriter writer, + final boolean top) throws XMLStreamException { writer.writeStartElement(METADATA, "ref", NS_METADATA); if (top) { @@ -1032,13 +1035,13 @@ public class ODataXmlSerializer extends AbstractODataSerializer { @Override public SerializerResult referenceCollection(final ServiceMetadata metadata, final EdmEntitySet edmEntitySet, - final EntityCollection entityCollection, ReferenceCollectionSerializerOptions options) + final EntityCollection entityCollection, final ReferenceCollectionSerializerOptions options) throws SerializerException { return entityReferenceCollection(entityCollection, options); } protected SerializerResult entityReferenceCollection(final EntityCollection entitySet, - ReferenceCollectionSerializerOptions options) throws SerializerException { + final ReferenceCollectionSerializerOptions options) throws SerializerException { OutputStream outputStream = null; SerializerException cachedException = null; try { @@ -1083,14 +1086,14 @@ public class ODataXmlSerializer extends AbstractODataSerializer { } } - private void writeCount(final EntityCollection entitySet, XMLStreamWriter writer) + private void writeCount(final EntityCollection entitySet, final XMLStreamWriter writer) throws XMLStreamException { writer.writeStartElement(METADATA, Constants.ATOM_ELEM_COUNT, NS_METADATA); writer.writeCharacters(String.valueOf(entitySet.getCount())); writer.writeEndElement(); } - private void writeNextLink(final EntityCollection entitySet, XMLStreamWriter writer) + private void writeNextLink(final EntityCollection entitySet, final XMLStreamWriter writer) throws XMLStreamException { writer.writeStartElement(ATOM, Constants.ATOM_ELEM_LINK, NS_ATOM); writer.writeAttribute(Constants.ATTR_REL, Constants.NEXT_LINK_REL); http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/xml/ServiceDocumentXmlSerializer.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/xml/ServiceDocumentXmlSerializer.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/xml/ServiceDocumentXmlSerializer.java index 19d132b..8351945 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/xml/ServiceDocumentXmlSerializer.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/xml/ServiceDocumentXmlSerializer.java @@ -6,9 +6,9 @@ * 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 @@ -55,7 +55,7 @@ public class ServiceDocumentXmlSerializer { public void writeServiceDocument(final XMLStreamWriter writer) throws XMLStreamException { final String metadataUri = (serviceRoot == null ? "" : serviceRoot.endsWith("/") ? serviceRoot : (serviceRoot + "/")) - + Constants.METADATA; + + Constants.METADATA; writer.writeStartDocument(ODataSerializer.DEFAULT_CHARSET, "1.0"); writer.writeStartElement(APP, "service", NS_APP); @@ -86,7 +86,7 @@ public class ServiceDocumentXmlSerializer { writer.writeEndElement(); // end service } - private void writeServiceDocuments(XMLStreamWriter writer) throws XMLStreamException { + private void writeServiceDocuments(final XMLStreamWriter writer) throws XMLStreamException { for (EdmxReference reference : metadata.getReferences()) { final String referenceString = reference.getUri().toASCIIString(); writeElement(writer, false, "service-document", referenceString, referenceString); @@ -118,7 +118,7 @@ public class ServiceDocumentXmlSerializer { } } - private void writeElement(XMLStreamWriter writer, final boolean isApp, final String kind, final String name, + private void writeElement(final XMLStreamWriter writer, final boolean isApp, final String kind, final String name, final String title) throws XMLStreamException { if (isApp) { writer.writeStartElement(APP, kind, NS_APP); @@ -126,7 +126,7 @@ public class ServiceDocumentXmlSerializer { writer.writeStartElement(METADATA, kind, NS_METADATA); } writer.writeAttribute(Constants.ATTR_HREF, name); - writer.writeAttribute(METADATA, NS_METADATA, Constants.ATTR_NAME , name); + writer.writeAttribute(METADATA, NS_METADATA, Constants.ATTR_NAME, name); writer.writeStartElement(ATOM, Constants.ATOM_ELEM_TITLE, NS_ATOM); if (title != null) { writer.writeCharacters(title); http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriHelperImpl.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriHelperImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriHelperImpl.java index c463765..f1bd75e 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriHelperImpl.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriHelperImpl.java @@ -6,9 +6,9 @@ * 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 @@ -97,7 +97,7 @@ public class UriHelperImpl implements UriHelper { } @Override - public UriResourceEntitySet parseEntityId(Edm edm, String entityId, String rawServiceRoot) + public UriResourceEntitySet parseEntityId(final Edm edm, final String entityId, final String rawServiceRoot) throws DeserializerException { String oDataPath = entityId; @@ -111,7 +111,7 @@ public class UriHelperImpl implements UriHelper { .getUriResourceParts(); if (uriResourceParts.size() == 1 && uriResourceParts.get(0).getKind() == UriResourceKind.entitySet) { final UriResourceEntitySet entityUriResource = (UriResourceEntitySet) uriResourceParts.get(0); - + return entityUriResource; } http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriInfoImpl.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriInfoImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriInfoImpl.java index bc396f7..e6fe057 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriInfoImpl.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriInfoImpl.java @@ -6,9 +6,9 @@ * 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 http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriParameterImpl.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriParameterImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriParameterImpl.java index b650cc5..7ab2abe 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriParameterImpl.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriParameterImpl.java @@ -6,9 +6,9 @@ * 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 http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceActionImpl.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceActionImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceActionImpl.java index 4126110..d7f02ae 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceActionImpl.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceActionImpl.java @@ -6,9 +6,9 @@ * 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 @@ -26,8 +26,8 @@ import org.apache.olingo.server.api.uri.UriResourceKind; /** * Implementation of the {@link UriResourceAction} interface. This class does not extend - * {@link org.apache.olingo.server.core.uri.UriResourceTypedImpl UriResourceTypedImpl} - * since that would allow type filters and subsequent path segments. + * {@link org.apache.olingo.server.core.uri.UriResourceTypedImpl UriResourceTypedImpl} since that would allow type + * filters and subsequent path segments. */ public class UriResourceActionImpl extends UriResourceImpl implements UriResourceAction { @@ -74,7 +74,7 @@ public class UriResourceActionImpl extends UriResourceImpl implements UriResourc } return null; } - + @Override public String getSegmentValue(final boolean includeFilters) { return actionImport == null ? (action == null ? "" : action.getName()) : actionImport.getName(); @@ -84,7 +84,7 @@ public class UriResourceActionImpl extends UriResourceImpl implements UriResourc public String getSegmentValue() { return getSegmentValue(false); } - + @Override public String toString(final boolean includeFilters) { return getSegmentValue(includeFilters); http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceComplexPropertyImpl.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceComplexPropertyImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceComplexPropertyImpl.java index 63db69c..8e78b16 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceComplexPropertyImpl.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceComplexPropertyImpl.java @@ -6,9 +6,9 @@ * 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 @@ -63,10 +63,10 @@ public class UriResourceComplexPropertyImpl extends UriResourceTypedImpl impleme } @Override - public String getSegmentValue(){ + public String getSegmentValue() { return property.getName(); } - + @Override public String toString() { return getSegmentValue(); http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceCountImpl.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceCountImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceCountImpl.java index e1859a6..59cd677 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceCountImpl.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceCountImpl.java @@ -6,9 +6,9 @@ * 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 @@ -26,9 +26,9 @@ public class UriResourceCountImpl extends UriResourceImpl implements UriResource public UriResourceCountImpl() { super(UriResourceKind.count); } - + @Override - public String getSegmentValue(){ + public String getSegmentValue() { return "$count"; } http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceEntitySetImpl.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceEntitySetImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceEntitySetImpl.java index 4675964..888a34b 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceEntitySetImpl.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceEntitySetImpl.java @@ -6,9 +6,9 @@ * 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 @@ -55,12 +55,11 @@ public class UriResourceEntitySetImpl extends UriResourceWithKeysImpl implements public boolean isCollection() { return keyPredicates == null; } - + @Override - public String getSegmentValue(){ + public String getSegmentValue() { return edmEntitySet.getName(); } - @Override public String toString() { http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceFunctionImpl.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceFunctionImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceFunctionImpl.java index a47a6ab..42361e0 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceFunctionImpl.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceFunctionImpl.java @@ -6,9 +6,9 @@ * 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 @@ -46,7 +46,7 @@ public class UriResourceFunctionImpl extends UriResourceWithKeysImpl implements public List<UriParameter> getParameters() { return parameters == null ? Collections.<UriParameter> emptyList() : - Collections.unmodifiableList(parameters); + Collections.unmodifiableList(parameters); } public UriResourceFunctionImpl setParameters(final List<UriParameter> parameters) { http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceImpl.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceImpl.java index 9fbcbd0..46c1c00 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceImpl.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceImpl.java @@ -6,9 +6,9 @@ * 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 http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceItImpl.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceItImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceItImpl.java index fc31910..461c59b 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceItImpl.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceItImpl.java @@ -6,9 +6,9 @@ * 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 @@ -56,9 +56,9 @@ public class UriResourceItImpl extends UriResourceWithKeysImpl implements UriRes this.isCollection = isCollection; return this; } - + @Override - public String getSegmentValue(){ + public String getSegmentValue() { return "$it"; } http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceLambdaAllImpl.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceLambdaAllImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceLambdaAllImpl.java index b57d12c..89674f9 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceLambdaAllImpl.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceLambdaAllImpl.java @@ -6,9 +6,9 @@ * 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 @@ -68,9 +68,9 @@ public class UriResourceLambdaAllImpl extends UriResourceTypedImpl implements Ur this.expression = expression; return this; } - + @Override - public String getSegmentValue(){ + public String getSegmentValue() { return "all"; } http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceLambdaAnyImpl.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceLambdaAnyImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceLambdaAnyImpl.java index 49be2fe..6cad648 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceLambdaAnyImpl.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceLambdaAnyImpl.java @@ -6,9 +6,9 @@ * 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 @@ -68,9 +68,9 @@ public class UriResourceLambdaAnyImpl extends UriResourceTypedImpl implements Ur this.expression = expression; return this; } - + @Override - public String getSegmentValue(){ + public String getSegmentValue() { return "any"; } http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceLambdaVarImpl.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceLambdaVarImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceLambdaVarImpl.java index f7fa6fc..90b29ca 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceLambdaVarImpl.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceLambdaVarImpl.java @@ -6,9 +6,9 @@ * 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 @@ -64,10 +64,10 @@ public class UriResourceLambdaVarImpl extends UriResourceTypedImpl implements Ur } @Override - public String getSegmentValue(){ + public String getSegmentValue() { return variableText; } - + @Override public String toString() { return getSegmentValue(); http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceNavigationPropertyImpl.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceNavigationPropertyImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceNavigationPropertyImpl.java index 1a4fa44..0a6319c 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceNavigationPropertyImpl.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceNavigationPropertyImpl.java @@ -6,9 +6,9 @@ * 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 @@ -54,9 +54,9 @@ public class UriResourceNavigationPropertyImpl extends UriResourceWithKeysImpl i } return navigationProperty.isCollection(); } - + @Override - public String getSegmentValue(){ + public String getSegmentValue() { return navigationProperty.getName(); } http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourcePrimitivePropertyImpl.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourcePrimitivePropertyImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourcePrimitivePropertyImpl.java index d470ef4..a666c18 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourcePrimitivePropertyImpl.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourcePrimitivePropertyImpl.java @@ -6,9 +6,9 @@ * 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 @@ -50,10 +50,10 @@ public class UriResourcePrimitivePropertyImpl extends UriResourceTypedImpl imple public boolean isCollection() { return property.isCollection(); } - + @Override - public String getSegmentValue(){ - return property.getName(); + public String getSegmentValue() { + return property.getName(); } @Override http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceRefImpl.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceRefImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceRefImpl.java index 0c45f9a..850b940 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceRefImpl.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceRefImpl.java @@ -6,9 +6,9 @@ * 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 @@ -27,8 +27,9 @@ public class UriResourceRefImpl extends UriResourceImpl implements UriResourceRe super(UriResourceKind.ref); } + @Override - public String getSegmentValue(){ + public String getSegmentValue() { return "$ref"; } http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceRootImpl.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceRootImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceRootImpl.java index 5d8737f..906f07b 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceRootImpl.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceRootImpl.java @@ -6,9 +6,9 @@ * 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 @@ -53,9 +53,9 @@ public class UriResourceRootImpl extends UriResourceWithKeysImpl implements UriR this.isCollection = isCollection; return this; } - + @Override - public String getSegmentValue(){ + public String getSegmentValue() { return "$root"; } http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceSingletonImpl.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceSingletonImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceSingletonImpl.java index 72289f6..30e29c7 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceSingletonImpl.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceSingletonImpl.java @@ -6,9 +6,9 @@ * 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 @@ -62,9 +62,9 @@ public class UriResourceSingletonImpl extends UriResourceTypedImpl implements Ur public boolean isCollection() { return false; } - + @Override - public String getSegmentValue(){ + public String getSegmentValue() { return singleton.getName(); } http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceStartingTypeFilterImpl.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceStartingTypeFilterImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceStartingTypeFilterImpl.java index 24d3713..a42cf8f 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceStartingTypeFilterImpl.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceStartingTypeFilterImpl.java @@ -6,9 +6,9 @@ * 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 @@ -59,10 +59,10 @@ public class UriResourceStartingTypeFilterImpl extends UriResourceWithKeysImpl { } @Override - public String getSegmentValue(){ + public String getSegmentValue() { return type.getNamespace() + "." + type.getName(); } - + @Override public String toString() { return getSegmentValue(); http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceTypedImpl.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceTypedImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceTypedImpl.java index d6710ad..cdfa013 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceTypedImpl.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceTypedImpl.java @@ -6,9 +6,9 @@ * 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 @@ -40,6 +40,7 @@ public abstract class UriResourceTypedImpl extends UriResourceImpl implements Ur return this; } + @Override public String getSegmentValue(final boolean includeFilters) { if (includeFilters) { if (typeFilter != null) { http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceValueImpl.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceValueImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceValueImpl.java index 73f86c4..2cc89cb 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceValueImpl.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceValueImpl.java @@ -6,9 +6,9 @@ * 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 @@ -29,7 +29,7 @@ public class UriResourceValueImpl extends UriResourceImpl implements UriResource } @Override - public String getSegmentValue(){ + public String getSegmentValue() { return "$value"; } http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceWithKeysImpl.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceWithKeysImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceWithKeysImpl.java index 54d62a1..83ec32d 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceWithKeysImpl.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/UriResourceWithKeysImpl.java @@ -6,9 +6,9 @@ * 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 @@ -48,7 +48,7 @@ public abstract class UriResourceWithKeysImpl extends UriResourceImpl implements public List<UriParameter> getKeyPredicates() { return keyPredicates == null ? Collections.<UriParameter> emptyList() : - new ArrayList<UriParameter>(keyPredicates); + new ArrayList<UriParameter>(keyPredicates); } public UriResourceWithKeysImpl setKeyPredicates(final List<UriParameter> list) { http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/CheckFullContextListener.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/CheckFullContextListener.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/CheckFullContextListener.java index 86efdca..bdfdf4c 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/CheckFullContextListener.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/CheckFullContextListener.java @@ -6,9 +6,9 @@ * 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 http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/Parser.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/Parser.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/Parser.java index d12b853..fc806ee 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/Parser.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/Parser.java @@ -6,9 +6,9 @@ * 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 @@ -285,9 +285,9 @@ public class Parser { final Expression expression = ((FilterOption) uriParseTreeVisitor.visitFilterExpressionEOF(filterExpCtx)) .getExpression(); context.contextUriInfo.addAlias((AliasQueryOption) new AliasQueryOptionImpl() - .setAliasValue(expression) - .setName(option.name) - .setText(NULL.equals(option.value) ? null : option.value)); + .setAliasValue(expression) + .setName(option.name) + .setText(NULL.equals(option.value) ? null : option.value)); } else { throw new UriParserSyntaxException("Alias already specified! Name: " + option.name, UriParserSyntaxException.MessageKeys.DUPLICATED_ALIAS, option.name); @@ -295,8 +295,8 @@ public class Parser { } else { context.contextUriInfo.addCustomQueryOption((CustomQueryOption) new CustomQueryOptionImpl() - .setName(option.name) - .setText(option.value)); + .setName(option.name) + .setText(option.value)); } } @@ -304,7 +304,7 @@ public class Parser { } catch (ParseCancellationException e) { throw e.getCause() instanceof UriParserException ? (UriParserException) e.getCause() : - new UriParserSyntaxException("Syntax error", e, UriParserSyntaxException.MessageKeys.SYNTAX); + new UriParserSyntaxException("Syntax error", e, UriParserSyntaxException.MessageKeys.SYNTAX); } } @@ -335,7 +335,7 @@ public class Parser { // create parser if (logLevel > 0) { - //TODO: Discuss if we should keep this code + // TODO: Discuss if we should keep this code lexer = new UriLexer(new ANTLRInputStream(input)); showTokens(input, lexer.getAllTokens()); } http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/371bf9a5/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/RawUri.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/RawUri.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/RawUri.java index 42e0a0f..231317f 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/RawUri.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/RawUri.java @@ -6,9 +6,9 @@ * 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
