Interface InputTranslatable
-
- All Superinterfaces:
EntityProvider,Formats,Inputable,Sampleable
public interface InputTranslatable extends Inputable
Allows this entity to define the way to translate data for a reference into an entity object depending on the format requested, if you just want to use the internal methods to handle formatting the input into an entity then simply useInputable
NOTE: throwingFormatUnsupportedExceptionwill pass control over to the internal handlers for formatting, if you want to stop the request for this format type entirely then throw anIllegalStateExceptionand the processing will be halted- Author:
- Aaron Zeckoski (aaron@caret.cam.ac.uk)
-
-
Field Summary
-
Fields inherited from interface org.sakaiproject.entitybroker.entityprovider.extension.Formats
ALL_KNOWN_FORMATS, ATOM, ATOM_EXTENSIONS, ATOM_MIME_TYPE, FORM, FORM_EXTENSIONS, FORM_MIME_TYPE, HTML, HTML_EXTENSIONS, HTML_MIME_TYPE, JSON, JSON_EXTENSIONS, JSON_MIME_TYPE, JSONP, JSONP_EXTENSIONS, JSONP_MIME_TYPE, RSS, RSS_EXTENSIONS, RSS_MIME_TYPE, TXT, TXT_EXTENSIONS, TXT_MIME_TYPE, UTF_8, XML, XML_EXTENSIONS, XML_MIME_TYPE
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ObjecttranslateFormattedData(EntityReference ref, String format, InputStream input, Map<String,Object> params)Translates the input data stream in the supplied format into an entity object for this reference-
Methods inherited from interface org.sakaiproject.entitybroker.entityprovider.EntityProvider
getEntityPrefix
-
Methods inherited from interface org.sakaiproject.entitybroker.entityprovider.capabilities.Inputable
getHandledInputFormats
-
Methods inherited from interface org.sakaiproject.entitybroker.entityprovider.capabilities.Sampleable
getSampleEntity
-
-
-
-
Method Detail
-
translateFormattedData
Object translateFormattedData(EntityReference ref, String format, InputStream input, Map<String,Object> params)
Translates the input data stream in the supplied format into an entity object for this reference- Parameters:
ref- the parsed reference object which uniquely represents this entityformat- a string constant indicating the extension format (fromFormats) of the input, (example:Formats.XML)input- an stream which contains the data to make up this entity, you may assume this is UTF-8 encoded if you don't know anything else about itparams- (optional) incoming set of parameters which may be used to send data specific to this request, may be null- Returns:
- an entity object of the type used for these entities
- Throws:
FormatUnsupportedException- if you do not handle this format type (passes control to the internal handlers)EntityEncodingException- if you cannot encode the received data into an entityIllegalArgumentException- if any of the arguments are invalidIllegalStateException- for all other failures
-
-