Class CiReaderWriter

java.lang.Object
com.xebialabs.xltype.serialization.rest.CiReaderWriter
All Implemented Interfaces:
jakarta.ws.rs.ext.MessageBodyReader<Object>, jakarta.ws.rs.ext.MessageBodyWriter<Object>

@Provider @Produces({"application/json","application/xml"}) @Consumes({"application/json","application/xml"}) public class CiReaderWriter extends Object implements jakarta.ws.rs.ext.MessageBodyWriter<Object>, jakarta.ws.rs.ext.MessageBodyReader<Object>
  • Field Details

  • Constructor Details

    • CiReaderWriter

      public CiReaderWriter(com.xebialabs.deployit.plugin.api.services.Repository repository)
  • Method Details

    • createConverter

      protected ConfigurationItemConverter createConverter()
    • isWriteable

      public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType)
      Specified by:
      isWriteable in interface jakarta.ws.rs.ext.MessageBodyWriter<Object>
    • getSize

      public long getSize(Object t, Class<?> type, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType)
      Specified by:
      getSize in interface jakarta.ws.rs.ext.MessageBodyWriter<Object>
    • writeTo

      public void writeTo(Object ci, Class<?> type, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType, jakarta.ws.rs.core.MultivaluedMap<String,Object> httpHeaders, OutputStream entityStream) throws IOException, jakarta.ws.rs.WebApplicationException
      Specified by:
      writeTo in interface jakarta.ws.rs.ext.MessageBodyWriter<Object>
      Throws:
      IOException
      jakarta.ws.rs.WebApplicationException
    • getCiRefsFromLevel

      protected int getCiRefsFromLevel()
      Returns the maximum depth that child CIs are rendered. Default is 0, meaning that only simple properties of the top-level CI are written and all child CIs are written as references.
      Returns:
      an integer between 0 and Integer.MAX_VALUE.
    • isReadable

      public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType)
      Specified by:
      isReadable in interface jakarta.ws.rs.ext.MessageBodyReader<Object>
    • readFrom

      public Object readFrom(Class<Object> type, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType, jakarta.ws.rs.core.MultivaluedMap<String,String> httpHeaders, InputStream entityStream) throws IOException, jakarta.ws.rs.WebApplicationException
      Specified by:
      readFrom in interface jakarta.ws.rs.ext.MessageBodyReader<Object>
      Throws:
      IOException
      jakarta.ws.rs.WebApplicationException