org.odata4j.producer.inmemory
Class BeanBasedPropertyModel

java.lang.Object
  extended by org.odata4j.producer.inmemory.BeanBasedPropertyModel
All Implemented Interfaces:
PropertyModel

public class BeanBasedPropertyModel
extends Object
implements PropertyModel


Constructor Summary
BeanBasedPropertyModel(Class<?> clazz)
           
BeanBasedPropertyModel(Class<?> clazz, boolean flatten)
          construct
 
Method Summary
 Class<?> getCollectionElementType(String collectionName)
           
 Iterable<String> getCollectionNames()
          gets the names of all collections defined by the model
 Iterable<?> getCollectionValue(Object target, String collectionName)
           
 Iterable<String> getDeclaredCollectionNames()
          gets the names of collections defined only at this inheritance level in the model
 Iterable<String> getDeclaredPropertyNames()
          gets the names of properties defined only at this inheritance level in the model
 Iterable<String> getPropertyNames()
          gets the names of all properties defined by the model
 Class<?> getPropertyType(String propertyName)
           
 Object getPropertyValue(Object target, String propertyName)
           
 void setCollectionValue(Object target, String collectionName, Collection<?> value)
           
 void setPropertyValue(Object target, String propertyName, Object value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BeanBasedPropertyModel

public BeanBasedPropertyModel(Class<?> clazz)

BeanBasedPropertyModel

public BeanBasedPropertyModel(Class<?> clazz,
                              boolean flatten)
construct

Parameters:
clazz - - the POJO class that defines the model
flatten - - if true, the model will flatten property names and collection names. if false, the model will distinguish *declared* property/collection names from *all* (i.e. include inherited) property/collection names. This is the same terminology used in the Edm classes and the Java Class class. Note that all model methods that are value centric (getPropertyValue, etc) will automatically work up the hierarchy if necessary.
Method Detail

getCollectionElementType

public Class<?> getCollectionElementType(String collectionName)
Specified by:
getCollectionElementType in interface PropertyModel

getCollectionNames

public Iterable<String> getCollectionNames()
Description copied from interface: PropertyModel
gets the names of all collections defined by the model

Specified by:
getCollectionNames in interface PropertyModel
Returns:
- collection names

getCollectionValue

public Iterable<?> getCollectionValue(Object target,
                                      String collectionName)
Specified by:
getCollectionValue in interface PropertyModel

getDeclaredCollectionNames

public Iterable<String> getDeclaredCollectionNames()
Description copied from interface: PropertyModel
gets the names of collections defined only at this inheritance level in the model

Specified by:
getDeclaredCollectionNames in interface PropertyModel
Returns:
- collection names

getDeclaredPropertyNames

public Iterable<String> getDeclaredPropertyNames()
Description copied from interface: PropertyModel
gets the names of properties defined only at this inheritance level in the model

Specified by:
getDeclaredPropertyNames in interface PropertyModel
Returns:
- property names

getPropertyNames

public Iterable<String> getPropertyNames()
Description copied from interface: PropertyModel
gets the names of all properties defined by the model

Specified by:
getPropertyNames in interface PropertyModel
Returns:
- property names

getPropertyType

public Class<?> getPropertyType(String propertyName)
Specified by:
getPropertyType in interface PropertyModel

getPropertyValue

public Object getPropertyValue(Object target,
                               String propertyName)
Specified by:
getPropertyValue in interface PropertyModel

setCollectionValue

public void setCollectionValue(Object target,
                               String collectionName,
                               Collection<?> value)
Specified by:
setCollectionValue in interface PropertyModel

setPropertyValue

public void setPropertyValue(Object target,
                             String propertyName,
                             Object value)
Specified by:
setPropertyValue in interface PropertyModel


http://odata4j.org