public class FieldDescriptorImpl extends Object implements FieldDescriptor
Modifier | Constructor and Description |
---|---|
protected |
FieldDescriptorImpl()
Creates a default instance of a field descriptor.
|
|
FieldDescriptorImpl(String fieldName,
TypeInfo typeInfo,
FieldHandler handler,
boolean isTransitive)
Constructs a new field descriptor.
|
Modifier and Type | Method and Description |
---|---|
void |
addNature(String nature)
Adds a specified nature.
|
ClassDescriptor |
getClassDescriptor()
Returns the class descriptor related to the field type.
|
FieldMappingCollectionType |
getCollection() |
String |
getComparator() |
ClassDescriptor |
getContainingClassDescriptor()
Get the class descriptor which contains this field.
|
String |
getCreateMethod() |
String |
getFieldName()
Returns the name of the field.
|
Class<?> |
getFieldType()
Returns the Java type of the field.
|
String |
getGetMethod() |
FieldHandler |
getHandler()
Returns the handler of the field.
|
Object |
getProperty(String name)
Get a property by its name.
|
String |
getSetMethod() |
boolean |
hasNature(String nature)
Checks if a specified nature has been added.
|
boolean |
isDirect() |
boolean |
isIdentity()
Is the described field is part of the identity of the class it belongs to?
|
boolean |
isImmutable()
Returns true if the field type is immutable.
|
boolean |
isLazy() |
boolean |
isMultivalued()
Returns true if the field is multivalued (a collection).
|
boolean |
isRequired()
Returns true if the field type is required.
|
boolean |
isTransient()
Returns true if the field is transient.
|
void |
setClassDescriptor(ClassDescriptor classDescriptor)
Set the ClassDescriptor for the described field.
|
void |
setCollection(FieldMappingCollectionType collection) |
void |
setComparator(String comparator) |
void |
setContainingClassDescriptor(ClassDescriptor parent)
Set the class descriptor which contains this field.
|
void |
setCreateMethod(String createMethod) |
void |
setDirect(boolean direct) |
void |
setFieldName(String fieldName)
Set the name of the field.
|
void |
setFieldType(Class<?> fieldType)
Set the type of the field.
|
void |
setGetMethod(String getMethod) |
void |
setHandler(FieldHandler handler)
Set the FieldHandler for the field being described by this FieldDescriptor.
|
void |
setIdentity(boolean identity)
Set wether the described field is part of the identity of the class it belongs to.
|
void |
setImmutable(boolean immutable)
Set the immutable flag which indicates that changes to this Field result in a
new Object to be created, such as java.lang.String.
|
void |
setLazy(boolean lazy) |
void |
setMultivalued(boolean multivalued)
Set wheter the object described by this descriptor is multivalued or not.
|
void |
setProperty(String name,
Object value)
Set a property specified by the name to the passed value.
|
void |
setRequired(boolean required)
Set whether or not the described field is required.
|
void |
setSetMethod(String setMethod) |
void |
setTransient(boolean isTransient)
Sets whether or not the describled field is 'transient'.
|
String |
toString() |
protected FieldDescriptorImpl()
public FieldDescriptorImpl(String fieldName, TypeInfo typeInfo, FieldHandler handler, boolean isTransitive)
fieldName
- The field nametypeInfo
- The field type informationhandler
- The field handler (may be null)isTransitive
- True if the field is transientpublic final void setContainingClassDescriptor(ClassDescriptor parent)
FieldDescriptor
setContainingClassDescriptor
in interface FieldDescriptor
parent
- The class descriptor which contains this field.{@inheritDoc}
public final ClassDescriptor getContainingClassDescriptor()
FieldDescriptor
getContainingClassDescriptor
in interface FieldDescriptor
{@inheritDoc}
public final void setFieldName(String fieldName)
fieldName
- Field name.public final String getFieldName()
FieldDescriptor
getFieldName
in interface FieldDescriptor
{@inheritDoc}
public final void setFieldType(Class<?> fieldType)
fieldType
- Field type.public final Class<?> getFieldType()
FieldDescriptor
getFieldType
in interface FieldDescriptor
{@inheritDoc}
public final void setClassDescriptor(ClassDescriptor classDescriptor)
classDescriptor
- The ClassDescriptor for the described field.public final ClassDescriptor getClassDescriptor()
FieldDescriptor
getClassDescriptor
in interface FieldDescriptor
{@inheritDoc}
public final void setHandler(FieldHandler handler)
handler
- The FieldHandler for the field being described.public final FieldHandler getHandler()
FieldDescriptor
getHandler
in interface FieldDescriptor
{@inheritDoc}
public final void setTransient(boolean isTransient)
isTransient
- The flag indicating if the described field is 'transient'.public final boolean isTransient()
FieldDescriptor
isTransient
in interface FieldDescriptor
{@inheritDoc}
public final void setImmutable(boolean immutable)
immutable
- Flag which if true indicates that the field is immutable.public final boolean isImmutable()
FieldDescriptor
isImmutable
in interface FieldDescriptor
{@inheritDoc}
public final void setRequired(boolean required)
required
- The flag indicating whether or not the described field is required.public final boolean isRequired()
FieldDescriptor
isRequired
in interface FieldDescriptor
{@inheritDoc}
public final void setMultivalued(boolean multivalued)
multivalued
- True if the object described by this descriptor is multivalued.public final boolean isMultivalued()
FieldDescriptor
isMultivalued
in interface FieldDescriptor
{@inheritDoc}
public final void setIdentity(boolean identity)
identity
- true
if field is part of the classes identity.public final boolean isIdentity()
true
if field is part of the classes identity.public Object getProperty(String name)
PropertyHolder
getProperty
in interface PropertyHolder
name
- of the propertygetProperty(java.lang.String)
public void setProperty(String name, Object value)
PropertyHolder
setProperty
in interface PropertyHolder
name
- of the propertyvalue
- of the propertysetProperty(java.lang.String, java.lang.Object)
public void addNature(String nature)
NatureExtendable
addNature
in interface NatureExtendable
nature
- ID of the NatureaddNature(java.lang.String)
public boolean hasNature(String nature)
NatureExtendable
hasNature
in interface NatureExtendable
nature
- ID of the NaturehasNature(java.lang.String)
public String getComparator()
public void setComparator(String comparator)
public FieldMappingCollectionType getCollection()
public void setCollection(FieldMappingCollectionType collection)
public boolean isDirect()
public void setDirect(boolean direct)
public String getGetMethod()
public void setGetMethod(String getMethod)
public String getSetMethod()
public void setSetMethod(String setMethod)
public String getCreateMethod()
public void setCreateMethod(String createMethod)
public boolean isLazy()
public void setLazy(boolean lazy)
Copyright © 2017. All rights reserved.