Spring Data Commons

org.springframework.data.mapping.model
Class AnnotationBasedPersistentProperty<P extends PersistentProperty<P>>

java.lang.Object
  extended by org.springframework.data.mapping.model.AbstractPersistentProperty<P>
      extended by org.springframework.data.mapping.model.AnnotationBasedPersistentProperty<P>
All Implemented Interfaces:
PersistentProperty<P>

public abstract class AnnotationBasedPersistentProperty<P extends PersistentProperty<P>>
extends AbstractPersistentProperty<P>

Special PersistentProperty that takes annotations at a property into account.

Author:
Oliver Gierke

Field Summary
 
Fields inherited from class org.springframework.data.mapping.model.AbstractPersistentProperty
association, field, information, name, owner, propertyDescriptor, rawType
 
Constructor Summary
AnnotationBasedPersistentProperty(java.lang.reflect.Field field, java.beans.PropertyDescriptor propertyDescriptor, PersistentEntity<?,P> owner, SimpleTypeHolder simpleTypeHolder)
          Creates a new AnnotationBasedPersistentProperty.
 
Method Summary
 java.lang.String getSpelExpression()
          Inspects a potentially available Value annotation at the property and returns the String value of it.
 boolean isAssociation()
          Considers the property an Association if it is annotated with Reference.
 boolean isIdProperty()
          Regards the property as ID if there is an Id annotation found on it.
 boolean isTransient()
          Considers plain transient fields, fields annotated with Transient, Value or Autowired as transien.
 
Methods inherited from class org.springframework.data.mapping.model.AbstractPersistentProperty
createAssociation, getAssociation, getComponentType, getField, getMapValueType, getName, getOwner, getPersistentEntityType, getPropertyDescriptor, getRawType, getType, getTypeInformation, isArray, isCollectionLike, isEntity, isMap, shallBePersisted
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AnnotationBasedPersistentProperty

public AnnotationBasedPersistentProperty(java.lang.reflect.Field field,
                                         java.beans.PropertyDescriptor propertyDescriptor,
                                         PersistentEntity<?,P> owner,
                                         SimpleTypeHolder simpleTypeHolder)
Creates a new AnnotationBasedPersistentProperty.

Parameters:
field -
propertyDescriptor -
owner -
Method Detail

getSpelExpression

public java.lang.String getSpelExpression()
Inspects a potentially available Value annotation at the property and returns the String value of it.

Specified by:
getSpelExpression in interface PersistentProperty<P extends PersistentProperty<P>>
Overrides:
getSpelExpression in class AbstractPersistentProperty<P extends PersistentProperty<P>>
See Also:
AbstractPersistentProperty.getSpelExpression()

isTransient

public boolean isTransient()
Considers plain transient fields, fields annotated with Transient, Value or Autowired as transien.

Specified by:
isTransient in interface PersistentProperty<P extends PersistentProperty<P>>
Overrides:
isTransient in class AbstractPersistentProperty<P extends PersistentProperty<P>>
Returns:
See Also:
org.springframework.data.mapping.BasicPersistentProperty#isTransient()

isIdProperty

public boolean isIdProperty()
Regards the property as ID if there is an Id annotation found on it.

Returns:

isAssociation

public boolean isAssociation()
Considers the property an Association if it is annotated with Reference.

Specified by:
isAssociation in interface PersistentProperty<P extends PersistentProperty<P>>
Overrides:
isAssociation in class AbstractPersistentProperty<P extends PersistentProperty<P>>
Returns:

Spring Data Commons

Copyright © 2012. All Rights Reserved.