com.linkedin.restli.restspec
Class RestSpecCodec

java.lang.Object
  extended by com.linkedin.restli.restspec.RestSpecCodec

public class RestSpecCodec
extends java.lang.Object


Constructor Summary
RestSpecCodec()
          Initialize a default RestSpecCodec.
 
Method Summary
 ResourceSchema readResourceSchema(java.io.InputStream inputStream)
          Reads a ResourceSchema from the given input stream, fixes it if necessary, and returns it.
static com.linkedin.data.schema.DataSchema textToSchema(java.lang.String typeText, com.linkedin.data.schema.DataSchemaResolver schemaResolver)
          Generate a DataSchema from a JSON representation and a DataSchemaResolver.
 void writeResourceSchema(ResourceSchema schema, java.io.OutputStream outputStream)
          Write the given ResourceSchema to the OutputStream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RestSpecCodec

public RestSpecCodec()
Initialize a default RestSpecCodec.

Method Detail

readResourceSchema

public ResourceSchema readResourceSchema(java.io.InputStream inputStream)
                                  throws java.io.IOException
Reads a ResourceSchema from the given input stream, fixes it if necessary, and returns it.

Parameters:
inputStream - inputStream to read the ResourceSchema from
Returns:
a ResourceSchema
Throws:
java.io.IOException

writeResourceSchema

public void writeResourceSchema(ResourceSchema schema,
                                java.io.OutputStream outputStream)
                         throws java.io.IOException
Write the given ResourceSchema to the OutputStream.

Parameters:
schema - a ResourceSchema
outputStream - an outputStream
Throws:
java.io.IOException

textToSchema

public static com.linkedin.data.schema.DataSchema textToSchema(java.lang.String typeText,
                                                               com.linkedin.data.schema.DataSchemaResolver schemaResolver)
Generate a DataSchema from a JSON representation and a DataSchemaResolver.

Parameters:
typeText - a String JSON representation of a DataSchema
schemaResolver - the schemaResolver to use to resolve the typeText
Returns:
a DataSchema