com.ca.jcs.converter.attr
Class ORedMultiValueFlattener

java.lang.Object
  extended by com.ca.jcs.converter.attr.MultiValueFlattener
      extended by com.ca.jcs.converter.attr.ORedMultiValueFlattener
All Implemented Interfaces:
AttributeConverter

public class ORedMultiValueFlattener
extends MultiValueFlattener

A Flattening converter that performs logical OR operation on multi-valued attribute values which are numeric/enum ordinals. In the to connector direction a logical OR is performed on all attribute values, in the from connector direction the ORable values are sent in an order that may not coincide to the one sent in originally due to the ORing process being partially lossy.


Field Summary
static String FLATTEN_STYLE
           
 
Constructor Summary
ORedMultiValueFlattener(DataModelEnumDef enumDef, Boolean isStoreNumeric)
           
 
Method Summary
 void convertFromConnector(Attribute connAttrVals)
           
 String getStyle()
           
protected  void writeEnd(StringWriter writer)
           
protected  void writeStart(StringWriter writer)
           
protected  void writeValue(StringWriter writer, String value, boolean firstValue)
          Flatten an attribute value via ORing.
 
Methods inherited from class com.ca.jcs.converter.attr.MultiValueFlattener
convertToConnector, convertToString, getConverter, isForceWrap, isLossy, isMultiValued, isStructural
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FLATTEN_STYLE

public static final String FLATTEN_STYLE
See Also:
Constant Field Values
Constructor Detail

ORedMultiValueFlattener

public ORedMultiValueFlattener(DataModelEnumDef enumDef,
                               Boolean isStoreNumeric)
Method Detail

getStyle

public String getStyle()
Specified by:
getStyle in class MultiValueFlattener

writeEnd

protected void writeEnd(StringWriter writer)
Specified by:
writeEnd in class MultiValueFlattener

writeStart

protected void writeStart(StringWriter writer)
Specified by:
writeStart in class MultiValueFlattener

writeValue

protected void writeValue(StringWriter writer,
                          String value,
                          boolean firstValue)
Flatten an attribute value via ORing. For enum based properties, depending on whether EnumPropertyConverter isn't already active on this property the input value sent will be a symbolic name (isStoreSymbolic - not currently allowed) or an already converted ordinal value (isStoreNumeric). If Enum converter not active then a symbolic enum value is expected. For numeric properties just a number is expected.

Specified by:
writeValue in class MultiValueFlattener

convertFromConnector

public void convertFromConnector(Attribute connAttrVals)
                          throws NamingException
Throws:
NamingException


Created 2011-07-14 13:27 EST