//JAVA TO C# CONVERTER WARNING: 'final' parameters are ignored unless the option to convert to C# 7.2 'in' parameters is selected: //ORIGINAL LINE: private Object stream(final Representation representation, final StreamingFormat streamingFormat, final boolean mustFail) private object Stream(Representation representation, StreamingFormat streamingFormat, bool mustFail) { return(( StreamingOutput )output => { RepresentationFormat outputStreamFormat = streamingFormat.WriteTo(output); try { representation.Serialize(outputStreamFormat, _baseUri, _extensions); if (!mustFail) { _representationWriteHandler.onRepresentationWritten(); } } catch (Exception e) { if (e is NodeNotFoundException || e is RelationshipNotFoundException) { throw new WebApplicationException(NotFound(e)); } if (e is BadInputException) { throw new WebApplicationException(BadRequest(e)); } throw new WebApplicationException(e, ServerError(e)); } finally { _representationWriteHandler.onRepresentationFinal(); } }); }
internal override string Serialize(RepresentationFormat format, URI baseUri, ExtensionInjector extensions) { //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final String result = format.serializeValue(type, value); string result = format.SerializeValue(Type, _value); format.Complete(); return(result); }
private RepresentationFormat ForMediaTypes(IList <MediaType> acceptable) { foreach (MediaType type in acceptable) { RepresentationFormat format = _formats[type]; if (format != null) { return(format); } } return(null); }
public OutputFormat OutputFormat(IList <MediaType> acceptable, URI baseUri, MultivaluedMap <string, string> requestHeaders) { RepresentationFormat format = ForHeaders(acceptable, requestHeaders); if (format == null) { format = ForMediaTypes(acceptable); } if (format == null) { format = UseDefault(acceptable); } return(new OutputFormat(format, baseUri, ExtensionManager)); }
public InputFormat InputFormat(MediaType type) { if (type == null) { return(UseDefault()); } RepresentationFormat format = _formats[type]; if (format != null) { return(format); } format = _formats[new MediaType(type.Type, type.Subtype)]; if (format != null) { return(format); } return(UseDefault(type)); }
internal override string serialize(RepresentationFormat format, URI baseUri, ExtensionInjector extensions) { return(Serializer.JoinBaseWithRelativePath(baseUri, _path)); }
public DefaultFormat(RepresentationFormat inner, ICollection <MediaType> supported, params MediaType[] requested) : base(MediaType.APPLICATION_JSON_TYPE) { this._inner = inner; this._supported = supported; this._requested = requested; }
public OutputFormat(RepresentationFormat format, URI baseUri, ExtensionInjector extensions) { this._format = format; this._baseUri = baseUri; this._extensions = extensions; }
public static void Write(Representation representation, RepresentationFormat format, URI baseUri) { representation.Serialize(format, baseUri, null); }
public ParameterListAnonymousInnerClass(RepresentationFormat outerInstance, UnknownType readMap) : base(readMap) { this.outerInstance = outerInstance; }