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()
PropertyMetadata
If this property represents the Document ID.
isId
in interface PropertyMetadata
public boolean isField()
PropertyMetadata
If this property represents a field in the Document.
isField
in interface PropertyMetadata
public String name()
PropertyMetadata
The 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 PropertyMetadata
public String realName()
PropertyMetadata
The name of the actual property inside the java entity.
realName
in interface PropertyMetadata
public Class<?> type()
PropertyMetadata
The type of the field property.
type
in interface PropertyMetadata
public Object get(Object source)
PropertyMetadata
Returns the content of the field property.
get
in interface PropertyMetadata
source
- the source object.public void set(Object value, Object source)
PropertyMetadata
Sets the content of the field property.
set
in interface PropertyMetadata
value
- the value to set.source
- the source object.Copyright © 2014 Couchbase, Inc.