Class UriHelperImpl
java.lang.Object
org.apache.olingo.server.core.uri.UriHelperImpl
- All Implemented Interfaces:
UriHelper
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuildCanonicalURL(EdmEntitySet edmEntitySet, Entity entity) Builds the relative canonical URL for the given entity in the given entity set.Builds the key-predicate part of aContextURL.buildContextURLSelectList(EdmStructuredType type, ExpandOption expand, SelectOption select) Builds the select-list part of aContextURL.buildKeyPredicate(EdmEntityType edmEntityType, Entity entity) Builds the key predicate for the given entity.parseEntityId(Edm edm, String entityId, String rawServiceRoot) Parses a given entity-id.
-
Constructor Details
-
UriHelperImpl
public UriHelperImpl()
-
-
Method Details
-
buildContextURLSelectList
public String buildContextURLSelectList(EdmStructuredType type, ExpandOption expand, SelectOption select) throws SerializerException Description copied from interface:UriHelperBuilds the select-list part of aContextURL.- Specified by:
buildContextURLSelectListin interfaceUriHelper- Parameters:
type- theEdmStructuredTypeexpand- the $expand optionselect- the $select option- Returns:
- a String with the select list
- Throws:
SerializerException
-
buildContextURLKeyPredicate
Description copied from interface:UriHelperBuilds the key-predicate part of aContextURL.- Specified by:
buildContextURLKeyPredicatein interfaceUriHelper- Parameters:
keys- the keys as a list ofUriParameterinstances- Returns:
- a String with the key predicate
- Throws:
SerializerException
-
buildCanonicalURL
public String buildCanonicalURL(EdmEntitySet edmEntitySet, Entity entity) throws SerializerException Description copied from interface:UriHelperBuilds the relative canonical URL for the given entity in the given entity set.- Specified by:
buildCanonicalURLin interfaceUriHelper- Parameters:
edmEntitySet- the entity setentity- the entity data- Returns:
- the relative canonical URL
- Throws:
SerializerException
-
buildKeyPredicate
public String buildKeyPredicate(EdmEntityType edmEntityType, Entity entity) throws SerializerException Description copied from interface:UriHelperBuilds the key predicate for the given entity.- Specified by:
buildKeyPredicatein interfaceUriHelper- Parameters:
edmEntityType- the entity type of the entityentity- the entity data- Returns:
- the key predicate
- Throws:
SerializerException
-
parseEntityId
public UriResourceEntitySet parseEntityId(Edm edm, String entityId, String rawServiceRoot) throws DeserializerException Description copied from interface:UriHelperParses a given entity-id. Provides the entity set and key predicates. A canonical entiy-id to an entity must follow the pattern[<service root>][<entityContainer>.]<entitySet>(<key>), i.e., it must be a relative or absolute URI consisting of an entity set (qualified with an entity-container name if not in the default entity container) and a syntactically valid key that identifies a single entity; example:http://example.server.com/service.svc/Employees('42').- Specified by:
parseEntityIdin interfaceUriHelper- Parameters:
edm- the edm the entity belongs toentityId- URI of the entity-idrawServiceRoot- the root URI of the service- Returns:
UriResourceEntitySet- contains the entity set and the key predicates- Throws:
DeserializerException- in case the entity-id is malformed
-