public class ReflectionBasedPropertyMetadata extends Object implements PropertyMetadata
The property metadata implementation based on java reflection.
| Constructor and Description |
|---|
ReflectionBasedPropertyMetadata(Field fieldReference) |
| Modifier and Type | Method and Description |
|---|---|
Object |
get(Object source)
Returns the content of the field property.
|
boolean |
isField()
If this property represents a field in the Document.
|
boolean |
isId()
If this property represents the Document ID.
|
String |
name()
The name of the field inside the document.
|
String |
realName()
The name of the actual property inside the java entity.
|
void |
set(Object value,
Object source)
Sets the content of the field property.
|
Class<?> |
type()
The type of the field property.
|
public ReflectionBasedPropertyMetadata(Field fieldReference)
public boolean isId()
PropertyMetadataIf this property represents the Document ID.
isId in interface PropertyMetadatapublic boolean isField()
PropertyMetadataIf this property represents a field in the Document.
isField in interface PropertyMetadatapublic String name()
PropertyMetadataThe name of the field inside the document.
If an alias is used, it is reflected in here. If the raw field name in the entity is needed, use PropertyMetadata.realName().
name in interface PropertyMetadatapublic String realName()
PropertyMetadataThe name of the actual property inside the java entity.
realName in interface PropertyMetadatapublic Class<?> type()
PropertyMetadataThe type of the field property.
type in interface PropertyMetadatapublic Object get(Object source)
PropertyMetadataReturns the content of the field property.
get in interface PropertyMetadatasource - the source object.public void set(Object value, Object source)
PropertyMetadataSets the content of the field property.
set in interface PropertyMetadatavalue - the value to set.source - the source object.Copyright © 2015 Couchbase, Inc.