Class WadlUtils


  • public class WadlUtils
    extends java.lang.Object
    Utils for wadl processing.
    • Constructor Summary

      Constructors 
      Constructor Description
      WadlUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean isDetailedWadlRequested​(javax.ws.rs.core.UriInfo uriInfo)
      Return true if generation of full WADL with extended resources is requested.
      static <T> T unmarshall​(java.io.InputStream inputStream, javax.xml.parsers.SAXParserFactory saxParserFactory, java.lang.Class<T> resultClass)
      Unmarshal a jaxb bean into a type of resultClass from the given inputStream.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • DETAILED_WADL_QUERY_PARAM

        public static final java.lang.String DETAILED_WADL_QUERY_PARAM
        Name of the query parameter that allows generation of full WADL including extended resource.
        See Also:
        Constant Field Values
    • Constructor Detail

      • WadlUtils

        public WadlUtils()
    • Method Detail

      • unmarshall

        public static <T> T unmarshall​(java.io.InputStream inputStream,
                                       javax.xml.parsers.SAXParserFactory saxParserFactory,
                                       java.lang.Class<T> resultClass)
                                throws javax.xml.bind.JAXBException,
                                       javax.xml.parsers.ParserConfigurationException,
                                       org.xml.sax.SAXException
        Unmarshal a jaxb bean into a type of resultClass from the given inputStream.
        Type Parameters:
        T - Type of the result jaxb bean.
        Parameters:
        inputStream - Input stream that contains input xml that should be processed.
        saxParserFactory - Sax parser factory for unmarshalling xml.
        resultClass - Class of the result bean into which the content of inputStream should be unmarshalled.
        Returns:
        Unmarshalled jaxb bean.
        Throws:
        javax.xml.bind.JAXBException - In case of jaxb problem.
        javax.xml.parsers.ParserConfigurationException - In case of problem with parsing xml.
        org.xml.sax.SAXException - In case of problem with parsing xml.
      • isDetailedWadlRequested

        public static boolean isDetailedWadlRequested​(javax.ws.rs.core.UriInfo uriInfo)
        Return true if generation of full WADL with extended resources is requested.
        Parameters:
        uriInfo - URI info of the request.
        Returns:
        true if full detailed WADL should be generated; false otherwise.