public abstract class QueryFormatter
extends java.lang.Object
Formatter for OData queries.
| Constructor and Description |
|---|
QueryFormatter() |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
format(DataQuery query,
DataContext context)
Return a formatted data query for use in an OData URL.
|
static java.lang.String |
formatCanonicalURL(EntityValue entity,
DataContext context)
|
static java.lang.String |
formatCanonicalURL(EntityValue entity,
DataContext context,
boolean absolute)
Return the canonical URL of an entity (relative by default, absolute if specified).
|
static java.lang.String |
formatDataValue(DataValue value,
DataContext context)
Return a formatted data value for use in an OData URL.
|
static java.lang.String |
formatEditLink(EntityValue entity,
DataContext context)
Return the exit link of an entity (if set) or the entity's canonical URL.
|
static java.lang.String |
formatEntityID(EntityValue entity,
DataContext context)
Return the formatted ID of an entity for use in a URL, i.e.
|
static java.lang.String |
formatEntityKey(EntityKey entityKey,
EntityType entityType,
DataContext context)
Return the formatted key of an entity for use in a URL, e.g.
|
static java.lang.String |
formatReadLink(EntityValue entity,
DataContext context)
Return the read link of an entity (if set) or the entity's canonical URL.
|
public static java.lang.String format(DataQuery query, DataContext context)
Return a formatted data query for use in an OData URL.
query - Data query.context - Data context.public static java.lang.String formatCanonicalURL(EntityValue entity, DataContext context)
entity - Entity parameter.context - Context parameter.public static java.lang.String formatCanonicalURL(EntityValue entity, DataContext context, boolean absolute)
Return the canonical URL of an entity (relative by default, absolute if specified).
Canonical URL (OData V4).
entity - Entity value.context - Data context.absolute - Is absolute URL required? (defaults to `false`, resulting in relative URL).public static java.lang.String formatDataValue(DataValue value, DataContext context)
Return a formatted data value for use in an OData URL.
value - (nullable) Data value.context - Data context.public static java.lang.String formatEditLink(EntityValue entity, DataContext context)
Return the exit link of an entity (if set) or the entity's canonical URL.
entity - Entity value.context - Data context.public static java.lang.String formatEntityID(EntityValue entity, DataContext context)
Return the formatted ID of an entity for use in a URL, i.e. entity.entityID (if set) or the entity's canonical URL.
entity - Entity value.context - Data context.entity.entityID (if set) or the entity's canonical URL.public static java.lang.String formatEntityKey(EntityKey entityKey, EntityType entityType, DataContext context)
Return the formatted key of an entity for use in a URL, e.g. "(123)" or "(n=123,s='xyz')".
entityKey - Entity key.entityType - Entity type.context - Data context.public static java.lang.String formatReadLink(EntityValue entity, DataContext context)
Return the read link of an entity (if set) or the entity's canonical URL.
entity - Entity value.context - Data context.