Created
July 14, 2016 02:30
-
-
Save chrismrgn/2f6af1bd665b9d723fc1474016bdfff4 to your computer and use it in GitHub Desktop.
Custom data bind factory to plumb in the custom data binder to a DD4T 2 Java project
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class CustomDataBindFactory { | |
private static final Logger LOG = LoggerFactory.getLogger(DataBindFactory.class); | |
private static final CustomDataBindFactory INSTANCE = new CustomDataBindFactory(); | |
private CustomDataBinder customDataBinder; | |
private CustomDataBindFactory () { | |
LOG.info("CustomDataBindFactory init."); | |
} | |
public static CustomDataBindFactory getInstance () { | |
if (null == INSTANCE) { | |
LOG.error("CustomDataBindFactory not properly instantiated!"); | |
} | |
return INSTANCE; | |
} | |
public static <T extends Sitemap> T buildSitemap (final String source, final Class<T> aClass) throws SerializationException { | |
return INSTANCE.customDataBinder.buildSitemap(source, aClass); | |
} | |
public void setCustomDataBinder(final CustomDataBinder customDataBinder) { | |
this.customDataBinder = customDataBinder; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment