/** * Register a ResourceFactoryStrategy for a content-type. In order for createResource() and * createCollectionResource() to know what type of resource to create based on content-type, * ResourceFactoryStrategy instances must be registered for each media type support. For * example, to support HAL (Hypertext Application Language) style resources, register the * HAL resource factory as follows: * <p/> * <code> * HyperExpress.registerResourceFactoryStrategy(new HalResourceFactory(), "application/hal+json"); * </code> * <p/> * If you want HAL links for both application/json and application/hal+json media types, register * them as follows: * <p/> * <code> * HalResourceFactory halFactory = new HalResourceFactory(); * HyperExpress.registerResourceFactoryStrategy(halFactory, "application/hal+json"); * HyperExpress.registerResourceFactoryStrategy(halFactory, "application/json"); * </code> * * @param factoryStrategy * @param contentType * @see HalResourceFactory */ public static void registerResourceFactoryStrategy(ResourceFactoryStrategy factoryStrategy, String contentType) { INSTANCE._registerResourceFactoryStrategy(factoryStrategy, contentType); }