org.exolab.castor.mapping.loader

Class TypeInfo

public class TypeInfo extends Object

Type information passed on creation of a FieldHandlerImpl.

Version: $Revision: 1.5 $ $Date: 2005/03/05 13:41:52 $

Author: Assaf Arkin

Constructor Summary
TypeInfo(Class fieldType)
Construct new type information for a field.
TypeInfo(Class fieldType, TypeConvertor convertorTo, TypeConvertor convertorFrom, boolean required, Object defaultValue, CollectionHandler colHandler)
Construct new type information for the field.
TypeInfo(Class fieldType, TypeConvertor convertorTo, TypeConvertor convertorFrom, String convertorParam, boolean required, Object defaultValue, CollectionHandler colHandler)
Construct new type information for the field.
TypeInfo(Class fieldType, TypeConvertor convertorTo, TypeConvertor convertorFrom, String convertorParam, boolean required, Object defaultValue, CollectionHandler colHandler, boolean checkForCollection)
Construct new type information for the field.
Method Summary
CollectionHandlergetCollectionHandler()
Return the collection handler of this field.
TypeConvertorgetConvertorFrom()
Returns the convertor from the field type to an external type.
StringgetConvertorParam()
Returns the convertor parameter.
TypeConvertorgetConvertorTo()
Returns the convertor to the field type from an external type.
ObjectgetDefaultValue()
Returns the default value for the field.
ClassgetFieldType()
Returns the field type.
booleanisImmutable()
Returns true if field type is immutable.
booleanisRequired()
Returns true if field type is required.
voidsetCollectionHandler(CollectionHandler handler)
Sets the CollectionHandler to use for the field described by this TypeInfo.
voidsetImmutable(boolean immutable)
Sets whether or not the type is immutable
voidsetRequired(boolean required)
Sets a flag indictating if the field is required.

Constructor Detail

TypeInfo

public TypeInfo(Class fieldType)
Construct new type information for a field. This field requires no type conversion, and has no default value.

Parameters: fieldType The field type

TypeInfo

public TypeInfo(Class fieldType, TypeConvertor convertorTo, TypeConvertor convertorFrom, boolean required, Object defaultValue, CollectionHandler colHandler)
Construct new type information for the field.

Parameters: fieldType The field type convertorTo Convertor to the field type from external type, or null if no conversion is required convertorFrom Convertor from the field type to external type, or null if no conversion is required required True if the field is required defaultValue The default value of the field, null to use the known Java defaults colHandler The collection handler for this field, or null if field is singular

TypeInfo

public TypeInfo(Class fieldType, TypeConvertor convertorTo, TypeConvertor convertorFrom, String convertorParam, boolean required, Object defaultValue, CollectionHandler colHandler)
Construct new type information for the field.

Parameters: fieldType The field type convertorTo Convertor to the field type from external type, or null if no conversion is required convertorFrom Convertor from the field type to external type, or null if no conversion is required convertorParam Optional parameter for the convertor, or null if either no conversion is required or no parameter is specified required True if the field is required defaultValue The default value of the field, null to use the known Java defaults colHandler The collection handler for this field, or null if field is singular

TypeInfo

public TypeInfo(Class fieldType, TypeConvertor convertorTo, TypeConvertor convertorFrom, String convertorParam, boolean required, Object defaultValue, CollectionHandler colHandler, boolean checkForCollection)
Construct new type information for the field.

Parameters: fieldType The field type convertorTo Convertor to the field type from external type, or null if no conversion is required convertorFrom Convertor from the field type to external type, or null if no conversion is required convertorParam Optional parameter for the convertor, or null if either no conversion is required or no parameter is specified required True if the field is required defaultValue The default value of the field, null to use the known Java defaults colHandler The collection handler for this field, or null if field is singular

Method Detail

getCollectionHandler

public CollectionHandler getCollectionHandler()
Return the collection handler of this field.

Returns: The collection handler of this field

getConvertorFrom

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

Returns: Convertor from field type

getConvertorParam

public String getConvertorParam()
Returns the convertor parameter.

Returns: Convertor parameter

getConvertorTo

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

Returns: Convertor to field type

getDefaultValue

public Object getDefaultValue()
Returns the default value for the field.

Returns: The default value

getFieldType

public Class getFieldType()
Returns the field type.

Returns: The field type

isImmutable

public boolean isImmutable()
Returns true if field type is immutable.

Returns: True if type is immutable

isRequired

public boolean isRequired()
Returns true if field type is required.

Returns: True if field is required

setCollectionHandler

public void setCollectionHandler(CollectionHandler handler)
Sets the CollectionHandler to use for the field described by this TypeInfo.

Parameters: handler the CollectionHandler, or null if no CollectionHandler should be used.

setImmutable

void setImmutable(boolean immutable)
Sets whether or not the type is immutable

Parameters: immutable a boolean that when true indicates the type is immutable

setRequired

public void setRequired(boolean required)
Sets a flag indictating if the field is required.

Parameters: required the value of the flag. Should be true if the field is required, false otherwise.

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