Package org.exolab.castor.mapping
Interface FieldDescriptor
-
- All Superinterfaces:
NatureExtendable,PropertyHolder
- All Known Subinterfaces:
XMLFieldDescriptor
- All Known Implementing Classes:
FieldDescriptorImpl,XMLContainerElementFieldDescriptor,XMLFieldDescriptorImpl
public interface FieldDescriptor extends PropertyHolder
Describes the properties of a field. Implementations will extend this inteface to provide additional properties.- Version:
- $Revision: 8737 $ $Date: 2005-12-06 14:55:28 -0700 (Tue, 06 Dec 2005) $
- Author:
- Assaf Arkin, Ralf Joachim
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ClassDescriptorgetClassDescriptor()Returns the class descriptor related to the field type.ClassDescriptorgetContainingClassDescriptor()Get the class descriptor which contains this field.java.lang.StringgetFieldName()Returns the name of the field.java.lang.ClassgetFieldType()Returns the Java type of the field.FieldHandlergetHandler()Returns the handler of the field.booleanisImmutable()Returns true if the field type is immutable.booleanisMultivalued()Returns true if the field is multivalued (a collection).booleanisRequired()Returns true if the field type is required.booleanisTransient()Returns true if the field is transient.voidsetContainingClassDescriptor(ClassDescriptor parent)Set the class descriptor which contains this field.-
Methods inherited from interface org.castor.core.nature.NatureExtendable
addNature, hasNature
-
Methods inherited from interface org.castor.core.nature.PropertyHolder
getProperty, setProperty
-
-
-
-
Method Detail
-
setContainingClassDescriptor
void setContainingClassDescriptor(ClassDescriptor parent)
Set the class descriptor which contains this field.- Parameters:
parent- The class descriptor which contains this field.
-
getContainingClassDescriptor
ClassDescriptor getContainingClassDescriptor()
Get the class descriptor which contains this field.- Returns:
- The class descriptor which contains this field.
-
getFieldName
java.lang.String getFieldName()
Returns the name of the field. The field must have a name, even if set through accessor methods.- Returns:
- Field name.
-
getFieldType
java.lang.Class getFieldType()
Returns the Java type of the field.- Returns:
- Field type.
-
getClassDescriptor
ClassDescriptor getClassDescriptor()
Returns the class descriptor related to the field type. If the field type is a class for which a descriptor exists, this descriptor is returned. If the field type is a class for which no mapping is provided, null is returned.- Returns:
- The class descriptor of the field type, or null.
-
getHandler
FieldHandler getHandler()
Returns the handler of the field. In order to persist or marshal a field descriptor will be associated with a handler.- Returns:
- The field handler.
-
isTransient
boolean isTransient()
Returns true if the field is transient. Transient fields are never persisted or marshalled.- Returns:
- True if transient field.
-
isImmutable
boolean isImmutable()
Returns true if the field type is immutable.- Returns:
- True if the field type is immutable.
-
isRequired
boolean isRequired()
Returns true if the field type is required.- Returns:
- True if the field type is required.
-
isMultivalued
boolean isMultivalued()
Returns true if the field is multivalued (a collection).- Returns:
- True if the field is multivalued.
-
-