try {
pkAttributeNames = pkAttributeNames.sortedArrayUsingComparator
( NSComparator.AscendingStringComparator );
} catch( NSComparator.ComparisonException ex ) {
log.error( "Unable to sort attribute names: "+ ex );
throw new NSForwardException(ex);
}
NSArray values = isEncrypted
? NSArray.componentsSeparatedByString( ERXCrypto.crypterForAlgorithm(ERXCrypto.BLOWFISH).decrypt(value).trim(), AttributeValueSeparator )
: NSArray.componentsSeparatedByString( value, AttributeValueSeparator );
int attrCount = pkAttributeNames.count();
NSMutableDictionary result = new NSMutableDictionary( attrCount );
for( int i = 0; i < attrCount; i++ ) {
String currentAttributeName = (String)pkAttributeNames.objectAtIndex( i );
EOAttribute currentAttribute = entity.attributeNamed( currentAttributeName );
Object currentValue = values.objectAtIndex( i );
switch ( currentAttribute.adaptorValueType() ) {
case 3:
NSTimestampFormatter tsf = new NSTimestampFormatter();
try {
currentValue = tsf.parseObject( (String) currentValue );
} catch( java.text.ParseException ex ) {
log.error( "Error while trying to parse: "+currentValue );
throw new NSForwardException( ex );
}
case 1:
if( currentAttribute.valueFactoryMethodName() != null ) {
currentValue = currentAttribute.newValueForString( (String) currentValue );
}