- protected AttributeMappingStrategy<?, ? extends OpenType<?>> caseJavaAttribute(JavaAttribute attributeIfc) {
-
- if (attributeIfc.getOpenType() instanceof SimpleType<?>)
- return new SimpleAttributeMappingStrategy((SimpleType<?>) attributeIfc.getOpenType());
- else if (attributeIfc.getOpenType() instanceof ArrayType<?>) {
- ArrayType<?> arrayType = (ArrayType<?>) attributeIfc.getOpenType();
- AttributeMappingStrategy<?, ? extends OpenType<?>> innerStrategy = new SimpleAttributeMappingStrategy(
- (SimpleType<?>) arrayType.getElementOpenType());
- return new ArrayAttributeMappingStrategy(arrayType, innerStrategy);
+ protected AttributeMappingStrategy<?, ? extends OpenType<?>> caseJavaSimpleAttribute(SimpleType<?> openType) {
+ return new SimpleAttributeMappingStrategy(openType);
+ }
+
+ @Override
+ protected AttributeMappingStrategy<?, ? extends OpenType<?>> caseJavaArrayAttribute(ArrayType<?> openType) {
+
+ AttributeMappingStrategy<?, ? extends OpenType<?>> innerStrategy = new SimpleAttributeMappingStrategy(
+ (SimpleType<?>) openType.getElementOpenType());
+ return new ArrayAttributeMappingStrategy(openType, innerStrategy);
+ }
+
+ @Override
+ protected AttributeMappingStrategy<?, ? extends OpenType<?>> caseJavaCompositeAttribute(CompositeType openType) {
+ Map<String, AttributeMappingStrategy<?, ? extends OpenType<?>>> innerStrategies = Maps.newHashMap();
+
+ Map<String, String> attributeMapping = Maps.newHashMap();
+
+ for (String innerAttributeKey : openType.keySet()) {
+
+ innerStrategies.put(innerAttributeKey, caseJavaAttribute(openType.getType(innerAttributeKey)));
+ attributeMapping.put(innerAttributeKey, innerAttributeKey);