From fec4f593ccac17493f0014bd8fabdedc278135c8 Mon Sep 17 00:00:00 2001 From: "Brian S. O'Neill" Date: Tue, 22 Jul 2008 09:19:51 +0000 Subject: Added advanced conversion capability when setting query filter properties. This is used to ensure that BigDecimal values are properly normalized. --- .../carbonado/raw/GenericEncodingStrategy.java | 128 ++++++++------------- .../amazon/carbonado/raw/GenericStorableCodec.java | 55 ++++----- .../amazon/carbonado/raw/RawStorableGenerator.java | 4 +- 3 files changed, 70 insertions(+), 117 deletions(-) (limited to 'src/main/java/com/amazon/carbonado/raw') diff --git a/src/main/java/com/amazon/carbonado/raw/GenericEncodingStrategy.java b/src/main/java/com/amazon/carbonado/raw/GenericEncodingStrategy.java index e7a8ff9..c5417c4 100644 --- a/src/main/java/com/amazon/carbonado/raw/GenericEncodingStrategy.java +++ b/src/main/java/com/amazon/carbonado/raw/GenericEncodingStrategy.java @@ -25,7 +25,6 @@ import java.math.BigInteger; import java.util.ArrayList; import java.util.Arrays; -import java.util.EnumSet; import java.util.List; import java.util.Map; @@ -69,26 +68,6 @@ import com.amazon.carbonado.info.StorablePropertyAdapter; * @author Brian S O'Neill */ public class GenericEncodingStrategy { - /** - * Defines extra encoding options. - * - * @since 1.2 - */ - public static enum Option { - /** - * Access properties by public methods instead of protected fields. - * Option should be used if class being generated doesn't have access - * to these fields. - */ - USE_METHODS, - - /** - * Property values such as BigDecimal are normalized before being - * encoded. - */ - NORMALIZE, - } - private static enum Mode { KEY, DATA, SERIAL } private final Class mType; @@ -165,7 +144,9 @@ public class GenericEncodingStrategy { * of a Storable instance. * @param adapterInstanceClass class containing static references to * adapter instances - defaults to instanceVar - * @param options optional encoding options + * @param useReadMethods when true, access properties by public read + * methods instead of protected fields - should be used if class being + * generated doesn't have access to these fields * @param partialStartVar optional variable for supporting partial key * generation. It must be an int, whose runtime value must be less than the * properties array length. It marks the range start of the partial @@ -186,7 +167,7 @@ public class GenericEncodingStrategy { OrderedProperty[] properties, LocalVariable instanceVar, Class adapterInstanceClass, - EnumSet