org.exolab.castor.persist

Class FieldMolder


public class FieldMolder
extends java.lang.Object

FieldMolder represents a field of a data object class. It is used by ClassMolder to set and get the value from a field of a data object.
Author:
Thomas Yip

Nested Class Summary

(package private) static class
FieldMolder.CollectionInfo

Field Summary

static short
MANY_TO_MANY
static short
ONE_TO_MANY
static short
PERSISTANCECAPABLE
static short
PRIMITIVE
static short
SERIALIZABLE

Constructor Summary

FieldMolder(DatingService ds, ClassMolder eMold, FieldMapping fieldMap)
FieldMolder(DatingService ds, ClassMolder eMold, FieldMapping fieldMap, String manyTable, String[] idSQL, int[] idType, TypeConvertor[] idTo, TypeConvertor[] idFrom, String[] idParam, String[] relatedIdSQL, int[] relatedIdType, TypeConvertor[] ridTo, TypeConvertor[] ridFrom, String[] ridParam)
Creates a single field descriptor.

Method Summary

void
addValue(Object object, Object value, ClassLoader loader)
Class
getCollectionType()
protected Class
getCollectionType(String coll, boolean lazy)
ClassMolder
getEnclosingClassMolder()
ClassMolder
getFieldClassMolder()
LockEngine
getFieldLockEngine()
short
getFieldType()
String
getName()
SQLRelationLoader
getRelationLoader()
Object
getValue(Object object, ClassLoader loader)
boolean
isAddable()
boolean
isCheckDirty()
boolean
isDefault(Object value)
Check if the specified value is the default value of the Field represented by this FieldMolder
boolean
isDependent()
boolean
isLazy()
boolean
isManyToMany()
boolean
isMulti()
boolean
isPersistanceCapable()
boolean
isReadonly()
boolean
isSerializable()
boolean
isStored()
(package private) void
setFieldClassMolder(ClassMolder fMold)
void
setValue(Object object, Object value, ClassLoader loader)
String
toString()

Field Details

MANY_TO_MANY

public static final short MANY_TO_MANY
Field Value:
4

ONE_TO_MANY

public static final short ONE_TO_MANY
Field Value:
3

PERSISTANCECAPABLE

public static final short PERSISTANCECAPABLE
Field Value:
2

PRIMITIVE

public static final short PRIMITIVE
Field Value:
0

SERIALIZABLE

public static final short SERIALIZABLE
Field Value:
1

Constructor Details

FieldMolder

public FieldMolder(DatingService ds,
                   ClassMolder eMold,
                   FieldMapping fieldMap)
            throws MappingException

FieldMolder

public FieldMolder(DatingService ds,
                   ClassMolder eMold,
                   FieldMapping fieldMap,
                   String manyTable,
                   String[] idSQL,
                   int[] idType,
                   TypeConvertor[] idTo,
                   TypeConvertor[] idFrom,
                   String[] idParam,
                   String[] relatedIdSQL,
                   int[] relatedIdType,
                   TypeConvertor[] ridTo,
                   TypeConvertor[] ridFrom,
                   String[] ridParam)
            throws MappingException
Creates a single field descriptor. The field mapping is used to create a new stock FieldMolder. Implementations may extend this class to create a more suitable descriptor.
Parameters:
fieldMap - The field mapping information
Throws:
MappingException - The field or its accessor methods are not found, not accessible, not of the specified type, etc

Method Details

addValue

public void addValue(Object object,
                     Object value,
                     ClassLoader loader)

getCollectionType

public Class getCollectionType()

getCollectionType

protected Class getCollectionType(String coll,
                                  boolean lazy)
            throws MappingException

getEnclosingClassMolder

public ClassMolder getEnclosingClassMolder()

getFieldClassMolder

public ClassMolder getFieldClassMolder()

getFieldLockEngine

public LockEngine getFieldLockEngine()

getFieldType

public short getFieldType()

getName

public String getName()

getRelationLoader

public SQLRelationLoader getRelationLoader()

getValue

public Object getValue(Object object,
                       ClassLoader loader)

isAddable

public boolean isAddable()

isCheckDirty

public boolean isCheckDirty()

isDefault

public boolean isDefault(Object value)
Check if the specified value is the default value of the Field represented by this FieldMolder

isDependent

public boolean isDependent()

isLazy

public boolean isLazy()

isManyToMany

public boolean isManyToMany()

isMulti

public boolean isMulti()

isPersistanceCapable

public boolean isPersistanceCapable()

isReadonly

public boolean isReadonly()

isSerializable

public boolean isSerializable()

isStored

public boolean isStored()

setFieldClassMolder

(package private)  void setFieldClassMolder(ClassMolder fMold)

setValue

public void setValue(Object object,
                     Object value,
                     ClassLoader loader)

toString

public String toString()

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