org.odata4j.edm
Interface EdmDecorator


public interface EdmDecorator

Application specific EDM customizations such as Documentation and Annotations.


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

Method Detail

decorateEntity

void decorateEntity(EdmEntitySet entitySet,
                    EdmItem item,
                    EdmItem originalQueryItem,
                    List<OProperty<?>> props,
                    boolean flatten,
                    Locale locale,
                    Map<String,String> options)
Modifies outgoing EDM items.


getAnnotationsForEntityType

List<EdmAnnotation<?>> getAnnotationsForEntityType(String namespace,
                                                   String typeName)
Gets custom annotations for a given EDM schema.


getAnnotationsForProperty

List<EdmAnnotation<?>> getAnnotationsForProperty(String namespace,
                                                 String typeName,
                                                 String propName)
Gets custom annotations for a given EDM property.


getAnnotationsForSchema

List<EdmAnnotation<?>> getAnnotationsForSchema(String namespace)
Gets custom annotations for a given EDM schema.


getAnnotationValueOverride

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
options - from query
Returns:
null if no override, an object with the value if there is one.

getDocumentationForEntityType

EdmDocumentation getDocumentationForEntityType(String namespace,
                                               String typeName)
Gets custom documentation for a given EDM entity type.


getDocumentationForProperty

EdmDocumentation getDocumentationForProperty(String namespace,
                                             String typeName,
                                             String propName)
Gets custom documentation for a given EDM property.


getDocumentationForSchema

EdmDocumentation getDocumentationForSchema(String namespace)
Gets custom documentation for a given EDM schema.


getNamespaces

List<PrefixedNamespace> getNamespaces()
Gets custom prefixed namespaces for this EDM.


resolvePropertyProperty

Object resolvePropertyProperty(EdmProperty st,
                               PropertyPath path)
                               throws IllegalArgumentException
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.

resolveStructuralTypeProperty

Object resolveStructuralTypeProperty(EdmStructuralType structuralType,
                                     PropertyPath path)
                                     throws IllegalArgumentException
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.


http://odata4j.org