org.exolab.castor.mapping.loader
Class FieldDescriptorImpl

java.lang.Object
  extended by org.exolab.castor.mapping.loader.FieldDescriptorImpl
All Implemented Interfaces:
FieldDescriptor
Direct Known Subclasses:
JDOFieldDescriptor

public class FieldDescriptorImpl
extends java.lang.Object
implements FieldDescriptor

A basic field descriptor implementation. Engines will extend this class to provide additional functionality.

Version:
$Revision: 1.5 $ $Date: 2005/08/03 21:11:48 $
Author:
Assaf Arkin
See Also:
ClassDescriptorImpl

Constructor Summary
protected FieldDescriptorImpl(FieldDescriptor fieldDesc)
          Constructor used by derived clases.
protected FieldDescriptorImpl(FieldDescriptorImpl fieldDesc)
          Constructor used by derived clases.
  FieldDescriptorImpl(java.lang.String fieldName, TypeInfo typeInfo, FieldHandler handler, boolean trans)
          Constructs a new field descriptor.
 
Method Summary
 ClassDescriptor getClassDescriptor()
          Returns the class descriptor related to the field type.
 ClassDescriptor getContainingClassDescriptor()
           
 TypeConvertor getConvertor()
          Returns the convertor from the field type to an external type.
 java.lang.String getConvertorParam()
          Returns the convertor parameter.
 java.lang.String getFieldName()
          Returns the name of the field.
 java.lang.Class getFieldType()
          Returns the Java type of the field.
 FieldHandler getHandler()
          Returns the handler of the field.
 boolean isImmutable()
          Returns true if the field type is immutable.
 boolean isMultivalued()
          Returns true if the field is multi valued (a collection).
 boolean isRequired()
          Returns true if the field type is required.
 boolean isTransient()
          Returns true if the field is transient.
(package private)  void setClassDescriptor(ClassDescriptor clsDesc)
          Mutator method used by MappingLoader.
 void setContainingClassDescriptor(ClassDescriptor contClsDesc)
          Set the class which contains this field
(package private)  void setHandler(FieldHandler handler)
          Mutator method used by MappingLoader.
 void setRequired(boolean required)
          Mutator method used by MappingLoader.
 void setTransient(boolean isTransient)
          Mutator method used by MappingLoader.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FieldDescriptorImpl

public FieldDescriptorImpl(java.lang.String fieldName,
                           TypeInfo typeInfo,
                           FieldHandler handler,
                           boolean trans)
                    throws MappingException
Constructs a new field descriptor.

Parameters:
fieldName - The field name
typeInfo - The field type information
handler - The field handler (may be null)
trans - True if the field is transient
Throws:
MappingException

FieldDescriptorImpl

protected FieldDescriptorImpl(FieldDescriptor fieldDesc)
Constructor used by derived clases.


FieldDescriptorImpl

protected FieldDescriptorImpl(FieldDescriptorImpl fieldDesc)
Constructor used by derived clases.

Method Detail

setContainingClassDescriptor

public void setContainingClassDescriptor(ClassDescriptor contClsDesc)
Description copied from interface: FieldDescriptor
Set the class which contains this field

Specified by:
setContainingClassDescriptor in interface FieldDescriptor

getContainingClassDescriptor

public ClassDescriptor getContainingClassDescriptor()
Specified by:
getContainingClassDescriptor in interface FieldDescriptor
Returns:
the class which contains this field

getFieldName

public java.lang.String getFieldName()
Description copied from interface: FieldDescriptor
Returns the name of the field.

Specified by:
getFieldName in interface FieldDescriptor
Returns:
Field name

getFieldType

public java.lang.Class getFieldType()
Description copied from interface: FieldDescriptor
Returns the Java type of the field.

Specified by:
getFieldType in interface FieldDescriptor
Returns:
Field type

isTransient

public boolean isTransient()
Description copied from interface: FieldDescriptor
Returns true if the field is transient. Transient fields are never persisted or marshalled.

Specified by:
isTransient in interface FieldDescriptor
Returns:
True if transient field

isImmutable

public boolean isImmutable()
Description copied from interface: FieldDescriptor
Returns true if the field type is immutable.

Specified by:
isImmutable in interface FieldDescriptor
Returns:
True if the field type is immutable

isRequired

public boolean isRequired()
Description copied from interface: FieldDescriptor
Returns true if the field type is required.

Specified by:
isRequired in interface FieldDescriptor
Returns:
True if the field type is required

isMultivalued

public boolean isMultivalued()
Description copied from interface: FieldDescriptor
Returns true if the field is multi valued (a collection).

Specified by:
isMultivalued in interface FieldDescriptor
Returns:
True if the field is multi valued

getClassDescriptor

public ClassDescriptor getClassDescriptor()
Description copied from interface: FieldDescriptor
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.

Specified by:
getClassDescriptor in interface FieldDescriptor
Returns:
The class descriptor of the field type, or null

getHandler

public FieldHandler getHandler()
Description copied from interface: FieldDescriptor
Returns the handler of the field. In order to persist or marshal a field descriptor will be associated with a handler.

Specified by:
getHandler in interface FieldDescriptor
Returns:
The field handler

setHandler

void setHandler(FieldHandler handler)
Mutator method used by MappingLoader.


setClassDescriptor

void setClassDescriptor(ClassDescriptor clsDesc)
Mutator method used by MappingLoader.


setRequired

public void setRequired(boolean required)
Mutator method used by MappingLoader.


setTransient

public void setTransient(boolean isTransient)
Mutator method used by MappingLoader.


getConvertor

public TypeConvertor getConvertor()
Returns the convertor from the field type to an external type.

Returns:
Convertor from field type

getConvertorParam

public java.lang.String getConvertorParam()
Returns the convertor parameter.

Returns:
Convertor parameter

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Intalio Inc. (C) 1999-2004. All rights reserved http://www.intalio.com