org.odata4j.producer.inmemory
Class InMemoryEdmGenerator

java.lang.Object
  extended by org.odata4j.producer.inmemory.InMemoryEdmGenerator
All Implemented Interfaces:
EdmGenerator

public class InMemoryEdmGenerator
extends Object
implements EdmGenerator


Field Summary
protected  Map<String,InMemoryComplexTypeInfo<?>> complexTypeInfo
           
protected  List<EdmComplexType.Builder> edmComplexTypes
           
protected  Map<String,InMemoryEntityInfo<?>> eis
           
protected  Map<Class<?>,String> entitySetNameByClass
           
protected  Map<String,EdmEntitySet.Builder> entitySetsByName
           
protected  Map<String,EdmEntityType.Builder> entityTypesByName
           
protected  boolean flatten
           
protected  InMemoryTypeMapping typeMapping
           
 
Constructor Summary
InMemoryEdmGenerator(String namespace, String containerName, InMemoryTypeMapping typeMapping, String idPropertyName, Map<String,InMemoryEntityInfo<?>> eis, Map<String,InMemoryComplexTypeInfo<?>> complexTypes)
           
InMemoryEdmGenerator(String namespace, String containerName, InMemoryTypeMapping typeMapping, String idPropertyName, Map<String,InMemoryEntityInfo<?>> eis, Map<String,InMemoryComplexTypeInfo<?>> complexTypes, boolean flatten)
           
 
Method Summary
protected  void addFunctions(EdmSchema.Builder schema, EdmEntityContainer.Builder container)
          provides an override point for applications to add application specific EdmFunctions to their producer.
protected  void createNavigationProperties(List<EdmAssociation.Builder> associations, List<EdmAssociationSet.Builder> associationSets, Map<String,EdmEntityType.Builder> entityTypesByName, Map<String,EdmEntitySet.Builder> entitySetByName, Map<Class<?>,String> entityNameByClass)
           
protected  EdmEntityType.Builder createStructuralType(EdmDecorator decorator, InMemoryEntityInfo<?> entityInfo)
           
protected  EdmComplexType.Builder findComplexTypeBuilder(String typeName)
           
protected  EdmComplexType.Builder findComplexTypeForClass(Class<?> clazz)
           
protected  InMemoryEntityInfo<?> findEntityInfoForClass(Class<?> clazz)
           
 EdmDataServices.Builder generateEdm(EdmDecorator decorator)
          Produces a new mutable EdmDataServices model given an optional decorator.
protected  void generateToManyNavProperties(List<EdmAssociation.Builder> associations, List<EdmAssociationSet.Builder> associationSets, Map<String,EdmEntityType.Builder> entityTypesByName, Map<String,EdmEntitySet.Builder> entitySetByName, Map<Class<?>,String> entityNameByClass, String entityTypeName, InMemoryEntityInfo<?> ei, Class<?> clazz1)
           
protected  void generateToOneNavProperties(List<EdmAssociation.Builder> associations, List<EdmAssociationSet.Builder> associationSets, Map<String,EdmEntityType.Builder> entityTypesByName, Map<String,EdmEntitySet.Builder> entitySetByName, Map<Class<?>,String> entityNameByClass, String entityTypeName, InMemoryEntityInfo<?> ei)
           
protected  EdmEntitySet.Builder getEntitySetForEntityTypeName(String entityTypeName)
           
 String getNamespace()
          get the Edm namespace
protected  InMemoryEntityInfo<?> getUnregisteredEntityInfo(Class<?> clazz, InMemoryEntityInfo<?> subclass)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

complexTypeInfo

protected final Map<String,InMemoryComplexTypeInfo<?>> complexTypeInfo

edmComplexTypes

protected final List<EdmComplexType.Builder> edmComplexTypes

eis

protected final Map<String,InMemoryEntityInfo<?>> eis

entitySetNameByClass

protected final Map<Class<?>,String> entitySetNameByClass

entitySetsByName

protected Map<String,EdmEntitySet.Builder> entitySetsByName

entityTypesByName

protected Map<String,EdmEntityType.Builder> entityTypesByName

flatten

protected final boolean flatten

typeMapping

protected final InMemoryTypeMapping typeMapping
Constructor Detail

InMemoryEdmGenerator

public InMemoryEdmGenerator(String namespace,
                            String containerName,
                            InMemoryTypeMapping typeMapping,
                            String idPropertyName,
                            Map<String,InMemoryEntityInfo<?>> eis,
                            Map<String,InMemoryComplexTypeInfo<?>> complexTypes)

InMemoryEdmGenerator

public InMemoryEdmGenerator(String namespace,
                            String containerName,
                            InMemoryTypeMapping typeMapping,
                            String idPropertyName,
                            Map<String,InMemoryEntityInfo<?>> eis,
                            Map<String,InMemoryComplexTypeInfo<?>> complexTypes,
                            boolean flatten)
Method Detail

addFunctions

protected void addFunctions(EdmSchema.Builder schema,
                            EdmEntityContainer.Builder container)
provides an override point for applications to add application specific EdmFunctions to their producer.

Parameters:
schema - the EdmSchema.Builder
container - the EdmEntityContainer.Builder

createNavigationProperties

protected void createNavigationProperties(List<EdmAssociation.Builder> associations,
                                          List<EdmAssociationSet.Builder> associationSets,
                                          Map<String,EdmEntityType.Builder> entityTypesByName,
                                          Map<String,EdmEntitySet.Builder> entitySetByName,
                                          Map<Class<?>,String> entityNameByClass)

createStructuralType

protected EdmEntityType.Builder createStructuralType(EdmDecorator decorator,
                                                     InMemoryEntityInfo<?> entityInfo)

findComplexTypeBuilder

protected EdmComplexType.Builder findComplexTypeBuilder(String typeName)

findComplexTypeForClass

protected EdmComplexType.Builder findComplexTypeForClass(Class<?> clazz)

findEntityInfoForClass

protected InMemoryEntityInfo<?> findEntityInfoForClass(Class<?> clazz)

generateEdm

public EdmDataServices.Builder generateEdm(EdmDecorator decorator)
Description copied from interface: EdmGenerator
Produces a new mutable EdmDataServices model given an optional decorator.

Specified by:
generateEdm in interface EdmGenerator

generateToManyNavProperties

protected void generateToManyNavProperties(List<EdmAssociation.Builder> associations,
                                           List<EdmAssociationSet.Builder> associationSets,
                                           Map<String,EdmEntityType.Builder> entityTypesByName,
                                           Map<String,EdmEntitySet.Builder> entitySetByName,
                                           Map<Class<?>,String> entityNameByClass,
                                           String entityTypeName,
                                           InMemoryEntityInfo<?> ei,
                                           Class<?> clazz1)

generateToOneNavProperties

protected void generateToOneNavProperties(List<EdmAssociation.Builder> associations,
                                          List<EdmAssociationSet.Builder> associationSets,
                                          Map<String,EdmEntityType.Builder> entityTypesByName,
                                          Map<String,EdmEntitySet.Builder> entitySetByName,
                                          Map<Class<?>,String> entityNameByClass,
                                          String entityTypeName,
                                          InMemoryEntityInfo<?> ei)

getEntitySetForEntityTypeName

protected EdmEntitySet.Builder getEntitySetForEntityTypeName(String entityTypeName)

getNamespace

public String getNamespace()
get the Edm namespace

Returns:
the Edm namespace

getUnregisteredEntityInfo

protected InMemoryEntityInfo<?> getUnregisteredEntityInfo(Class<?> clazz,
                                                          InMemoryEntityInfo<?> subclass)


http://odata4j.org