Package org.apache.solr.client.solrj.request

# Class RequestWriter

java.lang.Object
org.apache.solr.client.solrj.request.RequestWriter

Direct Known Subclasses:
  `JavaBinRequestWriter`, `XMLRequestWriter`

public abstract class RequestWriter extends Object
A RequestWriter is used to write requests to Solr.

A subclass can override the methods in this class to supply a custom format in which a request can be sent.

Since:
  solr 1.4

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static interface`
`RequestWriter.ContentWriter`
`static class`
`RequestWriter.StringPayloadContentWriter`

## Constructor Summary

Constructors
Constructor
Description
`RequestWriter()`

## Method Summary

Modifier and Type
Method
Description
`abstract Collection<ContentStream>`
`getContentStreams(SolrRequest<?> req)`
Deprecated.
Use `getContentWriter(SolrRequest)`.
`abstract RequestWriter.ContentWriter`
`getContentWriter(SolrRequest<?> req)`
To be implemented by subclasses to serialize update requests into the appropriate format.
`abstract String`
`getUpdateContentType()`
`protected boolean`
`isEmpty(UpdateRequest updateRequest)`
`protected boolean`
`isNull(List<?> l)`
`protected boolean`
`isNull(Map<?,?> l)`
`abstract void`
`write(SolrRequest<?> request, OutputStream os)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### RequestWriter

public RequestWriter()

## Method Details

### getContentWriter

public abstract RequestWriter.ContentWriter getContentWriter(SolrRequest<?> req)
To be implemented by subclasses to serialize update requests into the appropriate format.

If this method returns null, `getContentStreams(SolrRequest)` is then invoked to get content.

### getContentStreams

@Deprecated public abstract Collection<ContentStream> getContentStreams(SolrRequest<?> req) throws IOException
Deprecated.
Use `getContentWriter(SolrRequest)`.

Throws:
  `IOException`

### isEmpty

protected boolean isEmpty(UpdateRequest updateRequest)

### write

public abstract void write(SolrRequest<?> request, OutputStream os) throws IOException

Throws:
  `IOException`

### getUpdateContentType

public abstract String getUpdateContentType()

### isNull

protected boolean isNull(List<?> l)

### isNull

protected boolean isNull(Map<?,?> l)