public interface

EdmDecorator

org.odata4j.edm.EdmDecorator

Class Overview

Application specific EDM customizations such as Documentation and Annotations.

Summary

Public Methods
abstract void decorateEntity(EdmEntitySet entitySet, EdmItem item, EdmItem originalQueryItem, List<OProperty<?>> props, boolean flatten, Locale locale, Map<String, String> options)
Modifies outgoing EDM items.
abstract Object getAnnotationValueOverride(EdmItem item, NamespacedAnnotation<?> annot, boolean flatten, Locale locale, Map<String, String> options)
Gets an annotation value that overrides the original annotation value.
abstract List<EdmAnnotation<?>> getAnnotationsForEntityType(String namespace, String typeName)
Gets custom annotations for a given EDM schema.
abstract List<EdmAnnotation<?>> getAnnotationsForProperty(String namespace, String typeName, String propName)
Gets custom annotations for a given EDM property.
abstract List<EdmAnnotation<?>> getAnnotationsForSchema(String namespace)
Gets custom annotations for a given EDM schema.
abstract EdmDocumentation getDocumentationForEntityType(String namespace, String typeName)
Gets custom documentation for a given EDM entity type.
abstract EdmDocumentation getDocumentationForProperty(String namespace, String typeName, String propName)
Gets custom documentation for a given EDM property.
abstract EdmDocumentation getDocumentationForSchema(String namespace)
Gets custom documentation for a given EDM schema.
abstract List<PrefixedNamespace> getNamespaces()
Gets custom prefixed namespaces for this EDM.
abstract Object resolvePropertyProperty(EdmProperty st, PropertyPath path)
Resolves a custom property (i.e.
abstract Object resolveStructuralTypeProperty(EdmStructuralType structuralType, PropertyPath path)
Resolves a custom property (i.e.

Public Methods

public abstract void decorateEntity (EdmEntitySet entitySet, EdmItem item, EdmItem originalQueryItem, List<OProperty<?>> props, boolean flatten, Locale locale, Map<String, String> options)

Modifies outgoing EDM items.

Parameters
entitySet
item
originalQueryItem
props
flatten
locale
options

public abstract Object getAnnotationValueOverride (EdmItem item, NamespacedAnnotation<?> annot, boolean flatten, Locale locale, Map<String, String> options)

Gets an annotation value that overrides the original annotation value.

This is an experiment that allows one to localize queryable metadata. Say you have an annotation called LocalizedName on your item. When the metadata is queried, the caller can supply a custom locale parameter in options and this method can override the original LocalizedName with the one for the given locale.

Parameters
item The annotated item
annot The annotation
flatten
locale
options From query
Returns
  • null if no override, an object with the value if there is one.

public abstract List<EdmAnnotation<?>> getAnnotationsForEntityType (String namespace, String typeName)

Gets custom annotations for a given EDM schema.

Parameters
namespace
typeName

public abstract List<EdmAnnotation<?>> getAnnotationsForProperty (String namespace, String typeName, String propName)

Gets custom annotations for a given EDM property.

Parameters
namespace
typeName
propName

public abstract List<EdmAnnotation<?>> getAnnotationsForSchema (String namespace)

Gets custom annotations for a given EDM schema.

Parameters
namespace

public abstract EdmDocumentation getDocumentationForEntityType (String namespace, String typeName)

Gets custom documentation for a given EDM entity type.

Parameters
namespace
typeName

public abstract EdmDocumentation getDocumentationForProperty (String namespace, String typeName, String propName)

Gets custom documentation for a given EDM property.

Parameters
namespace
typeName
propName

public abstract EdmDocumentation getDocumentationForSchema (String namespace)

Gets custom documentation for a given EDM schema.

Parameters
namespace

public abstract List<PrefixedNamespace> getNamespaces ()

Gets custom prefixed namespaces for this EDM.

public abstract Object resolvePropertyProperty (EdmProperty st, PropertyPath path)

Resolves a custom property (i.e. Annotation) on a property type.

Parameters
st The type
path The path to the property
Returns
  • a property value (may be null) for the requested property if it exists.
Throws
IllegalArgumentException if the property does not exist.

public abstract Object resolveStructuralTypeProperty (EdmStructuralType structuralType, PropertyPath path)

Resolves a custom property (i.e. Annotation) on a structural type.

Parameters
structuralType The type
path The path to the property
Returns
  • a property value (may be null) for the requested property if it exists.
Throws
IllegalArgumentException if the property does not exist.