Class CiReaderWriter
- java.lang.Object
-
- com.xebialabs.xltype.serialization.rest.CiReaderWriter
-
- All Implemented Interfaces:
javax.ws.rs.ext.MessageBodyReader<java.lang.Object>,javax.ws.rs.ext.MessageBodyWriter<java.lang.Object>
@Provider @Produces({"application/json","application/xml"}) @Consumes({"application/json","application/xml"}) public class CiReaderWriter extends java.lang.Object implements javax.ws.rs.ext.MessageBodyWriter<java.lang.Object>, javax.ws.rs.ext.MessageBodyReader<java.lang.Object>
-
-
Field Summary
Fields Modifier and Type Field Description protected FormatFactoryformats
-
Constructor Summary
Constructors Constructor Description CiReaderWriter(com.xebialabs.deployit.plugin.api.services.Repository repository)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ConfigurationItemConvertercreateConverter()protected intgetCiRefsFromLevel()Returns the maximum depth that child CIs are rendered.longgetSize(java.lang.Object t, java.lang.Class<?> type, java.lang.reflect.Type genericType, java.lang.annotation.Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)booleanisReadable(java.lang.Class<?> type, java.lang.reflect.Type genericType, java.lang.annotation.Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)booleanisWriteable(java.lang.Class<?> type, java.lang.reflect.Type genericType, java.lang.annotation.Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)java.lang.ObjectreadFrom(java.lang.Class<java.lang.Object> type, java.lang.reflect.Type genericType, java.lang.annotation.Annotation[] annotations, javax.ws.rs.core.MediaType mediaType, javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String> httpHeaders, java.io.InputStream entityStream)voidwriteTo(java.lang.Object ci, java.lang.Class<?> type, java.lang.reflect.Type genericType, java.lang.annotation.Annotation[] annotations, javax.ws.rs.core.MediaType mediaType, javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.Object> httpHeaders, java.io.OutputStream entityStream)
-
-
-
Field Detail
-
formats
protected FormatFactory formats
-
-
Method Detail
-
createConverter
protected ConfigurationItemConverter createConverter()
-
isWriteable
public boolean isWriteable(java.lang.Class<?> type, java.lang.reflect.Type genericType, java.lang.annotation.Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)- Specified by:
isWriteablein interfacejavax.ws.rs.ext.MessageBodyWriter<java.lang.Object>
-
getSize
public long getSize(java.lang.Object t, java.lang.Class<?> type, java.lang.reflect.Type genericType, java.lang.annotation.Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)- Specified by:
getSizein interfacejavax.ws.rs.ext.MessageBodyWriter<java.lang.Object>
-
writeTo
public void writeTo(java.lang.Object ci, java.lang.Class<?> type, java.lang.reflect.Type genericType, java.lang.annotation.Annotation[] annotations, javax.ws.rs.core.MediaType mediaType, javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.Object> httpHeaders, java.io.OutputStream entityStream) throws java.io.IOException, javax.ws.rs.WebApplicationException- Specified by:
writeToin interfacejavax.ws.rs.ext.MessageBodyWriter<java.lang.Object>- Throws:
java.io.IOExceptionjavax.ws.rs.WebApplicationException
-
getCiRefsFromLevel
protected int getCiRefsFromLevel()
Returns the maximum depth that child CIs are rendered. Default is0, meaning that only simple properties of the top-level CI are written and all child CIs are written as references.- Returns:
- an integer between
0andInteger.MAX_VALUE.
-
isReadable
public boolean isReadable(java.lang.Class<?> type, java.lang.reflect.Type genericType, java.lang.annotation.Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)- Specified by:
isReadablein interfacejavax.ws.rs.ext.MessageBodyReader<java.lang.Object>
-
readFrom
public java.lang.Object readFrom(java.lang.Class<java.lang.Object> type, java.lang.reflect.Type genericType, java.lang.annotation.Annotation[] annotations, javax.ws.rs.core.MediaType mediaType, javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String> httpHeaders, java.io.InputStream entityStream) throws java.io.IOException, javax.ws.rs.WebApplicationException- Specified by:
readFromin interfacejavax.ws.rs.ext.MessageBodyReader<java.lang.Object>- Throws:
java.io.IOExceptionjavax.ws.rs.WebApplicationException
-
-