/**
 * Copyright (C) 2009 - 2010 by OpenGamma Inc.
 *
 * Please see distribution for license.
 */
package com.opengamma.financial.fudgemsg;

import org.fudgemsg.FudgeContextConfiguration;
import org.fudgemsg.mapping.FudgeObjectDictionary;

import com.opengamma.financial.Region;
import com.opengamma.financial.RegionRepository;

/**
 * Configuration for Fudge of the OG-Financial library.
 * <p>
 * This configures Fudge builders.
 */
public class FinancialFudgeContextConfiguration extends FudgeContextConfiguration {

  /**
   * The singleton configuration.
   */
  public static final FudgeContextConfiguration INSTANCE = new FinancialFudgeContextConfiguration();

  private RegionRepository _regionRepository;

  public RegionRepository getRegionRepository() {
    return _regionRepository;
  }

  public void setRegionRepository(final RegionRepository regionRepository) {
    _regionRepository = regionRepository;
  }

  //-------------------------------------------------------------------------
  @Override
  public void configureFudgeObjectDictionary(final FudgeObjectDictionary dictionary) {
    // REVIEW kirk 2010-08-26 -- This is the one thing that needs changed to eliminate this class.
    dictionary.getDefaultBuilderFactory().addGenericBuilder(Region.class, new RegionBuilder(this));
  }

}

@@ -177,24 +177,65 @@
 figuration;%0A
+import org.fudgemsg.FudgeTypeDictionary;%0A
 import org.f
@@ -1036,16 +1036,166 @@
 -------%0A
+  %0A  // REVIEW kirk 2010-08-26 -- If you think of changing these things, take a look at the%0A  // fudgeContext setup in the common.xml spring file.%0A  %0A
   @Overr
@@ -1198,16 +1198,16 @@
 verride%0A
-
   public
@@ -1281,24 +1281,66 @@
 ctionary) %7B%0A
+    dictionary.addAllClasspathBuilders();%0A
     // REVIE
@@ -1426,16 +1426,16 @@
  class.%0A
-
     dict
@@ -1531,10 +1531,152 @@
 );%0A  %7D%0A%0A
+  @Override%0A  public void configureFudgeTypeDictionary(FudgeTypeDictionary dictionary) %7B%0A    dictionary.addAllAnnotatedSecondaryTypes();%0A  %7D%0A%0A
 %7D%0A

Put in the basic annotation scanning bootstrapping in FinancialFudgeContextConfiguration to make Spring-based tools run correctly.