com.ca.jcs.converter.meta
Class PropertyConverter

java.lang.Object
  extended by com.ca.jcs.cfg.Vetoable
      extended by com.ca.jcs.converter.meta.PropertyConverter
All Implemented Interfaces:
AttributeConverter
Direct Known Subclasses:
BoolPropertyConverter, CountryPropertyConverter, DemoFlattenPropertyConverter, DNPropertyConverter, EncyptPropertyConverter, EnumPropertyConverter, ForceCasePropertyConverter, JavaObjectPropertyConverter, MultiValuePropertyFlattener, NumericBasePropertyConverter, PadPropertyConverter, RegexPropertyConverter, StringArrayPropertyConverter, TimeNumericPropertyConverter, TrimPropertyConverter

public abstract class PropertyConverter
extends Vetoable
implements AttributeConverter

Convert an attribute's values given it's type and constraints available in the metadata stored on prop, in both the "toward connector" direction (toConnector) and "from connector" direction (fromConnector).


Field Summary
protected  ConverterConfig config
           
protected  DataModelProperty prop
           
 
Constructor Summary
PropertyConverter(ConverterConfig cfg, DataModelProperty prop)
           
 
Method Summary
 void convertFromConnector(Attribute connAttrVals)
           
 void convertToConnector(Attribute ldapAttrVals)
           
 AttributeConverter getAttrConverter()
           
 ConverterConfig getConfig()
          returns the configuration object for this converter
 Converter getConverter()
          Can be null for some structural converters.
 DataModelType getTargetValueOverride()
          Override to return a type if desired, in which case any AttributeConverter registered against this value will be cleared when this property converter is activated for a property.
 boolean isLossy()
          Returns true if the converter performs a lossy attribute value conversion
 boolean isMultiValued()
           
 boolean isStructural()
          Returns true if the converter performs a change to the structure of an attribute's values, rather then just transforming individual values themselves.
 void setAttrConverter(AttributeConverter attrConverter)
           
 
Methods inherited from class com.ca.jcs.cfg.Vetoable
isVetoed, setVetoed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

config

protected final ConverterConfig config

prop

protected final DataModelProperty prop
Constructor Detail

PropertyConverter

public PropertyConverter(ConverterConfig cfg,
                         DataModelProperty prop)
Method Detail

getConfig

public ConverterConfig getConfig()
returns the configuration object for this converter


getTargetValueOverride

public DataModelType getTargetValueOverride()
Override to return a type if desired, in which case any AttributeConverter registered against this value will be cleared when this property converter is activated for a property.


isMultiValued

public boolean isMultiValued()
Specified by:
isMultiValued in interface AttributeConverter

isStructural

public boolean isStructural()
Returns true if the converter performs a change to the structure of an attribute's values, rather then just transforming individual values themselves. For instance changing a multi-valued attribute into a String[] is a structural conversion.

Specified by:
isStructural in interface AttributeConverter

isLossy

public boolean isLossy()
Description copied from interface: AttributeConverter
Returns true if the converter performs a lossy attribute value conversion

Specified by:
isLossy in interface AttributeConverter

getConverter

public Converter getConverter()
Description copied from interface: AttributeConverter
Can be null for some structural converters.

Specified by:
getConverter in interface AttributeConverter

getAttrConverter

public AttributeConverter getAttrConverter()

setAttrConverter

public void setAttrConverter(AttributeConverter attrConverter)

convertToConnector

public void convertToConnector(Attribute ldapAttrVals)
                        throws NamingException
Specified by:
convertToConnector in interface AttributeConverter
Throws:
NamingException

convertFromConnector

public void convertFromConnector(Attribute connAttrVals)
                          throws NamingException
Specified by:
convertFromConnector in interface AttributeConverter
Throws:
NamingException


Created 2011-07-14 13:27 EST