repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
partition
stringclasses
1 value
sdl/odata
odata_renderer/src/main/java/com/sdl/odata/renderer/atom/writer/AtomDataWriter.java
AtomDataWriter.marshallPrimitive
private void marshallPrimitive(Object value, PrimitiveType primitiveType) throws XMLStreamException { LOG.trace("Primitive value: {} of type: {}", value, primitiveType); if (value != null) { xmlWriter.writeCharacters(value.toString()); } }
java
private void marshallPrimitive(Object value, PrimitiveType primitiveType) throws XMLStreamException { LOG.trace("Primitive value: {} of type: {}", value, primitiveType); if (value != null) { xmlWriter.writeCharacters(value.toString()); } }
[ "private", "void", "marshallPrimitive", "(", "Object", "value", ",", "PrimitiveType", "primitiveType", ")", "throws", "XMLStreamException", "{", "LOG", ".", "trace", "(", "\"Primitive value: {} of type: {}\"", ",", "value", ",", "primitiveType", ")", ";", "if", "(",...
Marshall a primitive value. @param value The value to marshall. Can be {@code null}. @param primitiveType The OData primitive type.
[ "Marshall", "a", "primitive", "value", "." ]
eb747d73e9af0f4e59a25b82ed656e526a7e2189
https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_renderer/src/main/java/com/sdl/odata/renderer/atom/writer/AtomDataWriter.java#L143-L149
train
sdl/odata
odata_renderer/src/main/java/com/sdl/odata/renderer/metadata/MetadataDocumentWriter.java
MetadataDocumentWriter.endDocument
public void endDocument() throws ODataRenderException { try { xmlWriter.writeEndDocument(); xmlWriter.flush(); } catch (XMLStreamException e) { LOG.error("Not possible to end stream XML"); throw new ODataRenderException("Not possible to end stream XML: ",...
java
public void endDocument() throws ODataRenderException { try { xmlWriter.writeEndDocument(); xmlWriter.flush(); } catch (XMLStreamException e) { LOG.error("Not possible to end stream XML"); throw new ODataRenderException("Not possible to end stream XML: ",...
[ "public", "void", "endDocument", "(", ")", "throws", "ODataRenderException", "{", "try", "{", "xmlWriter", ".", "writeEndDocument", "(", ")", ";", "xmlWriter", ".", "flush", "(", ")", ";", "}", "catch", "(", "XMLStreamException", "e", ")", "{", "LOG", ".",...
End the XML stream document. @throws ODataRenderException if unable to render
[ "End", "the", "XML", "stream", "document", "." ]
eb747d73e9af0f4e59a25b82ed656e526a7e2189
https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_renderer/src/main/java/com/sdl/odata/renderer/metadata/MetadataDocumentWriter.java#L106-L115
train
sdl/odata
odata_renderer/src/main/java/com/sdl/odata/renderer/metadata/MetadataDocumentWriter.java
MetadataDocumentWriter.writeMetadataDocument
public void writeMetadataDocument() throws ODataRenderException { try { xmlWriter.writeStartElement(EDMX_NS, EDMX); xmlWriter.writeNamespace(EDMX_PREFIX, EDMX_NS); xmlWriter.writeAttribute(VERSION, ODATA_VERSION); xmlWriter.writeStartElement(EDMX_NS, EDMX_DATA_SE...
java
public void writeMetadataDocument() throws ODataRenderException { try { xmlWriter.writeStartElement(EDMX_NS, EDMX); xmlWriter.writeNamespace(EDMX_PREFIX, EDMX_NS); xmlWriter.writeAttribute(VERSION, ODATA_VERSION); xmlWriter.writeStartElement(EDMX_NS, EDMX_DATA_SE...
[ "public", "void", "writeMetadataDocument", "(", ")", "throws", "ODataRenderException", "{", "try", "{", "xmlWriter", ".", "writeStartElement", "(", "EDMX_NS", ",", "EDMX", ")", ";", "xmlWriter", ".", "writeNamespace", "(", "EDMX_PREFIX", ",", "EDMX_NS", ")", ";"...
Write the 'Metadata Document'. @throws ODataRenderException if unable to render metadata document
[ "Write", "the", "Metadata", "Document", "." ]
eb747d73e9af0f4e59a25b82ed656e526a7e2189
https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_renderer/src/main/java/com/sdl/odata/renderer/metadata/MetadataDocumentWriter.java#L122-L166
train
sdl/odata
odata_api/src/main/java/com/sdl/odata/util/edm/EntityDataModelUtil.java
EntityDataModelUtil.getAndCheckType
public static Type getAndCheckType(EntityDataModel entityDataModel, Class<?> javaType) { Type type = entityDataModel.getType(javaType); if (type == null) { throw new ODataSystemException("No type found in the entity data model for Java type: " + javaType.getName()); ...
java
public static Type getAndCheckType(EntityDataModel entityDataModel, Class<?> javaType) { Type type = entityDataModel.getType(javaType); if (type == null) { throw new ODataSystemException("No type found in the entity data model for Java type: " + javaType.getName()); ...
[ "public", "static", "Type", "getAndCheckType", "(", "EntityDataModel", "entityDataModel", ",", "Class", "<", "?", ">", "javaType", ")", "{", "Type", "type", "=", "entityDataModel", ".", "getType", "(", "javaType", ")", ";", "if", "(", "type", "==", "null", ...
Gets the OData type for a Java type and throws an exception if there is no OData type for the Java type. @param entityDataModel The entity data model. @param javaType The Java type. @return The OData type for the Java type. @throws ODataSystemException If there is no OData type for the specified Java type.
[ "Gets", "the", "OData", "type", "for", "a", "Java", "type", "and", "throws", "an", "exception", "if", "there", "is", "no", "OData", "type", "for", "the", "Java", "type", "." ]
eb747d73e9af0f4e59a25b82ed656e526a7e2189
https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_api/src/main/java/com/sdl/odata/util/edm/EntityDataModelUtil.java#L85-L92
train
sdl/odata
odata_api/src/main/java/com/sdl/odata/util/edm/EntityDataModelUtil.java
EntityDataModelUtil.checkIsPrimitiveType
public static PrimitiveType checkIsPrimitiveType(Type type) { if (!isPrimitiveType(type)) { throw new ODataSystemException("A primitive type is required, but '" + type.getFullyQualifiedName() + "' is not a primitive type: " + type.getMetaType()); } return (Primiti...
java
public static PrimitiveType checkIsPrimitiveType(Type type) { if (!isPrimitiveType(type)) { throw new ODataSystemException("A primitive type is required, but '" + type.getFullyQualifiedName() + "' is not a primitive type: " + type.getMetaType()); } return (Primiti...
[ "public", "static", "PrimitiveType", "checkIsPrimitiveType", "(", "Type", "type", ")", "{", "if", "(", "!", "isPrimitiveType", "(", "type", ")", ")", "{", "throw", "new", "ODataSystemException", "(", "\"A primitive type is required, but '\"", "+", "type", ".", "ge...
Checks if the specified OData type is a primitive type and throws an exception if it is not. @param type The OData type. @return The OData type. @throws ODataSystemException If the OData type is not a primitive type.
[ "Checks", "if", "the", "specified", "OData", "type", "is", "a", "primitive", "type", "and", "throws", "an", "exception", "if", "it", "is", "not", "." ]
eb747d73e9af0f4e59a25b82ed656e526a7e2189
https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_api/src/main/java/com/sdl/odata/util/edm/EntityDataModelUtil.java#L111-L117
train
sdl/odata
odata_api/src/main/java/com/sdl/odata/util/edm/EntityDataModelUtil.java
EntityDataModelUtil.getAndCheckPrimitiveType
public static PrimitiveType getAndCheckPrimitiveType(EntityDataModel entityDataModel, String typeName) { return checkIsPrimitiveType(getAndCheckType(entityDataModel, typeName)); }
java
public static PrimitiveType getAndCheckPrimitiveType(EntityDataModel entityDataModel, String typeName) { return checkIsPrimitiveType(getAndCheckType(entityDataModel, typeName)); }
[ "public", "static", "PrimitiveType", "getAndCheckPrimitiveType", "(", "EntityDataModel", "entityDataModel", ",", "String", "typeName", ")", "{", "return", "checkIsPrimitiveType", "(", "getAndCheckType", "(", "entityDataModel", ",", "typeName", ")", ")", ";", "}" ]
Gets the OData type with a specified name and checks if the OData type is a primitive type; throws an exception if the OData type is not a primitive type. @param entityDataModel The entity data model. @param typeName The type name. @return The OData primitive type with the specified name. @throws ODataSystemExc...
[ "Gets", "the", "OData", "type", "with", "a", "specified", "name", "and", "checks", "if", "the", "OData", "type", "is", "a", "primitive", "type", ";", "throws", "an", "exception", "if", "the", "OData", "type", "is", "not", "a", "primitive", "type", "." ]
eb747d73e9af0f4e59a25b82ed656e526a7e2189
https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_api/src/main/java/com/sdl/odata/util/edm/EntityDataModelUtil.java#L129-L131
train
sdl/odata
odata_api/src/main/java/com/sdl/odata/util/edm/EntityDataModelUtil.java
EntityDataModelUtil.checkIsStructuredType
public static StructuredType checkIsStructuredType(Type type) { if (!isStructuredType(type)) { throw new ODataSystemException("A structured type is required, but '" + type.getFullyQualifiedName() + "' is not a structured type: " + type.getMetaType()); } return (St...
java
public static StructuredType checkIsStructuredType(Type type) { if (!isStructuredType(type)) { throw new ODataSystemException("A structured type is required, but '" + type.getFullyQualifiedName() + "' is not a structured type: " + type.getMetaType()); } return (St...
[ "public", "static", "StructuredType", "checkIsStructuredType", "(", "Type", "type", ")", "{", "if", "(", "!", "isStructuredType", "(", "type", ")", ")", "{", "throw", "new", "ODataSystemException", "(", "\"A structured type is required, but '\"", "+", "type", ".", ...
Checks if the specified OData type is a structured type and throws an exception if it is not. @param type The OData type. @return The OData type. @throws ODataSystemException If the OData type is not a structured type.
[ "Checks", "if", "the", "specified", "OData", "type", "is", "a", "structured", "type", "and", "throws", "an", "exception", "if", "it", "is", "not", "." ]
eb747d73e9af0f4e59a25b82ed656e526a7e2189
https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_api/src/main/java/com/sdl/odata/util/edm/EntityDataModelUtil.java#L151-L157
train
sdl/odata
odata_api/src/main/java/com/sdl/odata/util/edm/EntityDataModelUtil.java
EntityDataModelUtil.getAndCheckStructuredType
public static StructuredType getAndCheckStructuredType(EntityDataModel entityDataModel, String typeName) { return checkIsStructuredType(getAndCheckType(entityDataModel, typeName)); }
java
public static StructuredType getAndCheckStructuredType(EntityDataModel entityDataModel, String typeName) { return checkIsStructuredType(getAndCheckType(entityDataModel, typeName)); }
[ "public", "static", "StructuredType", "getAndCheckStructuredType", "(", "EntityDataModel", "entityDataModel", ",", "String", "typeName", ")", "{", "return", "checkIsStructuredType", "(", "getAndCheckType", "(", "entityDataModel", ",", "typeName", ")", ")", ";", "}" ]
Gets the OData type with a specified name and checks if the OData type is a structured type; throws an exception if the OData type is not a structured type. @param entityDataModel The entity data model. @param typeName The type name. @return The OData structured type with the specified name. @throws ODataSystem...
[ "Gets", "the", "OData", "type", "with", "a", "specified", "name", "and", "checks", "if", "the", "OData", "type", "is", "a", "structured", "type", ";", "throws", "an", "exception", "if", "the", "OData", "type", "is", "not", "a", "structured", "type", "." ...
eb747d73e9af0f4e59a25b82ed656e526a7e2189
https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_api/src/main/java/com/sdl/odata/util/edm/EntityDataModelUtil.java#L169-L171
train
sdl/odata
odata_api/src/main/java/com/sdl/odata/util/edm/EntityDataModelUtil.java
EntityDataModelUtil.getAndCheckStructuredType
public static StructuredType getAndCheckStructuredType(EntityDataModel entityDataModel, Class<?> javaType) { return checkIsStructuredType(getAndCheckType(entityDataModel, javaType)); }
java
public static StructuredType getAndCheckStructuredType(EntityDataModel entityDataModel, Class<?> javaType) { return checkIsStructuredType(getAndCheckType(entityDataModel, javaType)); }
[ "public", "static", "StructuredType", "getAndCheckStructuredType", "(", "EntityDataModel", "entityDataModel", ",", "Class", "<", "?", ">", "javaType", ")", "{", "return", "checkIsStructuredType", "(", "getAndCheckType", "(", "entityDataModel", ",", "javaType", ")", ")...
Gets the OData type for a Java type and checks if the OData type is a structured type; throws an exception if the OData type is not a structured type. @param entityDataModel The entity data model. @param javaType The Java type. @return The OData structured type for the Java type. @throws ODataSystemException If...
[ "Gets", "the", "OData", "type", "for", "a", "Java", "type", "and", "checks", "if", "the", "OData", "type", "is", "a", "structured", "type", ";", "throws", "an", "exception", "if", "the", "OData", "type", "is", "not", "a", "structured", "type", "." ]
eb747d73e9af0f4e59a25b82ed656e526a7e2189
https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_api/src/main/java/com/sdl/odata/util/edm/EntityDataModelUtil.java#L183-L185
train
sdl/odata
odata_api/src/main/java/com/sdl/odata/util/edm/EntityDataModelUtil.java
EntityDataModelUtil.checkIsEntityType
public static EntityType checkIsEntityType(Type type) { if (!isEntityType(type)) { throw new ODataSystemException("An entity type is required, but '" + type.getFullyQualifiedName() + "' is not an entity type: " + type.getMetaType()); } return (EntityType) type; ...
java
public static EntityType checkIsEntityType(Type type) { if (!isEntityType(type)) { throw new ODataSystemException("An entity type is required, but '" + type.getFullyQualifiedName() + "' is not an entity type: " + type.getMetaType()); } return (EntityType) type; ...
[ "public", "static", "EntityType", "checkIsEntityType", "(", "Type", "type", ")", "{", "if", "(", "!", "isEntityType", "(", "type", ")", ")", "{", "throw", "new", "ODataSystemException", "(", "\"An entity type is required, but '\"", "+", "type", ".", "getFullyQuali...
Checks if the specified OData type is an entity type and throws an exception if it is not. @param type The OData type. @return The OData type. @throws ODataSystemException If the OData type is not an entity type.
[ "Checks", "if", "the", "specified", "OData", "type", "is", "an", "entity", "type", "and", "throws", "an", "exception", "if", "it", "is", "not", "." ]
eb747d73e9af0f4e59a25b82ed656e526a7e2189
https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_api/src/main/java/com/sdl/odata/util/edm/EntityDataModelUtil.java#L204-L210
train
sdl/odata
odata_api/src/main/java/com/sdl/odata/util/edm/EntityDataModelUtil.java
EntityDataModelUtil.getAndCheckEntityType
public static EntityType getAndCheckEntityType(EntityDataModel entityDataModel, String typeName) { return checkIsEntityType(getAndCheckType(entityDataModel, typeName)); }
java
public static EntityType getAndCheckEntityType(EntityDataModel entityDataModel, String typeName) { return checkIsEntityType(getAndCheckType(entityDataModel, typeName)); }
[ "public", "static", "EntityType", "getAndCheckEntityType", "(", "EntityDataModel", "entityDataModel", ",", "String", "typeName", ")", "{", "return", "checkIsEntityType", "(", "getAndCheckType", "(", "entityDataModel", ",", "typeName", ")", ")", ";", "}" ]
Gets the OData type with a specified name and checks if the OData type is an entity type; throws an exception if the OData type is not an entity type. @param entityDataModel The entity data model. @param typeName The type name. @return The OData entity type with the specified name. @throws ODataSystemException ...
[ "Gets", "the", "OData", "type", "with", "a", "specified", "name", "and", "checks", "if", "the", "OData", "type", "is", "an", "entity", "type", ";", "throws", "an", "exception", "if", "the", "OData", "type", "is", "not", "an", "entity", "type", "." ]
eb747d73e9af0f4e59a25b82ed656e526a7e2189
https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_api/src/main/java/com/sdl/odata/util/edm/EntityDataModelUtil.java#L222-L224
train
sdl/odata
odata_api/src/main/java/com/sdl/odata/util/edm/EntityDataModelUtil.java
EntityDataModelUtil.getAndCheckEntityType
public static EntityType getAndCheckEntityType(EntityDataModel entityDataModel, Class<?> javaType) { return checkIsEntityType(getAndCheckType(entityDataModel, javaType)); }
java
public static EntityType getAndCheckEntityType(EntityDataModel entityDataModel, Class<?> javaType) { return checkIsEntityType(getAndCheckType(entityDataModel, javaType)); }
[ "public", "static", "EntityType", "getAndCheckEntityType", "(", "EntityDataModel", "entityDataModel", ",", "Class", "<", "?", ">", "javaType", ")", "{", "return", "checkIsEntityType", "(", "getAndCheckType", "(", "entityDataModel", ",", "javaType", ")", ")", ";", ...
Gets the OData type for a Java type and checks if the OData type is an entity type; throws an exception if the OData type is not an entity type. @param entityDataModel The entity data model. @param javaType The Java type. @return The OData entity type for the Java type. @throws ODataSystemException If there is ...
[ "Gets", "the", "OData", "type", "for", "a", "Java", "type", "and", "checks", "if", "the", "OData", "type", "is", "an", "entity", "type", ";", "throws", "an", "exception", "if", "the", "OData", "type", "is", "not", "an", "entity", "type", "." ]
eb747d73e9af0f4e59a25b82ed656e526a7e2189
https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_api/src/main/java/com/sdl/odata/util/edm/EntityDataModelUtil.java#L236-L238
train
sdl/odata
odata_api/src/main/java/com/sdl/odata/util/edm/EntityDataModelUtil.java
EntityDataModelUtil.checkIsComplexType
public static ComplexType checkIsComplexType(Type type) { if (!isComplexType(type)) { throw new ODataSystemException("A complex type is required, but '" + type.getFullyQualifiedName() + "' is not a complex type: " + type.getMetaType()); } return (ComplexType) type...
java
public static ComplexType checkIsComplexType(Type type) { if (!isComplexType(type)) { throw new ODataSystemException("A complex type is required, but '" + type.getFullyQualifiedName() + "' is not a complex type: " + type.getMetaType()); } return (ComplexType) type...
[ "public", "static", "ComplexType", "checkIsComplexType", "(", "Type", "type", ")", "{", "if", "(", "!", "isComplexType", "(", "type", ")", ")", "{", "throw", "new", "ODataSystemException", "(", "\"A complex type is required, but '\"", "+", "type", ".", "getFullyQu...
Checks if the specified OData type is a complex type and throws an exception if it is not. @param type The OData type. @return The OData type. @throws ODataSystemException If the OData type is not a complex type.
[ "Checks", "if", "the", "specified", "OData", "type", "is", "a", "complex", "type", "and", "throws", "an", "exception", "if", "it", "is", "not", "." ]
eb747d73e9af0f4e59a25b82ed656e526a7e2189
https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_api/src/main/java/com/sdl/odata/util/edm/EntityDataModelUtil.java#L257-L263
train
sdl/odata
odata_api/src/main/java/com/sdl/odata/util/edm/EntityDataModelUtil.java
EntityDataModelUtil.getAndCheckComplexType
public static ComplexType getAndCheckComplexType(EntityDataModel entityDataModel, Class<?> javaType) { return checkIsComplexType(getAndCheckType(entityDataModel, javaType)); }
java
public static ComplexType getAndCheckComplexType(EntityDataModel entityDataModel, Class<?> javaType) { return checkIsComplexType(getAndCheckType(entityDataModel, javaType)); }
[ "public", "static", "ComplexType", "getAndCheckComplexType", "(", "EntityDataModel", "entityDataModel", ",", "Class", "<", "?", ">", "javaType", ")", "{", "return", "checkIsComplexType", "(", "getAndCheckType", "(", "entityDataModel", ",", "javaType", ")", ")", ";",...
Gets the OData type for a Java type and checks if the OData type is a complex type; throws an exception if the OData type is not a complex type. @param entityDataModel The entity data model. @param javaType The Java type. @return The OData complex type for the Java type. @throws ODataSystemException If there is...
[ "Gets", "the", "OData", "type", "for", "a", "Java", "type", "and", "checks", "if", "the", "OData", "type", "is", "a", "complex", "type", ";", "throws", "an", "exception", "if", "the", "OData", "type", "is", "not", "a", "complex", "type", "." ]
eb747d73e9af0f4e59a25b82ed656e526a7e2189
https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_api/src/main/java/com/sdl/odata/util/edm/EntityDataModelUtil.java#L275-L277
train
sdl/odata
odata_api/src/main/java/com/sdl/odata/util/edm/EntityDataModelUtil.java
EntityDataModelUtil.getPropertyTypeName
public static String getPropertyTypeName(StructuralProperty property) { return property.isCollection() ? property.getElementTypeName() : property.getTypeName(); }
java
public static String getPropertyTypeName(StructuralProperty property) { return property.isCollection() ? property.getElementTypeName() : property.getTypeName(); }
[ "public", "static", "String", "getPropertyTypeName", "(", "StructuralProperty", "property", ")", "{", "return", "property", ".", "isCollection", "(", ")", "?", "property", ".", "getElementTypeName", "(", ")", ":", "property", ".", "getTypeName", "(", ")", ";", ...
Gets the OData type name of the property; if the property is a collection, gets the OData type name of the elements of the collection. @param property The property. @return The OData type name of the property; if the property is a collection, the OData type name of the elements of the collection.
[ "Gets", "the", "OData", "type", "name", "of", "the", "property", ";", "if", "the", "property", "is", "a", "collection", "gets", "the", "OData", "type", "name", "of", "the", "elements", "of", "the", "collection", "." ]
eb747d73e9af0f4e59a25b82ed656e526a7e2189
https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_api/src/main/java/com/sdl/odata/util/edm/EntityDataModelUtil.java#L287-L289
train
sdl/odata
odata_api/src/main/java/com/sdl/odata/util/edm/EntityDataModelUtil.java
EntityDataModelUtil.getPropertyType
public static Type getPropertyType(EntityDataModel entityDataModel, StructuralProperty property) { return getAndCheckType(entityDataModel, getPropertyTypeName(property)); }
java
public static Type getPropertyType(EntityDataModel entityDataModel, StructuralProperty property) { return getAndCheckType(entityDataModel, getPropertyTypeName(property)); }
[ "public", "static", "Type", "getPropertyType", "(", "EntityDataModel", "entityDataModel", ",", "StructuralProperty", "property", ")", "{", "return", "getAndCheckType", "(", "entityDataModel", ",", "getPropertyTypeName", "(", "property", ")", ")", ";", "}" ]
Gets the OData type of the property; if the property is a collection, gets the OData type of the elements of the collection. @param entityDataModel The entity data model @param property The property. @return The OData type of the property; if the property is a collection, the OData type of the elements of the c...
[ "Gets", "the", "OData", "type", "of", "the", "property", ";", "if", "the", "property", "is", "a", "collection", "gets", "the", "OData", "type", "of", "the", "elements", "of", "the", "collection", "." ]
eb747d73e9af0f4e59a25b82ed656e526a7e2189
https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_api/src/main/java/com/sdl/odata/util/edm/EntityDataModelUtil.java#L300-L302
train
sdl/odata
odata_api/src/main/java/com/sdl/odata/util/edm/EntityDataModelUtil.java
EntityDataModelUtil.getStructuralProperty
public static StructuralProperty getStructuralProperty(EntityDataModel entityDataModel, StructuredType structuredType, String propertyName) { StructuralProperty structuralProperty = structuredType.getStructuralProperty(propertyName); if (struct...
java
public static StructuralProperty getStructuralProperty(EntityDataModel entityDataModel, StructuredType structuredType, String propertyName) { StructuralProperty structuralProperty = structuredType.getStructuralProperty(propertyName); if (struct...
[ "public", "static", "StructuralProperty", "getStructuralProperty", "(", "EntityDataModel", "entityDataModel", ",", "StructuredType", "structuredType", ",", "String", "propertyName", ")", "{", "StructuralProperty", "structuralProperty", "=", "structuredType", ".", "getStructur...
Get the 'Structural Property' from the given 'Entity Data Model' and 'Structured Type' looking up all the base types recursively. @param entityDataModel The given 'Entity Data Model'. @param structuredType The given 'Structured Type'. @param propertyName The name of the property to look up. @return The 'Structural...
[ "Get", "the", "Structural", "Property", "from", "the", "given", "Entity", "Data", "Model", "and", "Structured", "Type", "looking", "up", "all", "the", "base", "types", "recursively", "." ]
eb747d73e9af0f4e59a25b82ed656e526a7e2189
https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_api/src/main/java/com/sdl/odata/util/edm/EntityDataModelUtil.java#L391-L408
train
sdl/odata
odata_api/src/main/java/com/sdl/odata/util/edm/EntityDataModelUtil.java
EntityDataModelUtil.getKeyPropertyNames
public static Set<String> getKeyPropertyNames(EntityType entityType) { Set<String> keyPropertyNames = entityType.getKey().getPropertyRefs().stream() .map(PropertyRef::getPath).collect(Collectors.toSet()); return keyPropertyNames; }
java
public static Set<String> getKeyPropertyNames(EntityType entityType) { Set<String> keyPropertyNames = entityType.getKey().getPropertyRefs().stream() .map(PropertyRef::getPath).collect(Collectors.toSet()); return keyPropertyNames; }
[ "public", "static", "Set", "<", "String", ">", "getKeyPropertyNames", "(", "EntityType", "entityType", ")", "{", "Set", "<", "String", ">", "keyPropertyNames", "=", "entityType", ".", "getKey", "(", ")", ".", "getPropertyRefs", "(", ")", ".", "stream", "(", ...
Gets the names of the properties that are part of the key of an entity type. @param entityType The entity type. @return A {@code Set} containing the names of the key properties of the entity type.
[ "Gets", "the", "names", "of", "the", "properties", "that", "are", "part", "of", "the", "key", "of", "an", "entity", "type", "." ]
eb747d73e9af0f4e59a25b82ed656e526a7e2189
https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_api/src/main/java/com/sdl/odata/util/edm/EntityDataModelUtil.java#L416-L420
train
sdl/odata
odata_api/src/main/java/com/sdl/odata/util/edm/EntityDataModelUtil.java
EntityDataModelUtil.getKeyPropertyValues
public static Map<String, Object> getKeyPropertyValues(EntityType entityType, Object entity) { Map<String, Object> keyPropertyValues = new HashMap<>(); for (PropertyRef propertyRef : entityType.getKey().getPropertyRefs()) { String propertyName = propertyRef.getPath(); Object prop...
java
public static Map<String, Object> getKeyPropertyValues(EntityType entityType, Object entity) { Map<String, Object> keyPropertyValues = new HashMap<>(); for (PropertyRef propertyRef : entityType.getKey().getPropertyRefs()) { String propertyName = propertyRef.getPath(); Object prop...
[ "public", "static", "Map", "<", "String", ",", "Object", ">", "getKeyPropertyValues", "(", "EntityType", "entityType", ",", "Object", "entity", ")", "{", "Map", "<", "String", ",", "Object", ">", "keyPropertyValues", "=", "new", "HashMap", "<>", "(", ")", ...
Gets the values of the properties that part of the key of an entity type. @param entityType The entity type. @param entity The entity. @return A {@code Map} containing the values of the key properties of the entity, mapped by property name.
[ "Gets", "the", "values", "of", "the", "properties", "that", "part", "of", "the", "key", "of", "an", "entity", "type", "." ]
eb747d73e9af0f4e59a25b82ed656e526a7e2189
https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_api/src/main/java/com/sdl/odata/util/edm/EntityDataModelUtil.java#L429-L437
train
sdl/odata
odata_api/src/main/java/com/sdl/odata/util/edm/EntityDataModelUtil.java
EntityDataModelUtil.getAndCheckEntitySet
public static EntitySet getAndCheckEntitySet(EntityDataModel entityDataModel, String entitySetName) { EntitySet entitySet = entityDataModel.getEntityContainer().getEntitySet(entitySetName); if (entitySet == null) { throw new ODataSystemException("Entity set not found in the entity data model...
java
public static EntitySet getAndCheckEntitySet(EntityDataModel entityDataModel, String entitySetName) { EntitySet entitySet = entityDataModel.getEntityContainer().getEntitySet(entitySetName); if (entitySet == null) { throw new ODataSystemException("Entity set not found in the entity data model...
[ "public", "static", "EntitySet", "getAndCheckEntitySet", "(", "EntityDataModel", "entityDataModel", ",", "String", "entitySetName", ")", "{", "EntitySet", "entitySet", "=", "entityDataModel", ".", "getEntityContainer", "(", ")", ".", "getEntitySet", "(", "entitySetName"...
Gets the entity set with the specified name, throws an exception if no entity set with the specified name exists. @param entityDataModel The entity data model. @param entitySetName The name of the entity set. @return The entity set. @throws ODataSystemException If the entity data model does not contain an entity set...
[ "Gets", "the", "entity", "set", "with", "the", "specified", "name", "throws", "an", "exception", "if", "no", "entity", "set", "with", "the", "specified", "name", "exists", "." ]
eb747d73e9af0f4e59a25b82ed656e526a7e2189
https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_api/src/main/java/com/sdl/odata/util/edm/EntityDataModelUtil.java#L447-L453
train
sdl/odata
odata_api/src/main/java/com/sdl/odata/util/edm/EntityDataModelUtil.java
EntityDataModelUtil.getEntitySetByEntityTypeName
public static EntitySet getEntitySetByEntityTypeName(EntityDataModel entityDataModel, String entityTypeName) throws ODataEdmException { for (EntitySet entitySet : entityDataModel.getEntityContainer().getEntitySets()) { if (entitySet.getTypeName().equals(entityTypeName)) { ...
java
public static EntitySet getEntitySetByEntityTypeName(EntityDataModel entityDataModel, String entityTypeName) throws ODataEdmException { for (EntitySet entitySet : entityDataModel.getEntityContainer().getEntitySets()) { if (entitySet.getTypeName().equals(entityTypeName)) { ...
[ "public", "static", "EntitySet", "getEntitySetByEntityTypeName", "(", "EntityDataModel", "entityDataModel", ",", "String", "entityTypeName", ")", "throws", "ODataEdmException", "{", "for", "(", "EntitySet", "entitySet", ":", "entityDataModel", ".", "getEntityContainer", "...
Get the Entity Set for a given Entity Type name through the Entity Data Model. @param entityDataModel The Entity Data Model. @param entityTypeName The Entity Type name. @return The Entity Set. @throws ODataEdmException if unable to get entity set in entity data model
[ "Get", "the", "Entity", "Set", "for", "a", "given", "Entity", "Type", "name", "through", "the", "Entity", "Data", "Model", "." ]
eb747d73e9af0f4e59a25b82ed656e526a7e2189
https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_api/src/main/java/com/sdl/odata/util/edm/EntityDataModelUtil.java#L463-L471
train
sdl/odata
odata_api/src/main/java/com/sdl/odata/util/edm/EntityDataModelUtil.java
EntityDataModelUtil.getEntityNameByEntityTypeName
public static String getEntityNameByEntityTypeName(EntityDataModel entityDataModel, String entityTypeName) throws ODataEdmException { for (EntitySet entitySet : entityDataModel.getEntityContainer().getEntitySets()) { if (entitySet.getTypeName().equals(entityTypeName)) { r...
java
public static String getEntityNameByEntityTypeName(EntityDataModel entityDataModel, String entityTypeName) throws ODataEdmException { for (EntitySet entitySet : entityDataModel.getEntityContainer().getEntitySets()) { if (entitySet.getTypeName().equals(entityTypeName)) { r...
[ "public", "static", "String", "getEntityNameByEntityTypeName", "(", "EntityDataModel", "entityDataModel", ",", "String", "entityTypeName", ")", "throws", "ODataEdmException", "{", "for", "(", "EntitySet", "entitySet", ":", "entityDataModel", ".", "getEntityContainer", "("...
Get the Entity Name for a given Entity Type name through the Entity Data Model. This looks for entity in both EntitySets and Singletons in the container @param entityDataModel The Entity Data Model. @param entityTypeName The Entity Type name. @return The Entity name @throws ODataEdmException if unable to find entity ...
[ "Get", "the", "Entity", "Name", "for", "a", "given", "Entity", "Type", "name", "through", "the", "Entity", "Data", "Model", ".", "This", "looks", "for", "entity", "in", "both", "EntitySets", "and", "Singletons", "in", "the", "container" ]
eb747d73e9af0f4e59a25b82ed656e526a7e2189
https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_api/src/main/java/com/sdl/odata/util/edm/EntityDataModelUtil.java#L482-L496
train
sdl/odata
odata_api/src/main/java/com/sdl/odata/util/edm/EntityDataModelUtil.java
EntityDataModelUtil.getEntitySetByEntity
public static EntitySet getEntitySetByEntity(EntityDataModel entityDataModel, Object entity) throws ODataEdmException { return getEntitySetByEntityTypeName(entityDataModel, getAndCheckEntityType(entityDataModel, entity.getClass()).getFullyQualifiedName()); }
java
public static EntitySet getEntitySetByEntity(EntityDataModel entityDataModel, Object entity) throws ODataEdmException { return getEntitySetByEntityTypeName(entityDataModel, getAndCheckEntityType(entityDataModel, entity.getClass()).getFullyQualifiedName()); }
[ "public", "static", "EntitySet", "getEntitySetByEntity", "(", "EntityDataModel", "entityDataModel", ",", "Object", "entity", ")", "throws", "ODataEdmException", "{", "return", "getEntitySetByEntityTypeName", "(", "entityDataModel", ",", "getAndCheckEntityType", "(", "entity...
Get the Entity Set of a given entity through the Entity Data Model. @param entityDataModel The Entity Data Model. @param entity The given entity. @return The Entity Set. @throws ODataEdmException If unable to get entity set
[ "Get", "the", "Entity", "Set", "of", "a", "given", "entity", "through", "the", "Entity", "Data", "Model", "." ]
eb747d73e9af0f4e59a25b82ed656e526a7e2189
https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_api/src/main/java/com/sdl/odata/util/edm/EntityDataModelUtil.java#L506-L510
train
sdl/odata
odata_api/src/main/java/com/sdl/odata/util/edm/EntityDataModelUtil.java
EntityDataModelUtil.isSingletonEntity
public static boolean isSingletonEntity(EntityDataModel entityDataModel, Object entity) throws ODataEdmException { // Get the entity type EntityType entityType = getAndCheckEntityType(entityDataModel, entity.getClass()); boolean isSingletonEntity = false; for (Singleton singleton : enti...
java
public static boolean isSingletonEntity(EntityDataModel entityDataModel, Object entity) throws ODataEdmException { // Get the entity type EntityType entityType = getAndCheckEntityType(entityDataModel, entity.getClass()); boolean isSingletonEntity = false; for (Singleton singleton : enti...
[ "public", "static", "boolean", "isSingletonEntity", "(", "EntityDataModel", "entityDataModel", ",", "Object", "entity", ")", "throws", "ODataEdmException", "{", "// Get the entity type", "EntityType", "entityType", "=", "getAndCheckEntityType", "(", "entityDataModel", ",", ...
Check if the given entity is a Singleton entity. @param entityDataModel The Entity Data Model. @param entity The given entity. @return true if singleton, false if not @throws ODataEdmException if unable to determine if entity is singleton
[ "Check", "if", "the", "given", "entity", "is", "a", "Singleton", "entity", "." ]
eb747d73e9af0f4e59a25b82ed656e526a7e2189
https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_api/src/main/java/com/sdl/odata/util/edm/EntityDataModelUtil.java#L520-L533
train
sdl/odata
odata_api/src/main/java/com/sdl/odata/util/edm/EntityDataModelUtil.java
EntityDataModelUtil.getEntityName
public static String getEntityName(EntityDataModel entityDataModel, Object entity) throws ODataEdmException { // Get the entity type EntityType entityType = getAndCheckEntityType(entityDataModel, entity.getClass()); // Check if the entity belongs to an Entity Set String entityName = nu...
java
public static String getEntityName(EntityDataModel entityDataModel, Object entity) throws ODataEdmException { // Get the entity type EntityType entityType = getAndCheckEntityType(entityDataModel, entity.getClass()); // Check if the entity belongs to an Entity Set String entityName = nu...
[ "public", "static", "String", "getEntityName", "(", "EntityDataModel", "entityDataModel", ",", "Object", "entity", ")", "throws", "ODataEdmException", "{", "// Get the entity type", "EntityType", "entityType", "=", "getAndCheckEntityType", "(", "entityDataModel", ",", "en...
Get the entity name in the entity data model for the given entity. @param entityDataModel The Entity Data Model. @param entity The given entity. @return Entity name which can be either EntitySet name or a Singleton Name @throws ODataEdmException If unable to get entity name from entity data model
[ "Get", "the", "entity", "name", "in", "the", "entity", "data", "model", "for", "the", "given", "entity", "." ]
eb747d73e9af0f4e59a25b82ed656e526a7e2189
https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_api/src/main/java/com/sdl/odata/util/edm/EntityDataModelUtil.java#L543-L572
train
sdl/odata
odata_api/src/main/java/com/sdl/odata/util/edm/EntityDataModelUtil.java
EntityDataModelUtil.getAndCheckSingleton
public static Singleton getAndCheckSingleton(EntityDataModel entityDataModel, String singletonName) { Singleton singleton = entityDataModel.getEntityContainer().getSingleton(singletonName); if (singleton == null) { throw new ODataSystemException("Singleton not found in the entity data model:...
java
public static Singleton getAndCheckSingleton(EntityDataModel entityDataModel, String singletonName) { Singleton singleton = entityDataModel.getEntityContainer().getSingleton(singletonName); if (singleton == null) { throw new ODataSystemException("Singleton not found in the entity data model:...
[ "public", "static", "Singleton", "getAndCheckSingleton", "(", "EntityDataModel", "entityDataModel", ",", "String", "singletonName", ")", "{", "Singleton", "singleton", "=", "entityDataModel", ".", "getEntityContainer", "(", ")", ".", "getSingleton", "(", "singletonName"...
Gets the singleton with the specified name, throws an exception if no singleton with the specified name exists. @param entityDataModel The entity data model. @param singletonName The name of the singleton. @return The singleton. @throws ODataSystemException If the entity data model does not contain a singleton with ...
[ "Gets", "the", "singleton", "with", "the", "specified", "name", "throws", "an", "exception", "if", "no", "singleton", "with", "the", "specified", "name", "exists", "." ]
eb747d73e9af0f4e59a25b82ed656e526a7e2189
https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_api/src/main/java/com/sdl/odata/util/edm/EntityDataModelUtil.java#L582-L588
train
sdl/odata
odata_api/src/main/java/com/sdl/odata/util/edm/EntityDataModelUtil.java
EntityDataModelUtil.getAndCheckFunctionImport
public static FunctionImport getAndCheckFunctionImport(EntityDataModel entityDataModel, String functionImportName) { FunctionImport functionImport = entityDataModel.getEntityContainer().getFunctionImport(functionImportName); if (functionImport == null) { throw new ODataSystemException("Funct...
java
public static FunctionImport getAndCheckFunctionImport(EntityDataModel entityDataModel, String functionImportName) { FunctionImport functionImport = entityDataModel.getEntityContainer().getFunctionImport(functionImportName); if (functionImport == null) { throw new ODataSystemException("Funct...
[ "public", "static", "FunctionImport", "getAndCheckFunctionImport", "(", "EntityDataModel", "entityDataModel", ",", "String", "functionImportName", ")", "{", "FunctionImport", "functionImport", "=", "entityDataModel", ".", "getEntityContainer", "(", ")", ".", "getFunctionImp...
Gets the function import by the specified name, throw an exception if no function import with the specified name exists. @param entityDataModel The entity data model. @param functionImportName The name of the function import. @return The function import
[ "Gets", "the", "function", "import", "by", "the", "specified", "name", "throw", "an", "exception", "if", "no", "function", "import", "with", "the", "specified", "name", "exists", "." ]
eb747d73e9af0f4e59a25b82ed656e526a7e2189
https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_api/src/main/java/com/sdl/odata/util/edm/EntityDataModelUtil.java#L598-L605
train
sdl/odata
odata_api/src/main/java/com/sdl/odata/util/edm/EntityDataModelUtil.java
EntityDataModelUtil.getAndCheckActionImport
public static ActionImport getAndCheckActionImport(EntityDataModel entityDataModel, String actionImportName) { ActionImport actionImport = entityDataModel.getEntityContainer().getActionImport(actionImportName); if (actionImport == null) { throw new ODataSystemException("Action import not fou...
java
public static ActionImport getAndCheckActionImport(EntityDataModel entityDataModel, String actionImportName) { ActionImport actionImport = entityDataModel.getEntityContainer().getActionImport(actionImportName); if (actionImport == null) { throw new ODataSystemException("Action import not fou...
[ "public", "static", "ActionImport", "getAndCheckActionImport", "(", "EntityDataModel", "entityDataModel", ",", "String", "actionImportName", ")", "{", "ActionImport", "actionImport", "=", "entityDataModel", ".", "getEntityContainer", "(", ")", ".", "getActionImport", "(",...
Gets the action import by the specified name, throw an exception if no action import with the specified name exists. @param entityDataModel The entity data model. @param actionImportName The name of action import. @return The instance of action import.
[ "Gets", "the", "action", "import", "by", "the", "specified", "name", "throw", "an", "exception", "if", "no", "action", "import", "with", "the", "specified", "name", "exists", "." ]
eb747d73e9af0f4e59a25b82ed656e526a7e2189
https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_api/src/main/java/com/sdl/odata/util/edm/EntityDataModelUtil.java#L631-L638
train
sdl/odata
odata_api/src/main/java/com/sdl/odata/util/edm/EntityDataModelUtil.java
EntityDataModelUtil.getAndCheckAction
public static Action getAndCheckAction(EntityDataModel entityDataModel, String actionName) { int namespaceLastIndex = actionName.lastIndexOf('.'); String namespace = actionName.substring(0, namespaceLastIndex); String simpleActionName = actionName.substring(namespaceLastIndex + 1); Schem...
java
public static Action getAndCheckAction(EntityDataModel entityDataModel, String actionName) { int namespaceLastIndex = actionName.lastIndexOf('.'); String namespace = actionName.substring(0, namespaceLastIndex); String simpleActionName = actionName.substring(namespaceLastIndex + 1); Schem...
[ "public", "static", "Action", "getAndCheckAction", "(", "EntityDataModel", "entityDataModel", ",", "String", "actionName", ")", "{", "int", "namespaceLastIndex", "=", "actionName", ".", "lastIndexOf", "(", "'", "'", ")", ";", "String", "namespace", "=", "actionNam...
Gets the action by the specified name, throw an exception if no action with the specified name exists. @param entityDataModel The entity data model. @param actionName The name of action. @return the Action instance specified by given actionName.
[ "Gets", "the", "action", "by", "the", "specified", "name", "throw", "an", "exception", "if", "no", "action", "with", "the", "specified", "name", "exists", "." ]
eb747d73e9af0f4e59a25b82ed656e526a7e2189
https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_api/src/main/java/com/sdl/odata/util/edm/EntityDataModelUtil.java#L648-L662
train
sdl/odata
odata_api/src/main/java/com/sdl/odata/util/edm/EntityDataModelUtil.java
EntityDataModelUtil.isCollection
public static boolean isCollection(EntityDataModel entityDataModel, String typeName) { EntitySet entitySet = entityDataModel.getEntityContainer().getEntitySet(typeName); if (entitySet != null) { return true; } try { if (Collection.class.isAssignableFrom(Class.forN...
java
public static boolean isCollection(EntityDataModel entityDataModel, String typeName) { EntitySet entitySet = entityDataModel.getEntityContainer().getEntitySet(typeName); if (entitySet != null) { return true; } try { if (Collection.class.isAssignableFrom(Class.forN...
[ "public", "static", "boolean", "isCollection", "(", "EntityDataModel", "entityDataModel", ",", "String", "typeName", ")", "{", "EntitySet", "entitySet", "=", "entityDataModel", ".", "getEntityContainer", "(", ")", ".", "getEntitySet", "(", "typeName", ")", ";", "i...
Checks if the specified typeName is a collection. @param entityDataModel The entity data model. @param typeName The type name to check. @return True if the type is a collection, False if not
[ "Checks", "if", "the", "specified", "typeName", "is", "a", "collection", "." ]
eb747d73e9af0f4e59a25b82ed656e526a7e2189
https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_api/src/main/java/com/sdl/odata/util/edm/EntityDataModelUtil.java#L671-L686
train
sdl/odata
odata_api/src/main/java/com/sdl/odata/util/edm/EntityDataModelUtil.java
EntityDataModelUtil.formatEntityKey
public static String formatEntityKey(EntityDataModel entityDataModel, Object entity) throws ODataEdmException { Key entityKey = getAndCheckEntityType(entityDataModel, entity.getClass()).getKey(); List<PropertyRef> keyPropertyRefs = entityKey.getPropertyRefs(); try { if (keyPropertyR...
java
public static String formatEntityKey(EntityDataModel entityDataModel, Object entity) throws ODataEdmException { Key entityKey = getAndCheckEntityType(entityDataModel, entity.getClass()).getKey(); List<PropertyRef> keyPropertyRefs = entityKey.getPropertyRefs(); try { if (keyPropertyR...
[ "public", "static", "String", "formatEntityKey", "(", "EntityDataModel", "entityDataModel", ",", "Object", "entity", ")", "throws", "ODataEdmException", "{", "Key", "entityKey", "=", "getAndCheckEntityType", "(", "entityDataModel", ",", "entity", ".", "getClass", "(",...
Get the entity key for a given entity by inspecting the Entity Data Model. @param entityDataModel The Entity Data Model. @param entity The given entity. @return The String representation of the entity key. @throws ODataEdmException If unable to format entity key
[ "Get", "the", "entity", "key", "for", "a", "given", "entity", "by", "inspecting", "the", "Entity", "Data", "Model", "." ]
eb747d73e9af0f4e59a25b82ed656e526a7e2189
https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_api/src/main/java/com/sdl/odata/util/edm/EntityDataModelUtil.java#L696-L718
train
sdl/odata
odata_api/src/main/java/com/sdl/odata/util/edm/EntityDataModelUtil.java
EntityDataModelUtil.pluralize
public static String pluralize(String word) { if (word == null) { throw new IllegalArgumentException(); } final String lowerCaseWord = word.toLowerCase(); if (endsWithAny(lowerCaseWord, "s", "sh", "o")) { return word + "es"; } if (lowerCaseWord.en...
java
public static String pluralize(String word) { if (word == null) { throw new IllegalArgumentException(); } final String lowerCaseWord = word.toLowerCase(); if (endsWithAny(lowerCaseWord, "s", "sh", "o")) { return word + "es"; } if (lowerCaseWord.en...
[ "public", "static", "String", "pluralize", "(", "String", "word", ")", "{", "if", "(", "word", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", ")", ";", "}", "final", "String", "lowerCaseWord", "=", "word", ".", "toLowerCase", "(",...
Get the plural for the given English word. @param word The given English word. It can not be {@code null}; @return The plural word. @see <a href='http://en.wikipedia.org/wiki/English_plurals'>Building English plurals.</a>
[ "Get", "the", "plural", "for", "the", "given", "English", "word", "." ]
eb747d73e9af0f4e59a25b82ed656e526a7e2189
https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_api/src/main/java/com/sdl/odata/util/edm/EntityDataModelUtil.java#L744-L759
train
sdl/odata
odata_renderer/src/main/java/com/sdl/odata/renderer/metadata/ServiceDocumentRenderer.java
ServiceDocumentRenderer.scoreServiceDocument
protected int scoreServiceDocument(ODataRequestContext requestContext, MediaType requiredMediaType) { if (isServiceDocument(requestContext.getUri())) { int scoreByFormat = scoreByFormat(getFormatOption(requestContext.getUri()), requiredMediaType); int scoreByMediaType = scoreByMediaType(...
java
protected int scoreServiceDocument(ODataRequestContext requestContext, MediaType requiredMediaType) { if (isServiceDocument(requestContext.getUri())) { int scoreByFormat = scoreByFormat(getFormatOption(requestContext.getUri()), requiredMediaType); int scoreByMediaType = scoreByMediaType(...
[ "protected", "int", "scoreServiceDocument", "(", "ODataRequestContext", "requestContext", ",", "MediaType", "requiredMediaType", ")", "{", "if", "(", "isServiceDocument", "(", "requestContext", ".", "getUri", "(", ")", ")", ")", "{", "int", "scoreByFormat", "=", "...
Calculate a score for a 'Service Document Renderer' based on a given OData request context and required media type. @param requestContext The given OData request context. @param requiredMediaType The required media type. @return The calculated score.
[ "Calculate", "a", "score", "for", "a", "Service", "Document", "Renderer", "based", "on", "a", "given", "OData", "request", "context", "and", "required", "media", "type", "." ]
eb747d73e9af0f4e59a25b82ed656e526a7e2189
https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_renderer/src/main/java/com/sdl/odata/renderer/metadata/ServiceDocumentRenderer.java#L51-L59
train
sdl/odata
odata_renderer/src/main/java/com/sdl/odata/unmarshaller/json/core/JsonProcessor.java
JsonProcessor.initialize
public void initialize() throws ODataUnmarshallingException { LOG.info("Parser is initializing"); try { JsonParser jsonParser = JSON_FACTORY.createParser(inputJson); while (jsonParser.nextToken() != JsonToken.END_OBJECT) { String token = jsonParser.getCurrentName...
java
public void initialize() throws ODataUnmarshallingException { LOG.info("Parser is initializing"); try { JsonParser jsonParser = JSON_FACTORY.createParser(inputJson); while (jsonParser.nextToken() != JsonToken.END_OBJECT) { String token = jsonParser.getCurrentName...
[ "public", "void", "initialize", "(", ")", "throws", "ODataUnmarshallingException", "{", "LOG", ".", "info", "(", "\"Parser is initializing\"", ")", ";", "try", "{", "JsonParser", "jsonParser", "=", "JSON_FACTORY", ".", "createParser", "(", "inputJson", ")", ";", ...
Initialize processor, automatically scanning the input JSON. @throws ODataUnmarshallingException If unable to initialize
[ "Initialize", "processor", "automatically", "scanning", "the", "input", "JSON", "." ]
eb747d73e9af0f4e59a25b82ed656e526a7e2189
https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_renderer/src/main/java/com/sdl/odata/unmarshaller/json/core/JsonProcessor.java#L73-L93
train
sdl/odata
odata_renderer/src/main/java/com/sdl/odata/unmarshaller/json/core/JsonProcessor.java
JsonProcessor.process
private void process(JsonParser jsonParser) throws IOException, ODataUnmarshallingException { if (jsonParser.getCurrentToken() == JsonToken.FIELD_NAME) { LOG.info("Starting to parse {} token", jsonParser.getCurrentName()); String key = jsonParser.getCurrentName(); jsonParser....
java
private void process(JsonParser jsonParser) throws IOException, ODataUnmarshallingException { if (jsonParser.getCurrentToken() == JsonToken.FIELD_NAME) { LOG.info("Starting to parse {} token", jsonParser.getCurrentName()); String key = jsonParser.getCurrentName(); jsonParser....
[ "private", "void", "process", "(", "JsonParser", "jsonParser", ")", "throws", "IOException", ",", "ODataUnmarshallingException", "{", "if", "(", "jsonParser", ".", "getCurrentToken", "(", ")", "==", "JsonToken", ".", "FIELD_NAME", ")", "{", "LOG", ".", "info", ...
Process all things that do not contain special ODataTags. @param jsonParser the parser @throws ODataUnmarshallingException If unable to unmarshall @throws IOException If unable to read input parser
[ "Process", "all", "things", "that", "do", "not", "contain", "special", "ODataTags", "." ]
eb747d73e9af0f4e59a25b82ed656e526a7e2189
https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_renderer/src/main/java/com/sdl/odata/unmarshaller/json/core/JsonProcessor.java#L102-L124
train
sdl/odata
odata_renderer/src/main/java/com/sdl/odata/unmarshaller/json/core/JsonProcessor.java
JsonProcessor.getCollectionValue
private List<Object> getCollectionValue(JsonParser jsonParser) throws IOException { LOG.info("Start parsing {} array", jsonParser.getCurrentName()); List<Object> list = new ArrayList<>(); while (jsonParser.nextToken() != JsonToken.END_ARRAY) { if (jsonParser.getCurrentToken() == Json...
java
private List<Object> getCollectionValue(JsonParser jsonParser) throws IOException { LOG.info("Start parsing {} array", jsonParser.getCurrentName()); List<Object> list = new ArrayList<>(); while (jsonParser.nextToken() != JsonToken.END_ARRAY) { if (jsonParser.getCurrentToken() == Json...
[ "private", "List", "<", "Object", ">", "getCollectionValue", "(", "JsonParser", "jsonParser", ")", "throws", "IOException", "{", "LOG", ".", "info", "(", "\"Start parsing {} array\"", ",", "jsonParser", ".", "getCurrentName", "(", ")", ")", ";", "List", "<", "...
Parse the complex values. @param jsonParser the parser @return list of parsed result objects @throws IOException If unable to read input parser
[ "Parse", "the", "complex", "values", "." ]
eb747d73e9af0f4e59a25b82ed656e526a7e2189
https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_renderer/src/main/java/com/sdl/odata/unmarshaller/json/core/JsonProcessor.java#L133-L148
train
sdl/odata
odata_renderer/src/main/java/com/sdl/odata/unmarshaller/json/core/JsonProcessor.java
JsonProcessor.getEmbeddedObject
private Object getEmbeddedObject(JsonParser jsonParser) throws IOException { LOG.info("Start parsing an embedded object."); Map<String, Object> embeddedMap = new HashMap<>(); while (jsonParser.nextToken() != JsonToken.END_OBJECT) { String key = jsonParser.getText(); jsonP...
java
private Object getEmbeddedObject(JsonParser jsonParser) throws IOException { LOG.info("Start parsing an embedded object."); Map<String, Object> embeddedMap = new HashMap<>(); while (jsonParser.nextToken() != JsonToken.END_OBJECT) { String key = jsonParser.getText(); jsonP...
[ "private", "Object", "getEmbeddedObject", "(", "JsonParser", "jsonParser", ")", "throws", "IOException", "{", "LOG", ".", "info", "(", "\"Start parsing an embedded object.\"", ")", ";", "Map", "<", "String", ",", "Object", ">", "embeddedMap", "=", "new", "HashMap"...
Process an embedded object. @param jsonParser the parser @return map with embedded object key:values @throws IOException If unable to read input parser
[ "Process", "an", "embedded", "object", "." ]
eb747d73e9af0f4e59a25b82ed656e526a7e2189
https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_renderer/src/main/java/com/sdl/odata/unmarshaller/json/core/JsonProcessor.java#L157-L179
train
sdl/odata
odata_renderer/src/main/java/com/sdl/odata/unmarshaller/json/core/JsonProcessor.java
JsonProcessor.processLinks
private void processLinks(JsonParser jsonParser) throws IOException { LOG.info("@odata.bind tag found - start parsing"); final String fullLinkFieldName = jsonParser.getText(); final String key = fullLinkFieldName.substring(0, fullLinkFieldName.indexOf(ODATA_BIND)); JsonToken token = js...
java
private void processLinks(JsonParser jsonParser) throws IOException { LOG.info("@odata.bind tag found - start parsing"); final String fullLinkFieldName = jsonParser.getText(); final String key = fullLinkFieldName.substring(0, fullLinkFieldName.indexOf(ODATA_BIND)); JsonToken token = js...
[ "private", "void", "processLinks", "(", "JsonParser", "jsonParser", ")", "throws", "IOException", "{", "LOG", ".", "info", "(", "\"@odata.bind tag found - start parsing\"", ")", ";", "final", "String", "fullLinkFieldName", "=", "jsonParser", ".", "getText", "(", ")"...
Process OData links. @param jsonParser the parser @throws IOException If unable to read input parser
[ "Process", "OData", "links", "." ]
eb747d73e9af0f4e59a25b82ed656e526a7e2189
https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_renderer/src/main/java/com/sdl/odata/unmarshaller/json/core/JsonProcessor.java#L202-L221
train
sdl/odata
odata_renderer/src/main/java/com/sdl/odata/unmarshaller/json/core/JsonProcessor.java
JsonProcessor.processLink
private String processLink(JsonParser jsonParser) throws IOException { final String link = jsonParser.getText(); if (link.contains(SVC_EXTENSION)) { return link.substring(link.indexOf(SVC_EXTENSION) + SVC_EXTENSION.length()); } return link; }
java
private String processLink(JsonParser jsonParser) throws IOException { final String link = jsonParser.getText(); if (link.contains(SVC_EXTENSION)) { return link.substring(link.indexOf(SVC_EXTENSION) + SVC_EXTENSION.length()); } return link; }
[ "private", "String", "processLink", "(", "JsonParser", "jsonParser", ")", "throws", "IOException", "{", "final", "String", "link", "=", "jsonParser", ".", "getText", "(", ")", ";", "if", "(", "link", ".", "contains", "(", "SVC_EXTENSION", ")", ")", "{", "r...
Process OData link. @param jsonParser the parser @throws IOException If unable to read input parser @return the link
[ "Process", "OData", "link", "." ]
eb747d73e9af0f4e59a25b82ed656e526a7e2189
https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_renderer/src/main/java/com/sdl/odata/unmarshaller/json/core/JsonProcessor.java#L230-L236
train
sdl/odata
odata_renderer/src/main/java/com/sdl/odata/unmarshaller/json/core/JsonPropertyExpander.java
JsonPropertyExpander.fillUpdatedObjectProperty
public void fillUpdatedObjectProperty(Object entity, Object currentNode, StructuralProperty property, Field field, String node, Map<String, Object> map) throws ODataException { for (Map.Entry<String, Object> entry : ((Map<String, Object>) currentNode).entrySet()) { ...
java
public void fillUpdatedObjectProperty(Object entity, Object currentNode, StructuralProperty property, Field field, String node, Map<String, Object> map) throws ODataException { for (Map.Entry<String, Object> entry : ((Map<String, Object>) currentNode).entrySet()) { ...
[ "public", "void", "fillUpdatedObjectProperty", "(", "Object", "entity", ",", "Object", "currentNode", ",", "StructuralProperty", "property", ",", "Field", "field", ",", "String", "node", ",", "Map", "<", "String", ",", "Object", ">", "map", ")", "throws", "ODa...
Populates the embedded object property with the relevant field values. @param entity the entity @param currentNode the current node to to process @param property the embedded object property @param field the Java field @param node the node @param map the map of field values @throws ODataEx...
[ "Populates", "the", "embedded", "object", "property", "with", "the", "relevant", "field", "values", "." ]
eb747d73e9af0f4e59a25b82ed656e526a7e2189
https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_renderer/src/main/java/com/sdl/odata/unmarshaller/json/core/JsonPropertyExpander.java#L65-L72
train
sdl/odata
odata_renderer/src/main/java/com/sdl/odata/unmarshaller/json/core/JsonPropertyExpander.java
JsonPropertyExpander.fillUpdatedCollectionProperty
public void fillUpdatedCollectionProperty(Object entity, Object currentNode, StructuralProperty property, Field field, String node, Map<String, Object> map) throws ODataException { Collection<Object> valueSet; if (field.getType().isAssignableFrom(Set.class)...
java
public void fillUpdatedCollectionProperty(Object entity, Object currentNode, StructuralProperty property, Field field, String node, Map<String, Object> map) throws ODataException { Collection<Object> valueSet; if (field.getType().isAssignableFrom(Set.class)...
[ "public", "void", "fillUpdatedCollectionProperty", "(", "Object", "entity", ",", "Object", "currentNode", ",", "StructuralProperty", "property", ",", "Field", "field", ",", "String", "node", ",", "Map", "<", "String", ",", "Object", ">", "map", ")", "throws", ...
Populates the collection property with the relevant field values. @param entity the entity @param currentNode the current node to to process @param property the embedded collection @param field the Java field @param node the node @param map the map of field values @throws ODataException If...
[ "Populates", "the", "collection", "property", "with", "the", "relevant", "field", "values", "." ]
eb747d73e9af0f4e59a25b82ed656e526a7e2189
https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_renderer/src/main/java/com/sdl/odata/unmarshaller/json/core/JsonPropertyExpander.java#L111-L130
train
sdl/odata
odata_renderer/src/main/java/com/sdl/odata/unmarshaller/json/core/JsonPropertyExpander.java
JsonPropertyExpander.fillPrimitiveProperty
public void fillPrimitiveProperty(Object entity, Set<String> keySet, StructuralProperty property, Field field, String node, Map<String, Object> map) throws ODataException { for (String target : keySet) { if (node.equalsIgnoreCase(target)) { Objec...
java
public void fillPrimitiveProperty(Object entity, Set<String> keySet, StructuralProperty property, Field field, String node, Map<String, Object> map) throws ODataException { for (String target : keySet) { if (node.equalsIgnoreCase(target)) { Objec...
[ "public", "void", "fillPrimitiveProperty", "(", "Object", "entity", ",", "Set", "<", "String", ">", "keySet", ",", "StructuralProperty", "property", ",", "Field", "field", ",", "String", "node", ",", "Map", "<", "String", ",", "Object", ">", "map", ")", "t...
Populates the primitive property of the entity with the relevant field value. @param entity the entity @param keySet the set of entity properties @param property the primitive property @param field the Java field @param node the current node @param map the map of field values @throws ODataException If ...
[ "Populates", "the", "primitive", "property", "of", "the", "entity", "with", "the", "relevant", "field", "value", "." ]
eb747d73e9af0f4e59a25b82ed656e526a7e2189
https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_renderer/src/main/java/com/sdl/odata/unmarshaller/json/core/JsonPropertyExpander.java#L143-L156
train
sdl/odata
odata_renderer/src/main/java/com/sdl/odata/unmarshaller/json/core/JsonPropertyExpander.java
JsonPropertyExpander.fillCollectionProperty
public void fillCollectionProperty(Object entity, Set<String> keySet, StructuralProperty property, Field field, String node, Map<String, Object> map) throws ODataException { for (String target : keySet) { if (node.equalsIgnoreCase(target)) { ...
java
public void fillCollectionProperty(Object entity, Set<String> keySet, StructuralProperty property, Field field, String node, Map<String, Object> map) throws ODataException { for (String target : keySet) { if (node.equalsIgnoreCase(target)) { ...
[ "public", "void", "fillCollectionProperty", "(", "Object", "entity", ",", "Set", "<", "String", ">", "keySet", ",", "StructuralProperty", "property", ",", "Field", "field", ",", "String", "node", ",", "Map", "<", "String", ",", "Object", ">", "map", ")", "...
Populates the collection property of the entity with field values. @param entity the entity @param keySet the set of entity properties @param property the collection property @param field the Java field @param node the current node @param map the map of field values @throws ODataException If unable to ...
[ "Populates", "the", "collection", "property", "of", "the", "entity", "with", "field", "values", "." ]
eb747d73e9af0f4e59a25b82ed656e526a7e2189
https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_renderer/src/main/java/com/sdl/odata/unmarshaller/json/core/JsonPropertyExpander.java#L169-L186
train
sdl/odata
odata_renderer/src/main/java/com/sdl/odata/unmarshaller/json/core/JsonPropertyExpander.java
JsonPropertyExpander.getFieldValueByType
protected Object getFieldValueByType(String typeName, Object targetNode, Map<String, Object> map, boolean isExtracted) throws ODataException { Object fieldValue = null; LOG.debug("Type is {}", typeName); Type type = entityDataModel.getType(typeName); ...
java
protected Object getFieldValueByType(String typeName, Object targetNode, Map<String, Object> map, boolean isExtracted) throws ODataException { Object fieldValue = null; LOG.debug("Type is {}", typeName); Type type = entityDataModel.getType(typeName); ...
[ "protected", "Object", "getFieldValueByType", "(", "String", "typeName", ",", "Object", "targetNode", ",", "Map", "<", "String", ",", "Object", ">", "map", ",", "boolean", "isExtracted", ")", "throws", "ODataException", "{", "Object", "fieldValue", "=", "null", ...
Gets the field value for the property type. @param typeName the type name @param targetNode the target node @param map the map of field value @param isExtracted boolean indicating whether the field is extracted @return the field object @throws ODataException If unable to get field values
[ "Gets", "the", "field", "value", "for", "the", "property", "type", "." ]
eb747d73e9af0f4e59a25b82ed656e526a7e2189
https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_renderer/src/main/java/com/sdl/odata/unmarshaller/json/core/JsonPropertyExpander.java#L198-L228
train
sdl/odata
odata_renderer/src/main/java/com/sdl/odata/unmarshaller/json/core/JsonPropertyExpander.java
JsonPropertyExpander.unmarshallEntityByName
private Object unmarshallEntityByName(String entityName, Map<String, Object> map, Object currentNode) throws ODataException { LOG.debug("Entity '{}' created.", entityName); if (!isNullOrEmpty(entityName)) { Object entity = loadEntity(entityName); ...
java
private Object unmarshallEntityByName(String entityName, Map<String, Object> map, Object currentNode) throws ODataException { LOG.debug("Entity '{}' created.", entityName); if (!isNullOrEmpty(entityName)) { Object entity = loadEntity(entityName); ...
[ "private", "Object", "unmarshallEntityByName", "(", "String", "entityName", ",", "Map", "<", "String", ",", "Object", ">", "map", ",", "Object", "currentNode", ")", "throws", "ODataException", "{", "LOG", ".", "debug", "(", "\"Entity '{}' created.\"", ",", "enti...
Unmarsall a named entity. @param entityName the entity to unmarshall @param map the map of field values @param currentNode the node to process @return the value object of the unmarshalled entity @throws ODataException If unable to unmarshall entity by name
[ "Unmarsall", "a", "named", "entity", "." ]
eb747d73e9af0f4e59a25b82ed656e526a7e2189
https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_renderer/src/main/java/com/sdl/odata/unmarshaller/json/core/JsonPropertyExpander.java#L240-L252
train
sdl/odata
odata_renderer/src/main/java/com/sdl/odata/unmarshaller/json/core/JsonPropertyExpander.java
JsonPropertyExpander.loadEntity
public Object loadEntity(String entityName) throws ODataUnmarshallingException { Object entity = null; if (entityName != null) { try { StructuredType entityType = JsonParserUtils.getStructuredType(entityName, entityDataModel); if (entityType != null) { ...
java
public Object loadEntity(String entityName) throws ODataUnmarshallingException { Object entity = null; if (entityName != null) { try { StructuredType entityType = JsonParserUtils.getStructuredType(entityName, entityDataModel); if (entityType != null) { ...
[ "public", "Object", "loadEntity", "(", "String", "entityName", ")", "throws", "ODataUnmarshallingException", "{", "Object", "entity", "=", "null", ";", "if", "(", "entityName", "!=", "null", ")", "{", "try", "{", "StructuredType", "entityType", "=", "JsonParserU...
Creates the an entity based on its name. @param entityName The name of the entity @return the entity object @throws ODataUnmarshallingException If unable to load entity
[ "Creates", "the", "an", "entity", "based", "on", "its", "name", "." ]
eb747d73e9af0f4e59a25b82ed656e526a7e2189
https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_renderer/src/main/java/com/sdl/odata/unmarshaller/json/core/JsonPropertyExpander.java#L261-L278
train
sdl/odata
odata_renderer/src/main/java/com/sdl/odata/unmarshaller/json/core/JsonPropertyExpander.java
JsonPropertyExpander.setEntityProperties
public void setEntityProperties(Object entity, StructuredType entityType, Map<String, Object> map, Object currentNode) throws ODataException { Set<String> keySet = map.keySet(); for (StructuralProperty property : getAllProperties(entityType, entityDataModel)) { ...
java
public void setEntityProperties(Object entity, StructuredType entityType, Map<String, Object> map, Object currentNode) throws ODataException { Set<String> keySet = map.keySet(); for (StructuralProperty property : getAllProperties(entityType, entityDataModel)) { ...
[ "public", "void", "setEntityProperties", "(", "Object", "entity", ",", "StructuredType", "entityType", ",", "Map", "<", "String", ",", "Object", ">", "map", ",", "Object", "currentNode", ")", "throws", "ODataException", "{", "Set", "<", "String", ">", "keySet"...
Sets the given entity with structural properties from the fields. @param entity entity @param entityType entityType @param map a map of field values @param currentNode the current node to process @throws ODataException If unable to set entity properties
[ "Sets", "the", "given", "entity", "with", "structural", "properties", "from", "the", "fields", "." ]
eb747d73e9af0f4e59a25b82ed656e526a7e2189
https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_renderer/src/main/java/com/sdl/odata/unmarshaller/json/core/JsonPropertyExpander.java#L289-L316
train
sdl/odata
odata_processor/src/main/java/com/sdl/odata/processor/write/DeleteMethodHandler.java
DeleteMethodHandler.handleWrite
@Override public ProcessorResult handleWrite(Object entity) throws ODataException { if (ODataUriUtil.isRefPathUri(getoDataUri())) { return processLink((ODataLink) entity); } else { if (entity != null) { throw new ODataBadRequestException("The body of a DELETE ...
java
@Override public ProcessorResult handleWrite(Object entity) throws ODataException { if (ODataUriUtil.isRefPathUri(getoDataUri())) { return processLink((ODataLink) entity); } else { if (entity != null) { throw new ODataBadRequestException("The body of a DELETE ...
[ "@", "Override", "public", "ProcessorResult", "handleWrite", "(", "Object", "entity", ")", "throws", "ODataException", "{", "if", "(", "ODataUriUtil", ".", "isRefPathUri", "(", "getoDataUri", "(", ")", ")", ")", "{", "return", "processLink", "(", "(", "ODataLi...
This method delete entity. @param entity is null always. If it is not null then returns BAD_REQUEST status @return status of request @throws com.sdl.odata.api.processor.datasource.ODataDataSourceException in case of any error
[ "This", "method", "delete", "entity", "." ]
eb747d73e9af0f4e59a25b82ed656e526a7e2189
https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_processor/src/main/java/com/sdl/odata/processor/write/DeleteMethodHandler.java#L54-L65
train
sdl/odata
odata_processor/src/main/java/com/sdl/odata/processor/write/DeleteMethodHandler.java
DeleteMethodHandler.processEntity
private ProcessorResult processEntity() throws ODataException { TargetType targetType = getTargetType(); if (!targetType.isCollection()) { Option<String> singletonName = ODataUriUtil.getSingletonName(getoDataUri()); if (singletonName.isDefined()) { throw new OData...
java
private ProcessorResult processEntity() throws ODataException { TargetType targetType = getTargetType(); if (!targetType.isCollection()) { Option<String> singletonName = ODataUriUtil.getSingletonName(getoDataUri()); if (singletonName.isDefined()) { throw new OData...
[ "private", "ProcessorResult", "processEntity", "(", ")", "throws", "ODataException", "{", "TargetType", "targetType", "=", "getTargetType", "(", ")", ";", "if", "(", "!", "targetType", ".", "isCollection", "(", ")", ")", "{", "Option", "<", "String", ">", "s...
This method finds correct data source based on target type and executes delete operation on data source. @return status of the action @throws com.sdl.odata.api.processor.datasource.ODataDataSourceException in case of any errors
[ "This", "method", "finds", "correct", "data", "source", "based", "on", "target", "type", "and", "executes", "delete", "operation", "on", "data", "source", "." ]
eb747d73e9af0f4e59a25b82ed656e526a7e2189
https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_processor/src/main/java/com/sdl/odata/processor/write/DeleteMethodHandler.java#L73-L92
train
sdl/odata
odata_renderer/src/main/java/com/sdl/odata/renderer/json/writer/JsonWriter.java
JsonWriter.writeRawJson
public String writeRawJson(final String json, final String contextUrl) throws ODataRenderException { this.contextURL = checkNotNull(contextUrl); try { final ByteArrayOutputStream stream = new ByteArrayOutputStream(); jsonGenerator = JSON_FACTORY.createGenerator(stream, JsonEncodi...
java
public String writeRawJson(final String json, final String contextUrl) throws ODataRenderException { this.contextURL = checkNotNull(contextUrl); try { final ByteArrayOutputStream stream = new ByteArrayOutputStream(); jsonGenerator = JSON_FACTORY.createGenerator(stream, JsonEncodi...
[ "public", "String", "writeRawJson", "(", "final", "String", "json", ",", "final", "String", "contextUrl", ")", "throws", "ODataRenderException", "{", "this", ".", "contextURL", "=", "checkNotNull", "(", "contextUrl", ")", ";", "try", "{", "final", "ByteArrayOutp...
Writes raw json to the JSON stream. @param json JSON to write @param contextUrl context URL @return JSON result @throws ODataRenderException OData render exception
[ "Writes", "raw", "json", "to", "the", "JSON", "stream", "." ]
eb747d73e9af0f4e59a25b82ed656e526a7e2189
https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_renderer/src/main/java/com/sdl/odata/renderer/json/writer/JsonWriter.java#L146-L157
train
sdl/odata
odata_renderer/src/main/java/com/sdl/odata/renderer/json/writer/JsonWriter.java
JsonWriter.writeJson
private String writeJson(Object data, Map<String, Object> meta) throws IOException, NoSuchFieldException, IllegalAccessException, ODataEdmException, ODataRenderException { ByteArrayOutputStream stream = new ByteArrayOutputStream(); jsonGenerator = JSON_FACTORY.createGenerator(stream, JsonEn...
java
private String writeJson(Object data, Map<String, Object> meta) throws IOException, NoSuchFieldException, IllegalAccessException, ODataEdmException, ODataRenderException { ByteArrayOutputStream stream = new ByteArrayOutputStream(); jsonGenerator = JSON_FACTORY.createGenerator(stream, JsonEn...
[ "private", "String", "writeJson", "(", "Object", "data", ",", "Map", "<", "String", ",", "Object", ">", "meta", ")", "throws", "IOException", ",", "NoSuchFieldException", ",", "IllegalAccessException", ",", "ODataEdmException", ",", "ODataRenderException", "{", "B...
Write the given data to the JSON stream. The data to write will be either a single entity or a feed depending on whether it is a single object or list. @param data The given data. @param meta Additional values to write. @return The written JSON stream. @throws ODataRenderException if unable to render
[ "Write", "the", "given", "data", "to", "the", "JSON", "stream", ".", "The", "data", "to", "write", "will", "be", "either", "a", "single", "entity", "or", "a", "feed", "depending", "on", "whether", "it", "is", "a", "single", "object", "or", "list", "." ...
eb747d73e9af0f4e59a25b82ed656e526a7e2189
https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_renderer/src/main/java/com/sdl/odata/renderer/json/writer/JsonWriter.java#L168-L215
train
sdl/odata
odata_edm/src/main/java/com/sdl/odata/edm/factory/annotations/AnnotationActionFactory.java
AnnotationActionFactory.build
public Action build(Class<?> cls) { EdmAction edmAction = cls.getAnnotation(EdmAction.class); EdmReturnType edmReturnType = cls.getAnnotation(EdmReturnType.class); Set<Parameter> parameters = new HashSet<>(); for (Field field : cls.getDeclaredFields()) { EdmParameter paramete...
java
public Action build(Class<?> cls) { EdmAction edmAction = cls.getAnnotation(EdmAction.class); EdmReturnType edmReturnType = cls.getAnnotation(EdmReturnType.class); Set<Parameter> parameters = new HashSet<>(); for (Field field : cls.getDeclaredFields()) { EdmParameter paramete...
[ "public", "Action", "build", "(", "Class", "<", "?", ">", "cls", ")", "{", "EdmAction", "edmAction", "=", "cls", ".", "getAnnotation", "(", "EdmAction", ".", "class", ")", ";", "EdmReturnType", "edmReturnType", "=", "cls", ".", "getAnnotation", "(", "EdmRe...
Builds an action instance from given class. @param cls action class. @return instance of action.
[ "Builds", "an", "action", "instance", "from", "given", "class", "." ]
eb747d73e9af0f4e59a25b82ed656e526a7e2189
https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_edm/src/main/java/com/sdl/odata/edm/factory/annotations/AnnotationActionFactory.java#L43-L78
train
sdl/odata
odata_renderer/src/main/java/com/sdl/odata/renderer/AbstractRenderer.java
AbstractRenderer.isEntityQuery
protected boolean isEntityQuery(ODataUri uri, EntityDataModel entityDataModel) { return getTargetType(uri, entityDataModel).map(t -> t.getMetaType() == MetaType.ENTITY).orElse(false); }
java
protected boolean isEntityQuery(ODataUri uri, EntityDataModel entityDataModel) { return getTargetType(uri, entityDataModel).map(t -> t.getMetaType() == MetaType.ENTITY).orElse(false); }
[ "protected", "boolean", "isEntityQuery", "(", "ODataUri", "uri", ",", "EntityDataModel", "entityDataModel", ")", "{", "return", "getTargetType", "(", "uri", ",", "entityDataModel", ")", ".", "map", "(", "t", "->", "t", ".", "getMetaType", "(", ")", "==", "Me...
Check if the parsed OData URI is a query and it results in an entity or a collection of entities. @param uri The parsed OData URI. @param entityDataModel The Entity Data Model. @return {@code true} if it is about an entity query.
[ "Check", "if", "the", "parsed", "OData", "URI", "is", "a", "query", "and", "it", "results", "in", "an", "entity", "or", "a", "collection", "of", "entities", "." ]
eb747d73e9af0f4e59a25b82ed656e526a7e2189
https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_renderer/src/main/java/com/sdl/odata/renderer/AbstractRenderer.java#L106-L108
train
sdl/odata
odata_renderer/src/main/java/com/sdl/odata/renderer/AbstractRenderer.java
AbstractRenderer.buildContextURL
protected String buildContextURL(ODataRequestContext requestContext, Object data) throws ODataRenderException { ODataUri oDataUri = requestContext.getUri(); if (ODataUriUtil.isActionCallUri(oDataUri) || ODataUriUtil.isFunctionCallUri(oDataUri)) { return buildContextUrlFromOperationCall(oData...
java
protected String buildContextURL(ODataRequestContext requestContext, Object data) throws ODataRenderException { ODataUri oDataUri = requestContext.getUri(); if (ODataUriUtil.isActionCallUri(oDataUri) || ODataUriUtil.isFunctionCallUri(oDataUri)) { return buildContextUrlFromOperationCall(oData...
[ "protected", "String", "buildContextURL", "(", "ODataRequestContext", "requestContext", ",", "Object", "data", ")", "throws", "ODataRenderException", "{", "ODataUri", "oDataUri", "=", "requestContext", ".", "getUri", "(", ")", ";", "if", "(", "ODataUriUtil", ".", ...
Build the 'Context URL' from a given OData request context. @param requestContext The given OData request context @param data Result data @return The built 'Context URL' @throws ODataRenderException If unable to build context url
[ "Build", "the", "Context", "URL", "from", "a", "given", "OData", "request", "context", "." ]
eb747d73e9af0f4e59a25b82ed656e526a7e2189
https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_renderer/src/main/java/com/sdl/odata/renderer/AbstractRenderer.java#L205-L220
train
sdl/odata
odata_renderer/src/main/java/com/sdl/odata/renderer/AbstractRenderer.java
AbstractRenderer.checkContextURL
protected void checkContextURL(ODataRequestContext requestContext, Option<String> contextURL) throws ODataRenderException { if (!contextURL.isDefined()) { throw new ODataRenderException( String.format("Not possible to create context URL for request %s", requestContex...
java
protected void checkContextURL(ODataRequestContext requestContext, Option<String> contextURL) throws ODataRenderException { if (!contextURL.isDefined()) { throw new ODataRenderException( String.format("Not possible to create context URL for request %s", requestContex...
[ "protected", "void", "checkContextURL", "(", "ODataRequestContext", "requestContext", ",", "Option", "<", "String", ">", "contextURL", ")", "throws", "ODataRenderException", "{", "if", "(", "!", "contextURL", ".", "isDefined", "(", ")", ")", "{", "throw", "new",...
Check whether the given 'Context URL' is defined. @param requestContext The 'Request Context' used to build the given 'Context URL'. @param contextURL The given 'Context URL'. @throws ODataRenderException if the 'Context URL' is not defined
[ "Check", "whether", "the", "given", "Context", "URL", "is", "defined", "." ]
eb747d73e9af0f4e59a25b82ed656e526a7e2189
https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_renderer/src/main/java/com/sdl/odata/renderer/AbstractRenderer.java#L229-L236
train
sdl/odata
odata_processor/src/main/java/com/sdl/odata/processor/write/ActionPostMethodHandler.java
ActionPostMethodHandler.handleWrite
@Override public ProcessorResult handleWrite(Object action) throws ODataException { Operation operation; if (action instanceof Operation) { operation = (Operation) action; Object data = operation.doOperation(getODataRequestContext(), getDataSourceFactory()); if (d...
java
@Override public ProcessorResult handleWrite(Object action) throws ODataException { Operation operation; if (action instanceof Operation) { operation = (Operation) action; Object data = operation.doOperation(getODataRequestContext(), getDataSourceFactory()); if (d...
[ "@", "Override", "public", "ProcessorResult", "handleWrite", "(", "Object", "action", ")", "throws", "ODataException", "{", "Operation", "operation", ";", "if", "(", "action", "instanceof", "Operation", ")", "{", "operation", "=", "(", "Operation", ")", "action"...
Handles action call and returns result in case when action returns it. @param action The instance of action. @return The result of calling action. @throws ODataException in case of any error.
[ "Handles", "action", "call", "and", "returns", "result", "in", "case", "when", "action", "returns", "it", "." ]
eb747d73e9af0f4e59a25b82ed656e526a7e2189
https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_processor/src/main/java/com/sdl/odata/processor/write/ActionPostMethodHandler.java#L49-L63
train
sdl/odata
odata_renderer/src/main/java/com/sdl/odata/renderer/AbstractPropertyWriter.java
AbstractPropertyWriter.getPropertyAsString
public String getPropertyAsString(Object data) throws ODataException { LOG.trace("GetPropertyAsString invoked with {}", data); if (data != null) { return makePropertyString(data); } else { return generateNullPropertyString(); } }
java
public String getPropertyAsString(Object data) throws ODataException { LOG.trace("GetPropertyAsString invoked with {}", data); if (data != null) { return makePropertyString(data); } else { return generateNullPropertyString(); } }
[ "public", "String", "getPropertyAsString", "(", "Object", "data", ")", "throws", "ODataException", "{", "LOG", ".", "trace", "(", "\"GetPropertyAsString invoked with {}\"", ",", "data", ")", ";", "if", "(", "data", "!=", "null", ")", "{", "return", "makeProperty...
This is main method to get property as string. @param data represents simple primitive or complex value or collections of collection of these. @return String that represents simple primitive or complex value or collections of collection of these in the form of xml or json. @throws ODataException if an error occurs.
[ "This", "is", "main", "method", "to", "get", "property", "as", "string", "." ]
eb747d73e9af0f4e59a25b82ed656e526a7e2189
https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_renderer/src/main/java/com/sdl/odata/renderer/AbstractPropertyWriter.java#L66-L73
train
sdl/odata
odata_renderer/src/main/java/com/sdl/odata/renderer/xml/writer/XMLServiceDocumentWriter.java
XMLServiceDocumentWriter.buildServiceDocument
public String buildServiceDocument() throws ODataRenderException { LOG.info("Building service(root) document"); try (ByteArrayOutputStream outputStream = new ByteArrayOutputStream(BUFFER_SIZE)) { XMLStreamWriter writer = startServiceDocument(outputStream); writeEntitySets(writer...
java
public String buildServiceDocument() throws ODataRenderException { LOG.info("Building service(root) document"); try (ByteArrayOutputStream outputStream = new ByteArrayOutputStream(BUFFER_SIZE)) { XMLStreamWriter writer = startServiceDocument(outputStream); writeEntitySets(writer...
[ "public", "String", "buildServiceDocument", "(", ")", "throws", "ODataRenderException", "{", "LOG", ".", "info", "(", "\"Building service(root) document\"", ")", ";", "try", "(", "ByteArrayOutputStream", "outputStream", "=", "new", "ByteArrayOutputStream", "(", "BUFFER_...
This is main method which generates service document. @return generated service (root collection) document @throws ODataRenderException in case of errors
[ "This", "is", "main", "method", "which", "generates", "service", "document", "." ]
eb747d73e9af0f4e59a25b82ed656e526a7e2189
https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_renderer/src/main/java/com/sdl/odata/renderer/xml/writer/XMLServiceDocumentWriter.java#L76-L92
train
sdl/odata
odata_renderer/src/main/java/com/sdl/odata/renderer/xml/writer/XMLServiceDocumentWriter.java
XMLServiceDocumentWriter.writeEntitySets
private void writeEntitySets(XMLStreamWriter writer) throws XMLStreamException, ODataRenderException { List<EntitySet> entitySets = getEntityContainer().getEntitySets(); LOG.debug("Number of entity sets to be written in service document are {}", entitySets.size()); for (EntitySet entitySet : ent...
java
private void writeEntitySets(XMLStreamWriter writer) throws XMLStreamException, ODataRenderException { List<EntitySet> entitySets = getEntityContainer().getEntitySets(); LOG.debug("Number of entity sets to be written in service document are {}", entitySets.size()); for (EntitySet entitySet : ent...
[ "private", "void", "writeEntitySets", "(", "XMLStreamWriter", "writer", ")", "throws", "XMLStreamException", ",", "ODataRenderException", "{", "List", "<", "EntitySet", ">", "entitySets", "=", "getEntityContainer", "(", ")", ".", "getEntitySets", "(", ")", ";", "L...
This writes all entity sets in entity data model as collection of elements. @param writer which writes to stream. @throws XMLStreamException in case of any xml errors @throws ODataRenderException if entity container is null.
[ "This", "writes", "all", "entity", "sets", "in", "entity", "data", "model", "as", "collection", "of", "elements", "." ]
eb747d73e9af0f4e59a25b82ed656e526a7e2189
https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_renderer/src/main/java/com/sdl/odata/renderer/xml/writer/XMLServiceDocumentWriter.java#L117-L125
train
sdl/odata
odata_renderer/src/main/java/com/sdl/odata/renderer/xml/writer/XMLServiceDocumentWriter.java
XMLServiceDocumentWriter.startServiceDocument
private XMLStreamWriter startServiceDocument(ByteArrayOutputStream outputStream) throws XMLStreamException, ODataRenderException { XMLStreamWriter writer = XMLWriterUtil.startDocument(outputStream, null, SERVICE, ODATA_SERVICE_NS); writer.writeNamespace(ATOM, ATOM_NS); writer.writeNa...
java
private XMLStreamWriter startServiceDocument(ByteArrayOutputStream outputStream) throws XMLStreamException, ODataRenderException { XMLStreamWriter writer = XMLWriterUtil.startDocument(outputStream, null, SERVICE, ODATA_SERVICE_NS); writer.writeNamespace(ATOM, ATOM_NS); writer.writeNa...
[ "private", "XMLStreamWriter", "startServiceDocument", "(", "ByteArrayOutputStream", "outputStream", ")", "throws", "XMLStreamException", ",", "ODataRenderException", "{", "XMLStreamWriter", "writer", "=", "XMLWriterUtil", ".", "startDocument", "(", "outputStream", ",", "nul...
Starts "service" document with correct attributes and also writes "workspace", "title" elements. @param outputStream stream to write to @return XMLStreamWriter to which writing happens @throws XMLStreamException in case of errors @throws ODataRenderException in case of errors
[ "Starts", "service", "document", "with", "correct", "attributes", "and", "also", "writes", "workspace", "title", "elements", "." ]
eb747d73e9af0f4e59a25b82ed656e526a7e2189
https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_renderer/src/main/java/com/sdl/odata/renderer/xml/writer/XMLServiceDocumentWriter.java#L164-L177
train
sdl/odata
odata_renderer/src/main/java/com/sdl/odata/renderer/xml/writer/XMLServiceDocumentWriter.java
XMLServiceDocumentWriter.getEntityContainer
private EntityContainer getEntityContainer() throws ODataRenderException { EntityContainer entityContainer = entityDataModel.getEntityContainer(); if (entityContainer == null) { String message = "EntityContainer should not be null"; LOG.error(message); throw new OData...
java
private EntityContainer getEntityContainer() throws ODataRenderException { EntityContainer entityContainer = entityDataModel.getEntityContainer(); if (entityContainer == null) { String message = "EntityContainer should not be null"; LOG.error(message); throw new OData...
[ "private", "EntityContainer", "getEntityContainer", "(", ")", "throws", "ODataRenderException", "{", "EntityContainer", "entityContainer", "=", "entityDataModel", ".", "getEntityContainer", "(", ")", ";", "if", "(", "entityContainer", "==", "null", ")", "{", "String",...
Returns entity container if it exists in entity data model otherwise throws ODataRenderException. @return EntityContainer if it exist in entity data model @throws ODataRenderException if it is not exists in entity data model
[ "Returns", "entity", "container", "if", "it", "exists", "in", "entity", "data", "model", "otherwise", "throws", "ODataRenderException", "." ]
eb747d73e9af0f4e59a25b82ed656e526a7e2189
https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_renderer/src/main/java/com/sdl/odata/renderer/xml/writer/XMLServiceDocumentWriter.java#L190-L198
train
sdl/odata
odata_renderer/src/main/java/com/sdl/odata/unmarshaller/json/core/JsonNullableValidator.java
JsonNullableValidator.ensureCollection
public void ensureCollection(StructuredType entityType) throws ODataException { List<String> missingCollectionPropertyName = new ArrayList<>(); entityType.getStructuralProperties().stream() .filter(property -> (property.isCollection()) && !(property instanceof Na...
java
public void ensureCollection(StructuredType entityType) throws ODataException { List<String> missingCollectionPropertyName = new ArrayList<>(); entityType.getStructuralProperties().stream() .filter(property -> (property.isCollection()) && !(property instanceof Na...
[ "public", "void", "ensureCollection", "(", "StructuredType", "entityType", ")", "throws", "ODataException", "{", "List", "<", "String", ">", "missingCollectionPropertyName", "=", "new", "ArrayList", "<>", "(", ")", ";", "entityType", ".", "getStructuralProperties", ...
Ensure that non nullable collection are present. @param entityType entityType @throws ODataException If unable to ensure collection is present
[ "Ensure", "that", "non", "nullable", "collection", "are", "present", "." ]
eb747d73e9af0f4e59a25b82ed656e526a7e2189
https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_renderer/src/main/java/com/sdl/odata/unmarshaller/json/core/JsonNullableValidator.java#L52-L70
train
sdl/odata
odata_renderer/src/main/java/com/sdl/odata/unmarshaller/json/core/JsonNullableValidator.java
JsonNullableValidator.ensureNavigationProperties
public void ensureNavigationProperties(StructuredType entityType) throws ODataException { List<String> missingNavigationPropertyNames = new ArrayList<>(); entityType.getStructuralProperties().stream().filter(property -> (property instanceof NavigationProperty) && !property.isNullable())...
java
public void ensureNavigationProperties(StructuredType entityType) throws ODataException { List<String> missingNavigationPropertyNames = new ArrayList<>(); entityType.getStructuralProperties().stream().filter(property -> (property instanceof NavigationProperty) && !property.isNullable())...
[ "public", "void", "ensureNavigationProperties", "(", "StructuredType", "entityType", ")", "throws", "ODataException", "{", "List", "<", "String", ">", "missingNavigationPropertyNames", "=", "new", "ArrayList", "<>", "(", ")", ";", "entityType", ".", "getStructuralProp...
Ensure that non nullable navigation properties are present. @param entityType entityType @throws ODataException If unable to ensure navigation properties are present
[ "Ensure", "that", "non", "nullable", "navigation", "properties", "are", "present", "." ]
eb747d73e9af0f4e59a25b82ed656e526a7e2189
https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_renderer/src/main/java/com/sdl/odata/unmarshaller/json/core/JsonNullableValidator.java#L78-L94
train
sdl/odata
odata_client/src/main/java/com/sdl/odata/client/URLConnectionRequestPropertiesBuilder.java
URLConnectionRequestPropertiesBuilder.withCookie
public URLConnectionRequestPropertiesBuilder withCookie(String cookieName, String cookieValue) { if (requestProperties.containsKey("Cookie")) { // there are existing cookies so just append the new cookie at the end final String cookies = requestProperties.get("Cookie"); reque...
java
public URLConnectionRequestPropertiesBuilder withCookie(String cookieName, String cookieValue) { if (requestProperties.containsKey("Cookie")) { // there are existing cookies so just append the new cookie at the end final String cookies = requestProperties.get("Cookie"); reque...
[ "public", "URLConnectionRequestPropertiesBuilder", "withCookie", "(", "String", "cookieName", ",", "String", "cookieValue", ")", "{", "if", "(", "requestProperties", ".", "containsKey", "(", "\"Cookie\"", ")", ")", "{", "// there are existing cookies so just append the new ...
Add provided cookie to 'Cookie' request property. @param cookieName The cookie name @param cookieValue The ccokie value @return this
[ "Add", "provided", "cookie", "to", "Cookie", "request", "property", "." ]
eb747d73e9af0f4e59a25b82ed656e526a7e2189
https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_client/src/main/java/com/sdl/odata/client/URLConnectionRequestPropertiesBuilder.java#L36-L46
train
sdl/odata
odata_api/src/main/java/com/sdl/odata/util/PrimitiveUtil.java
PrimitiveUtil.wrap
public static <T> Class<T> wrap(Class<T> type) { if (type == null) { throw new IllegalArgumentException(); } Class<T> wrapped = (Class<T>) PRIMITIVE_TO_WRAP.get(type); return (wrapped == null) ? type : wrapped; }
java
public static <T> Class<T> wrap(Class<T> type) { if (type == null) { throw new IllegalArgumentException(); } Class<T> wrapped = (Class<T>) PRIMITIVE_TO_WRAP.get(type); return (wrapped == null) ? type : wrapped; }
[ "public", "static", "<", "T", ">", "Class", "<", "T", ">", "wrap", "(", "Class", "<", "T", ">", "type", ")", "{", "if", "(", "type", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", ")", ";", "}", "Class", "<", "T", ">", ...
Guava wrap alternative. @param type type @return wrapped result
[ "Guava", "wrap", "alternative", "." ]
eb747d73e9af0f4e59a25b82ed656e526a7e2189
https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_api/src/main/java/com/sdl/odata/util/PrimitiveUtil.java#L67-L74
train
sdl/odata
odata_api/src/main/java/com/sdl/odata/util/PrimitiveUtil.java
PrimitiveUtil.unwrap
public static <T> Class<T> unwrap(Class<T> type) { if (type == null) { throw new IllegalArgumentException(); } Class<T> unwrapped = (Class<T>) WRAP_TO_PRIMITIVE.get(type); return (unwrapped == null) ? type : unwrapped; }
java
public static <T> Class<T> unwrap(Class<T> type) { if (type == null) { throw new IllegalArgumentException(); } Class<T> unwrapped = (Class<T>) WRAP_TO_PRIMITIVE.get(type); return (unwrapped == null) ? type : unwrapped; }
[ "public", "static", "<", "T", ">", "Class", "<", "T", ">", "unwrap", "(", "Class", "<", "T", ">", "type", ")", "{", "if", "(", "type", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", ")", ";", "}", "Class", "<", "T", ">",...
Guava unwrap alternative. @param type type @return unwrapped result
[ "Guava", "unwrap", "alternative", "." ]
eb747d73e9af0f4e59a25b82ed656e526a7e2189
https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_api/src/main/java/com/sdl/odata/util/PrimitiveUtil.java#L82-L89
train
sdl/odata
odata_client/src/main/java/com/sdl/odata/client/AbstractODataClientComponentsProvider.java
AbstractODataClientComponentsProvider.initializeEndpointCaller
public static EndpointCaller initializeEndpointCaller(Properties properties) { EndpointCaller ec; try { LOG.debug("Initializing endpoint caller. Checking whether '{}' is in classpath.", TRACING_ENDPOINT_CALLER_CLASSNAME); Class<?> tracingEndpointCallerClass = ...
java
public static EndpointCaller initializeEndpointCaller(Properties properties) { EndpointCaller ec; try { LOG.debug("Initializing endpoint caller. Checking whether '{}' is in classpath.", TRACING_ENDPOINT_CALLER_CLASSNAME); Class<?> tracingEndpointCallerClass = ...
[ "public", "static", "EndpointCaller", "initializeEndpointCaller", "(", "Properties", "properties", ")", "{", "EndpointCaller", "ec", ";", "try", "{", "LOG", ".", "debug", "(", "\"Initializing endpoint caller. Checking whether '{}' is in classpath.\"", ",", "TRACING_ENDPOINT_C...
If the TracingEndpointCaller class is in a classpath - use it, otherwise use BasicEndpointCaller. @param properties properties argument for endpoint caller @return endpoint caller instance
[ "If", "the", "TracingEndpointCaller", "class", "is", "in", "a", "classpath", "-", "use", "it", "otherwise", "use", "BasicEndpointCaller", "." ]
eb747d73e9af0f4e59a25b82ed656e526a7e2189
https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_client/src/main/java/com/sdl/odata/client/AbstractODataClientComponentsProvider.java#L64-L79
train
sdl/odata
odata_edm/src/main/java/com/sdl/odata/edm/factory/annotations/AnnotationFunctionImportFactory.java
AnnotationFunctionImportFactory.addFunctionImport
public void addFunctionImport(Class<?> cls) { EdmFunctionImport functionImportAnnotation = cls.getAnnotation(EdmFunctionImport.class); FunctionImportImpl.Builder functionImportBuilder = new FunctionImportImpl.Builder() .setEntitySetName(functionImportAnnotation.entitySet()) ...
java
public void addFunctionImport(Class<?> cls) { EdmFunctionImport functionImportAnnotation = cls.getAnnotation(EdmFunctionImport.class); FunctionImportImpl.Builder functionImportBuilder = new FunctionImportImpl.Builder() .setEntitySetName(functionImportAnnotation.entitySet()) ...
[ "public", "void", "addFunctionImport", "(", "Class", "<", "?", ">", "cls", ")", "{", "EdmFunctionImport", "functionImportAnnotation", "=", "cls", ".", "getAnnotation", "(", "EdmFunctionImport", ".", "class", ")", ";", "FunctionImportImpl", ".", "Builder", "functio...
Add function import to builder of this factory by specified class. @param cls function import class
[ "Add", "function", "import", "to", "builder", "of", "this", "factory", "by", "specified", "class", "." ]
eb747d73e9af0f4e59a25b82ed656e526a7e2189
https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_edm/src/main/java/com/sdl/odata/edm/factory/annotations/AnnotationFunctionImportFactory.java#L41-L51
train
sdl/odata
odata_edm/src/main/java/com/sdl/odata/edm/factory/annotations/AnnotationFunctionImportFactory.java
AnnotationFunctionImportFactory.build
public Iterable<FunctionImport> build(FactoryLookup lookup) { List<FunctionImport> builder = new ArrayList<>(); for (FunctionImportImpl.Builder functionImportBuilder : functionImportBuilders) { EntitySet entitySet = lookup.getEntitySet(functionImportBuilder.getEntitySetName()); F...
java
public Iterable<FunctionImport> build(FactoryLookup lookup) { List<FunctionImport> builder = new ArrayList<>(); for (FunctionImportImpl.Builder functionImportBuilder : functionImportBuilders) { EntitySet entitySet = lookup.getEntitySet(functionImportBuilder.getEntitySetName()); F...
[ "public", "Iterable", "<", "FunctionImport", ">", "build", "(", "FactoryLookup", "lookup", ")", "{", "List", "<", "FunctionImport", ">", "builder", "=", "new", "ArrayList", "<>", "(", ")", ";", "for", "(", "FunctionImportImpl", ".", "Builder", "functionImportB...
Returns built function imports using passed lookup for searching entity sets and functions for appropriate function import. @param lookup lookup to search entity sets and functions for appropriate function import @return built function imports
[ "Returns", "built", "function", "imports", "using", "passed", "lookup", "for", "searching", "entity", "sets", "and", "functions", "for", "appropriate", "function", "import", "." ]
eb747d73e9af0f4e59a25b82ed656e526a7e2189
https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_edm/src/main/java/com/sdl/odata/edm/factory/annotations/AnnotationFunctionImportFactory.java#L59-L75
train
sdl/odata
odata_edm/src/main/java/com/sdl/odata/edm/factory/annotations/AnnotationFunctionImportFactory.java
AnnotationFunctionImportFactory.getFullyQualifiedFunctionImportName
public static String getFullyQualifiedFunctionImportName(EdmFunctionImport functionImportAnnotation, Class<?> functionImportClass) { String name = getTypeName(functionImportAnnotation, functionImportClass); String namespace = getNamespace(func...
java
public static String getFullyQualifiedFunctionImportName(EdmFunctionImport functionImportAnnotation, Class<?> functionImportClass) { String name = getTypeName(functionImportAnnotation, functionImportClass); String namespace = getNamespace(func...
[ "public", "static", "String", "getFullyQualifiedFunctionImportName", "(", "EdmFunctionImport", "functionImportAnnotation", ",", "Class", "<", "?", ">", "functionImportClass", ")", "{", "String", "name", "=", "getTypeName", "(", "functionImportAnnotation", ",", "functionIm...
Returns fully qualified function import name by function import annotation and class. @param functionImportAnnotation function import annotation @param functionImportClass function import class @return fully qualified function import name
[ "Returns", "fully", "qualified", "function", "import", "name", "by", "function", "import", "annotation", "and", "class", "." ]
eb747d73e9af0f4e59a25b82ed656e526a7e2189
https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_edm/src/main/java/com/sdl/odata/edm/factory/annotations/AnnotationFunctionImportFactory.java#L103-L108
train
sdl/odata
odata_processor/src/main/java/com/sdl/odata/processor/write/WriteMethodHandler.java
WriteMethodHandler.validateProperties
protected void validateProperties(final Object entity, final EntityDataModel edm) throws ODataException { final Type type = edm.getType(entity.getClass()); // No validation needed if it is not a structured type if (!(type instanceof StructuredType)) { return; } ...
java
protected void validateProperties(final Object entity, final EntityDataModel edm) throws ODataException { final Type type = edm.getType(entity.getClass()); // No validation needed if it is not a structured type if (!(type instanceof StructuredType)) { return; } ...
[ "protected", "void", "validateProperties", "(", "final", "Object", "entity", ",", "final", "EntityDataModel", "edm", ")", "throws", "ODataException", "{", "final", "Type", "type", "=", "edm", ".", "getType", "(", "entity", ".", "getClass", "(", ")", ")", ";"...
Checks if all non-nullable properties of an entity are non-empty. @param entity The entity to check. @throws ODataBadRequestException If any of the non-nullable properties of the entity are empty.
[ "Checks", "if", "all", "non", "-", "nullable", "properties", "of", "an", "entity", "are", "non", "-", "empty", "." ]
eb747d73e9af0f4e59a25b82ed656e526a7e2189
https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_processor/src/main/java/com/sdl/odata/processor/write/WriteMethodHandler.java#L199-L221
train
sdl/odata
odata_renderer/src/main/java/com/sdl/odata/renderer/json/writer/JsonServiceDocumentWriter.java
JsonServiceDocumentWriter.buildJson
public String buildJson() throws ODataRenderException { LOG.debug("Start building Json service root document"); try (ByteArrayOutputStream stream = new ByteArrayOutputStream()) { JsonGenerator jsonGenerator = JSON_FACTORY.createGenerator(stream, JsonEncoding.UTF8); jsonGenerator....
java
public String buildJson() throws ODataRenderException { LOG.debug("Start building Json service root document"); try (ByteArrayOutputStream stream = new ByteArrayOutputStream()) { JsonGenerator jsonGenerator = JSON_FACTORY.createGenerator(stream, JsonEncoding.UTF8); jsonGenerator....
[ "public", "String", "buildJson", "(", ")", "throws", "ODataRenderException", "{", "LOG", ".", "debug", "(", "\"Start building Json service root document\"", ")", ";", "try", "(", "ByteArrayOutputStream", "stream", "=", "new", "ByteArrayOutputStream", "(", ")", ")", ...
The main method for Writer. It builds the service root document according to spec. @return output in json @throws ODataRenderException If unable to render the json service document
[ "The", "main", "method", "for", "Writer", ".", "It", "builds", "the", "service", "root", "document", "according", "to", "spec", "." ]
eb747d73e9af0f4e59a25b82ed656e526a7e2189
https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_renderer/src/main/java/com/sdl/odata/renderer/json/writer/JsonServiceDocumentWriter.java#L68-L96
train
sdl/odata
odata_renderer/src/main/java/com/sdl/odata/renderer/json/writer/JsonServiceDocumentWriter.java
JsonServiceDocumentWriter.writeName
private void writeName(JsonGenerator jsonGenerator, Object entity) throws IOException { jsonGenerator.writeFieldName(NAME); if (entity instanceof EntitySet) { jsonGenerator.writeObject(((EntitySet) entity).getName()); } else { jsonGenerator.writeObject(((Singleton) entity...
java
private void writeName(JsonGenerator jsonGenerator, Object entity) throws IOException { jsonGenerator.writeFieldName(NAME); if (entity instanceof EntitySet) { jsonGenerator.writeObject(((EntitySet) entity).getName()); } else { jsonGenerator.writeObject(((Singleton) entity...
[ "private", "void", "writeName", "(", "JsonGenerator", "jsonGenerator", ",", "Object", "entity", ")", "throws", "IOException", "{", "jsonGenerator", ".", "writeFieldName", "(", "NAME", ")", ";", "if", "(", "entity", "instanceof", "EntitySet", ")", "{", "jsonGener...
Writes the name of the entity It is a MUST element. @param jsonGenerator jsonGenerator @param entity entity from the container
[ "Writes", "the", "name", "of", "the", "entity", "It", "is", "a", "MUST", "element", "." ]
eb747d73e9af0f4e59a25b82ed656e526a7e2189
https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_renderer/src/main/java/com/sdl/odata/renderer/json/writer/JsonServiceDocumentWriter.java#L123-L130
train
sdl/odata
odata_renderer/src/main/java/com/sdl/odata/renderer/json/writer/JsonServiceDocumentWriter.java
JsonServiceDocumentWriter.writeKind
private void writeKind(JsonGenerator jsonGenerator, Object entity) throws IOException { jsonGenerator.writeFieldName(KIND); if (entity instanceof EntitySet) { jsonGenerator.writeObject(ENTITY_SET); } else { jsonGenerator.writeObject(SINGLETON); } }
java
private void writeKind(JsonGenerator jsonGenerator, Object entity) throws IOException { jsonGenerator.writeFieldName(KIND); if (entity instanceof EntitySet) { jsonGenerator.writeObject(ENTITY_SET); } else { jsonGenerator.writeObject(SINGLETON); } }
[ "private", "void", "writeKind", "(", "JsonGenerator", "jsonGenerator", ",", "Object", "entity", ")", "throws", "IOException", "{", "jsonGenerator", ".", "writeFieldName", "(", "KIND", ")", ";", "if", "(", "entity", "instanceof", "EntitySet", ")", "{", "jsonGener...
Writes the kind of the entity. @param jsonGenerator jsonGenerator @param entity entity from the container
[ "Writes", "the", "kind", "of", "the", "entity", "." ]
eb747d73e9af0f4e59a25b82ed656e526a7e2189
https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_renderer/src/main/java/com/sdl/odata/renderer/json/writer/JsonServiceDocumentWriter.java#L138-L145
train
sdl/odata
odata_renderer/src/main/java/com/sdl/odata/renderer/json/writer/JsonServiceDocumentWriter.java
JsonServiceDocumentWriter.writeURL
private void writeURL(JsonGenerator jsonGenerator, Object entity) throws IOException { // It is exactly the same as the 'name' property. jsonGenerator.writeFieldName(URL); if (entity instanceof EntitySet) { jsonGenerator.writeObject(((EntitySet) entity).getName()); } else { ...
java
private void writeURL(JsonGenerator jsonGenerator, Object entity) throws IOException { // It is exactly the same as the 'name' property. jsonGenerator.writeFieldName(URL); if (entity instanceof EntitySet) { jsonGenerator.writeObject(((EntitySet) entity).getName()); } else { ...
[ "private", "void", "writeURL", "(", "JsonGenerator", "jsonGenerator", ",", "Object", "entity", ")", "throws", "IOException", "{", "// It is exactly the same as the 'name' property.", "jsonGenerator", ".", "writeFieldName", "(", "URL", ")", ";", "if", "(", "entity", "i...
Writes the url of the entity It is a MUST element. @param jsonGenerator jsonGenerator @param entity entity from the container
[ "Writes", "the", "url", "of", "the", "entity", "It", "is", "a", "MUST", "element", "." ]
eb747d73e9af0f4e59a25b82ed656e526a7e2189
https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_renderer/src/main/java/com/sdl/odata/renderer/json/writer/JsonServiceDocumentWriter.java#L154-L162
train
sdl/odata
odata_renderer/src/main/java/com/sdl/odata/ODataRendererUtils.java
ODataRendererUtils.buildContextUrlFromOperationCall
public static String buildContextUrlFromOperationCall(ODataUri oDataUri, EntityDataModel entityDataModel, boolean isPrimitive) { String serviceRoot = oDataUri.serviceRoot(); String returnType = ODataUriUtil.getOperationReturnType(oDataUri, entity...
java
public static String buildContextUrlFromOperationCall(ODataUri oDataUri, EntityDataModel entityDataModel, boolean isPrimitive) { String serviceRoot = oDataUri.serviceRoot(); String returnType = ODataUriUtil.getOperationReturnType(oDataUri, entity...
[ "public", "static", "String", "buildContextUrlFromOperationCall", "(", "ODataUri", "oDataUri", ",", "EntityDataModel", "entityDataModel", ",", "boolean", "isPrimitive", ")", "{", "String", "serviceRoot", "=", "oDataUri", ".", "serviceRoot", "(", ")", ";", "String", ...
Builds the 'Context URL' when the request is an action or function call. @param oDataUri The odata uri @param entityDataModel The entity data model. @param isPrimitive True if the context URL is for primitive. @return The built 'Context URL'. @see <a href= "http://docs.oasis-open.org/odata/odata/v4.0/os/par...
[ "Builds", "the", "Context", "URL", "when", "the", "request", "is", "an", "action", "or", "function", "call", "." ]
eb747d73e9af0f4e59a25b82ed656e526a7e2189
https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_renderer/src/main/java/com/sdl/odata/ODataRendererUtils.java#L90-L95
train
sdl/odata
odata_renderer/src/main/java/com/sdl/odata/ODataRendererUtils.java
ODataRendererUtils.checkNotNull
public static <T> T checkNotNull(T reference, String message, Object... args) { if (reference == null) { throw new IllegalArgumentException(String.format(message, args)); } return reference; }
java
public static <T> T checkNotNull(T reference, String message, Object... args) { if (reference == null) { throw new IllegalArgumentException(String.format(message, args)); } return reference; }
[ "public", "static", "<", "T", ">", "T", "checkNotNull", "(", "T", "reference", ",", "String", "message", ",", "Object", "...", "args", ")", "{", "if", "(", "reference", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "String", "....
Check if the reference is not null. This differs from Guava that throws Illegal Argument Exception + message. @param reference reference @param message error message @param args arguments @param <T> type @return reference or exception
[ "Check", "if", "the", "reference", "is", "not", "null", ".", "This", "differs", "from", "Guava", "that", "throws", "Illegal", "Argument", "Exception", "+", "message", "." ]
eb747d73e9af0f4e59a25b82ed656e526a7e2189
https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_renderer/src/main/java/com/sdl/odata/ODataRendererUtils.java#L122-L127
train
sdl/odata
odata_renderer/src/main/java/com/sdl/odata/ODataRendererUtils.java
ODataRendererUtils.isForceExpandParamSet
public static boolean isForceExpandParamSet(ODataUri oDataUri) { if (isFunctionCallUri(oDataUri)) { // Check if we have expand param set to true Option<scala.collection.immutable.Map<String, String>> params = getFunctionCallParameters(oDataUri); if (params.isDefined() && !pa...
java
public static boolean isForceExpandParamSet(ODataUri oDataUri) { if (isFunctionCallUri(oDataUri)) { // Check if we have expand param set to true Option<scala.collection.immutable.Map<String, String>> params = getFunctionCallParameters(oDataUri); if (params.isDefined() && !pa...
[ "public", "static", "boolean", "isForceExpandParamSet", "(", "ODataUri", "oDataUri", ")", "{", "if", "(", "isFunctionCallUri", "(", "oDataUri", ")", ")", "{", "// Check if we have expand param set to true", "Option", "<", "scala", ".", "collection", ".", "immutable", ...
Checks if we are trying to force expand all Nav properties for function calls by looking at expand parameter. @param oDataUri The OData URI @return boolean if force expand parameter is set
[ "Checks", "if", "we", "are", "trying", "to", "force", "expand", "all", "Nav", "properties", "for", "function", "calls", "by", "looking", "at", "expand", "parameter", "." ]
eb747d73e9af0f4e59a25b82ed656e526a7e2189
https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_renderer/src/main/java/com/sdl/odata/ODataRendererUtils.java#L135-L148
train
sdl/odata
odata_api/src/main/java/com/sdl/odata/util/AnnotationsUtil.java
AnnotationsUtil.checkAnnotationPresent
public static <T extends Annotation> T checkAnnotationPresent(AnnotatedElement annotatedType, Class<T> annotationClass) { return getAnnotation(annotatedType, annotationClass); }
java
public static <T extends Annotation> T checkAnnotationPresent(AnnotatedElement annotatedType, Class<T> annotationClass) { return getAnnotation(annotatedType, annotationClass); }
[ "public", "static", "<", "T", "extends", "Annotation", ">", "T", "checkAnnotationPresent", "(", "AnnotatedElement", "annotatedType", ",", "Class", "<", "T", ">", "annotationClass", ")", "{", "return", "getAnnotation", "(", "annotatedType", ",", "annotationClass", ...
Check if the annotation is present and if not throws an exception, this is just an overload for more clear naming. @param annotatedType The source type to tcheck the annotation on @param annotationClass The annotation to look for @param <T> The annotation subtype @return The annotation that was requested...
[ "Check", "if", "the", "annotation", "is", "present", "and", "if", "not", "throws", "an", "exception", "this", "is", "just", "an", "overload", "for", "more", "clear", "naming", "." ]
eb747d73e9af0f4e59a25b82ed656e526a7e2189
https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_api/src/main/java/com/sdl/odata/util/AnnotationsUtil.java#L43-L46
train
sdl/odata
odata_renderer/src/main/java/com/sdl/odata/renderer/batch/ODataBatchRequestRenderer.java
ODataBatchRequestRenderer.score
@Override public int score(ODataRequestContext requestContext, QueryResult data) { if (data.getType() == QueryResult.ResultType.NOTHING || data.getType() != QueryResult.ResultType.EXCEPTION) { return DEFAULT_SCORE; } if (data.getData() instanceof ODataBatchException) { ...
java
@Override public int score(ODataRequestContext requestContext, QueryResult data) { if (data.getType() == QueryResult.ResultType.NOTHING || data.getType() != QueryResult.ResultType.EXCEPTION) { return DEFAULT_SCORE; } if (data.getData() instanceof ODataBatchException) { ...
[ "@", "Override", "public", "int", "score", "(", "ODataRequestContext", "requestContext", ",", "QueryResult", "data", ")", "{", "if", "(", "data", ".", "getType", "(", ")", "==", "QueryResult", ".", "ResultType", ".", "NOTHING", "||", "data", ".", "getType", ...
Batch score mechanism exists not only for simple rendering, but also for computing batch error scores. @param requestContext The request context. @param data The data to render. @return batch score
[ "Batch", "score", "mechanism", "exists", "not", "only", "for", "simple", "rendering", "but", "also", "for", "computing", "batch", "error", "scores", "." ]
eb747d73e9af0f4e59a25b82ed656e526a7e2189
https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_renderer/src/main/java/com/sdl/odata/renderer/batch/ODataBatchRequestRenderer.java#L83-L99
train
sdl/odata
odata_processor/src/main/java/com/sdl/odata/processor/write/BatchMethodHandler.java
BatchMethodHandler.handleWrite
public List<ProcessorResult> handleWrite() throws ODataException { LOG.info("Handling transactional operations per each odata request."); List<ProcessorResult> resultList = new ArrayList<>(); try { for (ChangeSetEntity changeSetEntity : changeSetEntities) { ODataRequ...
java
public List<ProcessorResult> handleWrite() throws ODataException { LOG.info("Handling transactional operations per each odata request."); List<ProcessorResult> resultList = new ArrayList<>(); try { for (ChangeSetEntity changeSetEntity : changeSetEntities) { ODataRequ...
[ "public", "List", "<", "ProcessorResult", ">", "handleWrite", "(", ")", "throws", "ODataException", "{", "LOG", ".", "info", "(", "\"Handling transactional operations per each odata request.\"", ")", ";", "List", "<", "ProcessorResult", ">", "resultList", "=", "new", ...
Handles transactional operations for each parsed odata request. @return processor results
[ "Handles", "transactional", "operations", "for", "each", "parsed", "odata", "request", "." ]
eb747d73e9af0f4e59a25b82ed656e526a7e2189
https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_processor/src/main/java/com/sdl/odata/processor/write/BatchMethodHandler.java#L72-L100
train
sdl/odata
odata_processor/src/main/java/com/sdl/odata/processor/write/BatchMethodHandler.java
BatchMethodHandler.getRequestType
private Type getRequestType(ODataRequest oDataRequest, ODataUri oDataUri) throws ODataTargetTypeException { TargetType targetType = WriteMethodUtil.getTargetType(oDataRequest, entityDataModel, oDataUri); return entityDataModel.getType(targetType.typeName()); }
java
private Type getRequestType(ODataRequest oDataRequest, ODataUri oDataUri) throws ODataTargetTypeException { TargetType targetType = WriteMethodUtil.getTargetType(oDataRequest, entityDataModel, oDataUri); return entityDataModel.getType(targetType.typeName()); }
[ "private", "Type", "getRequestType", "(", "ODataRequest", "oDataRequest", ",", "ODataUri", "oDataUri", ")", "throws", "ODataTargetTypeException", "{", "TargetType", "targetType", "=", "WriteMethodUtil", ".", "getTargetType", "(", "oDataRequest", ",", "entityDataModel", ...
Returns request type for the given odata uri. @param oDataUri the odata uri @return the request type @throws ODataTargetTypeException if unable to determine request type
[ "Returns", "request", "type", "for", "the", "given", "odata", "uri", "." ]
eb747d73e9af0f4e59a25b82ed656e526a7e2189
https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_processor/src/main/java/com/sdl/odata/processor/write/BatchMethodHandler.java#L201-L204
train
sdl/odata
odata_processor/src/main/java/com/sdl/odata/processor/write/BatchMethodHandler.java
BatchMethodHandler.getTransactionalDataSource
private TransactionalDataSource getTransactionalDataSource( ODataRequestContext odataRequestContext, Type type) throws ODataException { DataSource dataSource = dataSourceFactory.getDataSource(odataRequestContext, type.getFullyQualifiedName()); String dataSourceKey = dataSource.getClass().toS...
java
private TransactionalDataSource getTransactionalDataSource( ODataRequestContext odataRequestContext, Type type) throws ODataException { DataSource dataSource = dataSourceFactory.getDataSource(odataRequestContext, type.getFullyQualifiedName()); String dataSourceKey = dataSource.getClass().toS...
[ "private", "TransactionalDataSource", "getTransactionalDataSource", "(", "ODataRequestContext", "odataRequestContext", ",", "Type", "type", ")", "throws", "ODataException", "{", "DataSource", "dataSource", "=", "dataSourceFactory", ".", "getDataSource", "(", "odataRequestCont...
If it's the first batch request call - start transaction. @param type The type of the entity to request a datasource for
[ "If", "it", "s", "the", "first", "batch", "request", "call", "-", "start", "transaction", "." ]
eb747d73e9af0f4e59a25b82ed656e526a7e2189
https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_processor/src/main/java/com/sdl/odata/processor/write/BatchMethodHandler.java#L210-L222
train
sdl/odata
odata_client_api/src/main/java/com/sdl/odata/client/property/PropertyUtils.java
PropertyUtils.getIntegerProperty
public static Integer getIntegerProperty(Properties properties, String key) { String property = getStringProperty(properties, key); if (property == null) { return null; } Integer value; try { value = Integer.parseInt(property); } catch (RuntimeExce...
java
public static Integer getIntegerProperty(Properties properties, String key) { String property = getStringProperty(properties, key); if (property == null) { return null; } Integer value; try { value = Integer.parseInt(property); } catch (RuntimeExce...
[ "public", "static", "Integer", "getIntegerProperty", "(", "Properties", "properties", ",", "String", "key", ")", "{", "String", "property", "=", "getStringProperty", "(", "properties", ",", "key", ")", ";", "if", "(", "property", "==", "null", ")", "{", "ret...
Get an integer property from the properties. @param properties the provided properties @return the integer property
[ "Get", "an", "integer", "property", "from", "the", "properties", "." ]
eb747d73e9af0f4e59a25b82ed656e526a7e2189
https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_client_api/src/main/java/com/sdl/odata/client/property/PropertyUtils.java#L42-L54
train
sdl/odata
odata_client_api/src/main/java/com/sdl/odata/client/property/PropertyUtils.java
PropertyUtils.getStringProperty
public static String getStringProperty(Properties properties, String key) { String property = properties.getProperty(key); return property != null && property.trim().isEmpty() ? null : property; }
java
public static String getStringProperty(Properties properties, String key) { String property = properties.getProperty(key); return property != null && property.trim().isEmpty() ? null : property; }
[ "public", "static", "String", "getStringProperty", "(", "Properties", "properties", ",", "String", "key", ")", "{", "String", "property", "=", "properties", ".", "getProperty", "(", "key", ")", ";", "return", "property", "!=", "null", "&&", "property", ".", ...
Get a string property from the properties. @param properties the provided properties @return the string property
[ "Get", "a", "string", "property", "from", "the", "properties", "." ]
eb747d73e9af0f4e59a25b82ed656e526a7e2189
https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_client_api/src/main/java/com/sdl/odata/client/property/PropertyUtils.java#L67-L70
train
sdl/odata
odata_client_api/src/main/java/com/sdl/odata/client/property/PropertyUtils.java
PropertyUtils.getLongProperty
public static Long getLongProperty(String property) { if (property == null) { return null; } Long propertyLong = null; try { propertyLong = Long.valueOf(property); } catch (NumberFormatException e) { LOG.warn("Cannot convert string value into n...
java
public static Long getLongProperty(String property) { if (property == null) { return null; } Long propertyLong = null; try { propertyLong = Long.valueOf(property); } catch (NumberFormatException e) { LOG.warn("Cannot convert string value into n...
[ "public", "static", "Long", "getLongProperty", "(", "String", "property", ")", "{", "if", "(", "property", "==", "null", ")", "{", "return", "null", ";", "}", "Long", "propertyLong", "=", "null", ";", "try", "{", "propertyLong", "=", "Long", ".", "valueO...
Get a long property from properties. @param property the property as string @return The property as long or null if could not convert
[ "Get", "a", "long", "property", "from", "properties", "." ]
eb747d73e9af0f4e59a25b82ed656e526a7e2189
https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_client_api/src/main/java/com/sdl/odata/client/property/PropertyUtils.java#L78-L89
train
sdl/odata
odata_renderer/src/main/java/com/sdl/odata/renderer/xml/util/XMLWriterUtil.java
XMLWriterUtil.startDocument
public static XMLStreamWriter startDocument(ByteArrayOutputStream outputStream, String prefix, String documentRootName, String nameSpaceURI) throws XMLStreamException { XMLStreamWriter writer = XML_OUTPUT_FACTORY.createXMLStreamWriter(outputStream, UTF...
java
public static XMLStreamWriter startDocument(ByteArrayOutputStream outputStream, String prefix, String documentRootName, String nameSpaceURI) throws XMLStreamException { XMLStreamWriter writer = XML_OUTPUT_FACTORY.createXMLStreamWriter(outputStream, UTF...
[ "public", "static", "XMLStreamWriter", "startDocument", "(", "ByteArrayOutputStream", "outputStream", ",", "String", "prefix", ",", "String", "documentRootName", ",", "String", "nameSpaceURI", ")", "throws", "XMLStreamException", "{", "XMLStreamWriter", "writer", "=", "...
Creates document root with given name. @param outputStream stream to write to @param prefix if given prefix is not null then root element will be prefixed followed by ":" and documentRootName @param documentRootName name of the document root element. This should not be null. Null check not done @param na...
[ "Creates", "document", "root", "with", "given", "name", "." ]
eb747d73e9af0f4e59a25b82ed656e526a7e2189
https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_renderer/src/main/java/com/sdl/odata/renderer/xml/util/XMLWriterUtil.java#L121-L134
train
sdl/odata
odata_renderer/src/main/java/com/sdl/odata/renderer/json/util/JsonWriterUtil.java
JsonWriterUtil.writePrimitiveValue
public static void writePrimitiveValue(Object primitiveValue, JsonGenerator jsonGenerator) throws IOException { Class<?> primitiveClass = PrimitiveUtil.wrap(primitiveValue.getClass()); if (String.class.isAssignableFrom(primitiveClass)) { jsonGenerator.writeString(String.valueOf(primitiveVal...
java
public static void writePrimitiveValue(Object primitiveValue, JsonGenerator jsonGenerator) throws IOException { Class<?> primitiveClass = PrimitiveUtil.wrap(primitiveValue.getClass()); if (String.class.isAssignableFrom(primitiveClass)) { jsonGenerator.writeString(String.valueOf(primitiveVal...
[ "public", "static", "void", "writePrimitiveValue", "(", "Object", "primitiveValue", ",", "JsonGenerator", "jsonGenerator", ")", "throws", "IOException", "{", "Class", "<", "?", ">", "primitiveClass", "=", "PrimitiveUtil", ".", "wrap", "(", "primitiveValue", ".", "...
Write the given primitive value to the JSON stream by using the given JSON generator. @param primitiveValue The given primitive value to write. @param jsonGenerator The given JSON generator. @throws IOException If unable to write to the json output stream
[ "Write", "the", "given", "primitive", "value", "to", "the", "JSON", "stream", "by", "using", "the", "given", "JSON", "generator", "." ]
eb747d73e9af0f4e59a25b82ed656e526a7e2189
https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_renderer/src/main/java/com/sdl/odata/renderer/json/util/JsonWriterUtil.java#L40-L66
train
sdl/odata
odata_edm/src/main/java/com/sdl/odata/edm/factory/annotations/AnnotationFunctionFactory.java
AnnotationFunctionFactory.build
public Function build(Class<?> cls) { EdmFunction edmFunction = cls.getAnnotation(EdmFunction.class); EdmReturnType edmReturnType = cls.getAnnotation(EdmReturnType.class); if (edmReturnType == null) { throw new IllegalArgumentException( "The class must have EdmRet...
java
public Function build(Class<?> cls) { EdmFunction edmFunction = cls.getAnnotation(EdmFunction.class); EdmReturnType edmReturnType = cls.getAnnotation(EdmReturnType.class); if (edmReturnType == null) { throw new IllegalArgumentException( "The class must have EdmRet...
[ "public", "Function", "build", "(", "Class", "<", "?", ">", "cls", ")", "{", "EdmFunction", "edmFunction", "=", "cls", ".", "getAnnotation", "(", "EdmFunction", ".", "class", ")", ";", "EdmReturnType", "edmReturnType", "=", "cls", ".", "getAnnotation", "(", ...
Method to build Function implementation with parameters by class. @param cls function class @return built function
[ "Method", "to", "build", "Function", "implementation", "with", "parameters", "by", "class", "." ]
eb747d73e9af0f4e59a25b82ed656e526a7e2189
https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_edm/src/main/java/com/sdl/odata/edm/factory/annotations/AnnotationFunctionFactory.java#L42-L81
train
sdl/odata
odata_edm/src/main/java/com/sdl/odata/edm/factory/annotations/AnnotationFunctionFactory.java
AnnotationFunctionFactory.getFullyQualifiedFunctionName
public static String getFullyQualifiedFunctionName(EdmFunction functionAnnotation, Class<?> functionClass) { String name = getTypeName(functionAnnotation, functionClass); String namespace = getNamespace(functionAnnotation, functionClass); return namespace + "." + name; }
java
public static String getFullyQualifiedFunctionName(EdmFunction functionAnnotation, Class<?> functionClass) { String name = getTypeName(functionAnnotation, functionClass); String namespace = getNamespace(functionAnnotation, functionClass); return namespace + "." + name; }
[ "public", "static", "String", "getFullyQualifiedFunctionName", "(", "EdmFunction", "functionAnnotation", ",", "Class", "<", "?", ">", "functionClass", ")", "{", "String", "name", "=", "getTypeName", "(", "functionAnnotation", ",", "functionClass", ")", ";", "String"...
Returned fully qualified function name using function annotation and class. @param functionAnnotation function annotation @param functionClass function class @return fully qualified function name
[ "Returned", "fully", "qualified", "function", "name", "using", "function", "annotation", "and", "class", "." ]
eb747d73e9af0f4e59a25b82ed656e526a7e2189
https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_edm/src/main/java/com/sdl/odata/edm/factory/annotations/AnnotationFunctionFactory.java#L107-L111
train
sdl/odata
odata_renderer/src/main/java/com/sdl/odata/unmarshaller/AbstractUnmarshaller.java
AbstractUnmarshaller.isRightMethodForUnmarshall
protected boolean isRightMethodForUnmarshall(ODataRequest request) { ODataRequest.Method method = request.getMethod(); return isPostMethod(method) || isPatchMethod(method) || isPutMethod(method); }
java
protected boolean isRightMethodForUnmarshall(ODataRequest request) { ODataRequest.Method method = request.getMethod(); return isPostMethod(method) || isPatchMethod(method) || isPutMethod(method); }
[ "protected", "boolean", "isRightMethodForUnmarshall", "(", "ODataRequest", "request", ")", "{", "ODataRequest", ".", "Method", "method", "=", "request", ".", "getMethod", "(", ")", ";", "return", "isPostMethod", "(", "method", ")", "||", "isPatchMethod", "(", "m...
This method checks request method is PUT or POST or PATCH. @param request is ODataRequest @return true if requested method is PUT or POST or PATCH otherwise false
[ "This", "method", "checks", "request", "method", "is", "PUT", "or", "POST", "or", "PATCH", "." ]
eb747d73e9af0f4e59a25b82ed656e526a7e2189
https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_renderer/src/main/java/com/sdl/odata/unmarshaller/AbstractUnmarshaller.java#L37-L40
train
sdl/odata
odata_renderer/src/main/java/com/sdl/odata/unmarshaller/AbstractUnmarshaller.java
AbstractUnmarshaller.score
protected int score(MediaType contentTypeFromRequest, MediaType... expectedTypes) { if (contentTypeFromRequest == null) { return DEFAULT_SCORE; } for (MediaType expected : expectedTypes) { if (contentTypeFromRequest.matches(expected)) { return MAXIMUM_FORM...
java
protected int score(MediaType contentTypeFromRequest, MediaType... expectedTypes) { if (contentTypeFromRequest == null) { return DEFAULT_SCORE; } for (MediaType expected : expectedTypes) { if (contentTypeFromRequest.matches(expected)) { return MAXIMUM_FORM...
[ "protected", "int", "score", "(", "MediaType", "contentTypeFromRequest", ",", "MediaType", "...", "expectedTypes", ")", "{", "if", "(", "contentTypeFromRequest", "==", "null", ")", "{", "return", "DEFAULT_SCORE", ";", "}", "for", "(", "MediaType", "expected", ":...
Calculates score based on given media type. @param contentTypeFromRequest content type from the ODatRequest @param expectedTypes is variable arguments @return integer value which represent the score
[ "Calculates", "score", "based", "on", "given", "media", "type", "." ]
eb747d73e9af0f4e59a25b82ed656e526a7e2189
https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_renderer/src/main/java/com/sdl/odata/unmarshaller/AbstractUnmarshaller.java#L83-L93
train
jaliss/securesocial
samples/java/demo/app/controllers/Application.java
Application.index
@SecuredAction public Result index() { if(logger.isDebugEnabled()){ logger.debug("access granted to index"); } DemoUser user = (DemoUser) ctx().args.get(SecureSocial.USER_KEY); return ok(index.render(user, SecureSocial.env())); }
java
@SecuredAction public Result index() { if(logger.isDebugEnabled()){ logger.debug("access granted to index"); } DemoUser user = (DemoUser) ctx().args.get(SecureSocial.USER_KEY); return ok(index.render(user, SecureSocial.env())); }
[ "@", "SecuredAction", "public", "Result", "index", "(", ")", "{", "if", "(", "logger", ".", "isDebugEnabled", "(", ")", ")", "{", "logger", ".", "debug", "(", "\"access granted to index\"", ")", ";", "}", "DemoUser", "user", "=", "(", "DemoUser", ")", "c...
This action only gets called if the user is logged in. @return
[ "This", "action", "only", "gets", "called", "if", "the", "user", "is", "logged", "in", "." ]
0f9710325724da34a46c5ecefb439121fce837b7
https://github.com/jaliss/securesocial/blob/0f9710325724da34a46c5ecefb439121fce837b7/samples/java/demo/app/controllers/Application.java#L60-L67
train
jaliss/securesocial
module-code/app/securesocial/core/java/BaseUserService.java
BaseUserService.find
@Override public Future<Option<BasicProfile>> find(String providerId, String userId) { return toScala(doFind(providerId, userId).thenApply(Scala::Option)); }
java
@Override public Future<Option<BasicProfile>> find(String providerId, String userId) { return toScala(doFind(providerId, userId).thenApply(Scala::Option)); }
[ "@", "Override", "public", "Future", "<", "Option", "<", "BasicProfile", ">", ">", "find", "(", "String", "providerId", ",", "String", "userId", ")", "{", "return", "toScala", "(", "doFind", "(", "providerId", ",", "userId", ")", ".", "thenApply", "(", "...
Finds an Identity that maches the specified id @return an optional user
[ "Finds", "an", "Identity", "that", "maches", "the", "specified", "id" ]
0f9710325724da34a46c5ecefb439121fce837b7
https://github.com/jaliss/securesocial/blob/0f9710325724da34a46c5ecefb439121fce837b7/module-code/app/securesocial/core/java/BaseUserService.java#L45-L48
train
jaliss/securesocial
module-code/app/securesocial/core/java/BaseUserService.java
BaseUserService.findByEmailAndProvider
@Override public Future<Option<BasicProfile>> findByEmailAndProvider(String email, String providerId) { return toScala(doFindByEmailAndProvider(email, providerId).thenApply(Scala::Option)); }
java
@Override public Future<Option<BasicProfile>> findByEmailAndProvider(String email, String providerId) { return toScala(doFindByEmailAndProvider(email, providerId).thenApply(Scala::Option)); }
[ "@", "Override", "public", "Future", "<", "Option", "<", "BasicProfile", ">", ">", "findByEmailAndProvider", "(", "String", "email", ",", "String", "providerId", ")", "{", "return", "toScala", "(", "doFindByEmailAndProvider", "(", "email", ",", "providerId", ")"...
Finds an Identity by email and provider id. Note: If you do not plan to use the UsernamePassword provider just provide en empty implementation. @param email - the user email @param providerId - the provider id @return
[ "Finds", "an", "Identity", "by", "email", "and", "provider", "id", "." ]
0f9710325724da34a46c5ecefb439121fce837b7
https://github.com/jaliss/securesocial/blob/0f9710325724da34a46c5ecefb439121fce837b7/module-code/app/securesocial/core/java/BaseUserService.java#L60-L63
train
jaliss/securesocial
module-code/app/securesocial/core/java/BaseUserService.java
BaseUserService.save
@Override public Future<U> save(BasicProfile user, SaveMode mode) { return toScala(doSave(user, mode)); }
java
@Override public Future<U> save(BasicProfile user, SaveMode mode) { return toScala(doSave(user, mode)); }
[ "@", "Override", "public", "Future", "<", "U", ">", "save", "(", "BasicProfile", "user", ",", "SaveMode", "mode", ")", "{", "return", "toScala", "(", "doSave", "(", "user", ",", "mode", ")", ")", ";", "}" ]
Saves the Identity. This method gets called when a user logs in. This is your chance to save the user information in your backing store. @param user
[ "Saves", "the", "Identity", ".", "This", "method", "gets", "called", "when", "a", "user", "logs", "in", ".", "This", "is", "your", "chance", "to", "save", "the", "user", "information", "in", "your", "backing", "store", "." ]
0f9710325724da34a46c5ecefb439121fce837b7
https://github.com/jaliss/securesocial/blob/0f9710325724da34a46c5ecefb439121fce837b7/module-code/app/securesocial/core/java/BaseUserService.java#L71-L74
train
jaliss/securesocial
module-code/app/securesocial/core/java/BaseUserService.java
BaseUserService.link
@Override public Future<U> link(U current, BasicProfile to) { return toScala(doLink(current, to)); }
java
@Override public Future<U> link(U current, BasicProfile to) { return toScala(doLink(current, to)); }
[ "@", "Override", "public", "Future", "<", "U", ">", "link", "(", "U", "current", ",", "BasicProfile", "to", ")", "{", "return", "toScala", "(", "doLink", "(", "current", ",", "to", ")", ")", ";", "}" ]
Links the current user Identity to another @param current The Identity of the current user @param to The Identity that needs to be linked to the current user
[ "Links", "the", "current", "user", "Identity", "to", "another" ]
0f9710325724da34a46c5ecefb439121fce837b7
https://github.com/jaliss/securesocial/blob/0f9710325724da34a46c5ecefb439121fce837b7/module-code/app/securesocial/core/java/BaseUserService.java#L82-L85
train
jaliss/securesocial
module-code/app/securesocial/core/java/BaseUserService.java
BaseUserService.saveToken
@Override public Future<MailToken> saveToken(MailToken mailToken) { return toScala(doSaveToken(Token.fromScala(mailToken)).thenApply(Token::toScala)); }
java
@Override public Future<MailToken> saveToken(MailToken mailToken) { return toScala(doSaveToken(Token.fromScala(mailToken)).thenApply(Token::toScala)); }
[ "@", "Override", "public", "Future", "<", "MailToken", ">", "saveToken", "(", "MailToken", "mailToken", ")", "{", "return", "toScala", "(", "doSaveToken", "(", "Token", ".", "fromScala", "(", "mailToken", ")", ")", ".", "thenApply", "(", "Token", "::", "to...
Saves a token. This is needed for users that are creating an account in the system instead of using one in a 3rd party system. Note: If you do not plan to use the UsernamePassword provider just provide en empty implementation @param mailToken The token to save @return A string with a uuid that will be embedded in th...
[ "Saves", "a", "token", ".", "This", "is", "needed", "for", "users", "that", "are", "creating", "an", "account", "in", "the", "system", "instead", "of", "using", "one", "in", "a", "3rd", "party", "system", "." ]
0f9710325724da34a46c5ecefb439121fce837b7
https://github.com/jaliss/securesocial/blob/0f9710325724da34a46c5ecefb439121fce837b7/module-code/app/securesocial/core/java/BaseUserService.java#L108-L111
train
jaliss/securesocial
module-code/app/securesocial/core/java/BaseUserService.java
BaseUserService.findToken
@Override public Future<Option<MailToken>> findToken(String tokenId) { return toScala(doFindToken(tokenId).thenApply(this::toMailToken)); }
java
@Override public Future<Option<MailToken>> findToken(String tokenId) { return toScala(doFindToken(tokenId).thenApply(this::toMailToken)); }
[ "@", "Override", "public", "Future", "<", "Option", "<", "MailToken", ">", ">", "findToken", "(", "String", "tokenId", ")", "{", "return", "toScala", "(", "doFindToken", "(", "tokenId", ")", ".", "thenApply", "(", "this", "::", "toMailToken", ")", ")", "...
Finds a token Note: If you do not plan to use the UsernamePassword provider just provide en empty implementation @param tokenId the token id @return
[ "Finds", "a", "token" ]
0f9710325724da34a46c5ecefb439121fce837b7
https://github.com/jaliss/securesocial/blob/0f9710325724da34a46c5ecefb439121fce837b7/module-code/app/securesocial/core/java/BaseUserService.java#L122-L125
train
jaliss/securesocial
module-code/app/securesocial/core/java/BaseUserService.java
BaseUserService.deleteToken
@Override public Future<scala.Option<MailToken>> deleteToken(String tokenId) { return toScala(doDeleteToken(tokenId).thenApply(this::toMailToken)); }
java
@Override public Future<scala.Option<MailToken>> deleteToken(String tokenId) { return toScala(doDeleteToken(tokenId).thenApply(this::toMailToken)); }
[ "@", "Override", "public", "Future", "<", "scala", ".", "Option", "<", "MailToken", ">", ">", "deleteToken", "(", "String", "tokenId", ")", "{", "return", "toScala", "(", "doDeleteToken", "(", "tokenId", ")", ".", "thenApply", "(", "this", "::", "toMailTok...
Deletes a token Note: If you do not plan to use the UsernamePassword provider just provide en empty implementation @param tokenId the token id
[ "Deletes", "a", "token" ]
0f9710325724da34a46c5ecefb439121fce837b7
https://github.com/jaliss/securesocial/blob/0f9710325724da34a46c5ecefb439121fce837b7/module-code/app/securesocial/core/java/BaseUserService.java#L135-L138
train