Spring Data Commons

org.springframework.data.mapping
Class BasicPersistentProperty

java.lang.Object
  extended by org.springframework.data.mapping.BasicPersistentProperty
All Implemented Interfaces:
PersistentProperty

public class BasicPersistentProperty
extends Object
implements PersistentProperty

Simple impementation of PersistentProperty.

Author:
Jon Brisbin , Oliver Gierke

Field Summary
protected  Association association
           
protected  Field field
           
protected  TypeInformation information
           
protected  boolean isTransient
           
protected  String name
           
protected  PersistentEntity<?> owner
           
protected  PropertyDescriptor propertyDescriptor
           
protected  Value value
           
 
Constructor Summary
BasicPersistentProperty(Field field, PropertyDescriptor propertyDescriptor, TypeInformation information)
           
 
Method Summary
 Association getAssociation()
           
 Class<?> getComponentType()
          Returns the component type of the type if it is a Collection.
 Field getField()
           
 Class<?> getMapValueType()
          Returns the type of the values if the property is a Map.
 String getName()
          The name of the property
 Object getOwner()
           
 PropertyDescriptor getPropertyDescriptor()
           
 Class<?> getType()
          The type of the property
 TypeInformation getTypeInformation()
           
 Value getValueAnnotation()
           
 boolean isArray()
           
 boolean isAssociation()
           
 boolean isCollection()
           
 boolean isComplexType()
           
 boolean isEntity()
          Returns whether the property has to be regarded as entity which means its type will be also be considered to be a PersistentEntity.
 boolean isIdProperty()
           
 boolean isMap()
           
 boolean isTransient()
           
 void setAssociation(Association association)
           
 void setOwner(Object owner)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

protected final String name

propertyDescriptor

protected final PropertyDescriptor propertyDescriptor

information

protected final TypeInformation information

field

protected final Field field

association

protected Association association

value

protected Value value

isTransient

protected boolean isTransient

owner

protected PersistentEntity<?> owner
Constructor Detail

BasicPersistentProperty

public BasicPersistentProperty(Field field,
                               PropertyDescriptor propertyDescriptor,
                               TypeInformation information)
Method Detail

getOwner

public Object getOwner()
Specified by:
getOwner in interface PersistentProperty

setOwner

public void setOwner(Object owner)

getName

public String getName()
Description copied from interface: PersistentProperty
The name of the property

Specified by:
getName in interface PersistentProperty
Returns:
The property name

getType

public Class<?> getType()
Description copied from interface: PersistentProperty
The type of the property

Specified by:
getType in interface PersistentProperty
Returns:
The property type

getTypeInformation

public TypeInformation getTypeInformation()
Specified by:
getTypeInformation in interface PersistentProperty

getPropertyDescriptor

public PropertyDescriptor getPropertyDescriptor()
Specified by:
getPropertyDescriptor in interface PersistentProperty

getField

public Field getField()
Specified by:
getField in interface PersistentProperty

getValueAnnotation

public Value getValueAnnotation()
Specified by:
getValueAnnotation in interface PersistentProperty

isTransient

public boolean isTransient()
Specified by:
isTransient in interface PersistentProperty

isAssociation

public boolean isAssociation()
Specified by:
isAssociation in interface PersistentProperty

getAssociation

public Association getAssociation()
Specified by:
getAssociation in interface PersistentProperty

setAssociation

public void setAssociation(Association association)

isCollection

public boolean isCollection()
Specified by:
isCollection in interface PersistentProperty

isMap

public boolean isMap()
Specified by:
isMap in interface PersistentProperty

isArray

public boolean isArray()
Specified by:
isArray in interface PersistentProperty

isComplexType

public boolean isComplexType()
Specified by:
isComplexType in interface PersistentProperty

isEntity

public boolean isEntity()
Description copied from interface: PersistentProperty
Returns whether the property has to be regarded as entity which means its type will be also be considered to be a PersistentEntity.

Specified by:
isEntity in interface PersistentProperty
Returns:

getComponentType

public Class<?> getComponentType()
Description copied from interface: PersistentProperty
Returns the component type of the type if it is a Collection. Will return the type of the key if the property is a Map.

Specified by:
getComponentType in interface PersistentProperty
Returns:
the component type, the map's key type or null if neither Collection nor Map.

getMapValueType

public Class<?> getMapValueType()
Description copied from interface: PersistentProperty
Returns the type of the values if the property is a Map.

Specified by:
getMapValueType in interface PersistentProperty
Returns:
the map's value type or null if no Map

isIdProperty

public boolean isIdProperty()
Specified by:
isIdProperty in interface PersistentProperty

Spring Data Commons

Copyright © 2011. All Rights Reserved.