com.ca.jcs.converter.attr
Class MultiValueFlattener

java.lang.Object
  extended by com.ca.jcs.converter.attr.MultiValueFlattener
All Implemented Interfaces:
AttributeConverter
Direct Known Subclasses:
CommaSeparatedMultiValueFlattener, ORedMultiValueFlattener, XMLMultiValueFlattener

public abstract class MultiValueFlattener
extends Object
implements AttributeConverter

Base class for flatteners which convert a list of values to a single literal, and vice-versa.


Constructor Summary
MultiValueFlattener()
           
 
Method Summary
 void convertToConnector(Attribute attr)
           
 String convertToString(Attribute attr)
           
 Converter getConverter()
          Can be null for some structural converters.
abstract  String getStyle()
           
 boolean isForceWrap()
          Return true if even a single value needs to be specially wrapped (the default), override in concrete converter if this should not be the case.
 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.
protected abstract  void writeEnd(StringWriter writer)
           
protected abstract  void writeStart(StringWriter writer)
           
protected abstract  void writeValue(StringWriter writer, String value, boolean firstValue)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.ca.jcs.converter.attr.AttributeConverter
convertFromConnector
 

Constructor Detail

MultiValueFlattener

public MultiValueFlattener()
Method Detail

isMultiValued

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

isStructural

public boolean isStructural()
Description copied from interface: AttributeConverter
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

isForceWrap

public boolean isForceWrap()
Return true if even a single value needs to be specially wrapped (the default), override in concrete converter if this should not be the case.


getStyle

public abstract String getStyle()

writeStart

protected abstract void writeStart(StringWriter writer)

writeValue

protected abstract void writeValue(StringWriter writer,
                                   String value,
                                   boolean firstValue)

writeEnd

protected abstract void writeEnd(StringWriter writer)

convertToString

public String convertToString(Attribute attr)

convertToConnector

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


Created 2011-07-14 13:27 EST