| 
 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface DecodedContentFactory
Interface that must be implemented by resource factories.
A resource factory is used to create an instance of the
 appropriate derived class of Resource based on the
 content-type of the retrieved resource, and possibly on the
 context under which the resource is to be created.
When a resource couldn't be retrieved because of some network error,
 an instance of the RetrievalFailedContent class must be returned.
When a resource's content-type is not supported for the given context,
 an instance of the NotSupportedContent class must be returned.
| Method Summary | |
|---|---|
|  DecodedContent | decodeContent(java.net.URI uri,
              java.util.List<RetrievalElement> retrieved,
              ResourceContext resourceContext)Creates an instance of a Resourcebased on the given parameters. | 
|  boolean | isContentSupported(java.lang.String contentType,
                   ResourceContext resourceContext)Returns truewhen the factory is able to create content
 that match the given content-type under the given context. | 
| Method Detail | 
|---|
DecodedContent decodeContent(java.net.URI uri,
                             java.util.List<RetrievalElement> retrieved,
                             ResourceContext resourceContext)
                             throws TestException
Resource based on the given parameters.
uri - absolute URI of the resource.retrieved - the retrieved representation of the resource.resourceContext - the context that gave birth to the resource.
null.
TestException - an unexpected error occurred while retrieving the resource.
boolean isContentSupported(java.lang.String contentType,
                           ResourceContext resourceContext)
true when the factory is able to create content
 that match the given content-type under the given context.
contentType - Content-Type to checkresourceContext - Context under which the resource would be created
true when the content-type is supported,
         false otherwise| 
 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||