Class AbstractRestfulClient

java.lang.Object
org.refcodes.rest.AbstractRestfulClient
All Implemented Interfaces:
RestDeleteClient, RestfulClient, RestGetClient, RestPostClient, RestPutClient, RestRequestClient, RestRequestHandler, org.refcodes.web.BasicAuthCredentialsAccessor, org.refcodes.web.BasicAuthCredentialsAccessor.BasicAuthCredentialsBuilder<RestfulClient>, org.refcodes.web.BasicAuthCredentialsAccessor.BasicAuthCredentialsMutator, org.refcodes.web.BasicAuthCredentialsAccessor.BasicAuthCredentialsProperty, org.refcodes.web.MediaTypeFactoryLookup, org.refcodes.web.MediaTypeFactoryLookup.MutableMediaTypeFactoryLookup, org.refcodes.web.OauthTokenAccessor, org.refcodes.web.OauthTokenAccessor.OauthTokenBuilder<RestfulClient>, org.refcodes.web.OauthTokenAccessor.OauthTokenMutator, org.refcodes.web.OauthTokenAccessor.OauthTokenProperty, org.refcodes.web.UserAgentAccessor, org.refcodes.web.UserAgentAccessor.UserAgentBuilder<RestfulClient>, org.refcodes.web.UserAgentAccessor.UserAgentMutator, org.refcodes.web.UserAgentAccessor.UserAgentProperty
Direct Known Subclasses:
HttpRestClient, LoopbackRestClient

public abstract class AbstractRestfulClient extends Object implements RestfulClient
Abstract base implementation of the RestfulClient interface being the foundation for various RestfulClient implementations such as HttpRestClient or LoopbackRestClient. The AbstractRestfulClient is preconfigured with the following MediaTypeFactory instances:
  • JsonMediaTypeFactory
  • XmlMediaTypeFactory
  • TextMediaTypeFactory
  • FormMediaTypeFactory
  • HtmlMediaTypeFactory
In your sub-classes, overwrite the method initMedaTypeFactories(), therein calling addMediaTypeFactory(MediaTypeFactory) to add (by also invoking super's initMedaTypeFactories()) or to set your own (without invoking super's initMedaTypeFactories()) MediaTypeFactory instances.