Package com.azaptree.wadl

Examples of com.azaptree.wadl.Method


        final Doc doc = new Doc();
        doc.getContent().add("The command's XML schema is returned");
        resource.getDoc().add(doc);

        final Method method = new Method();
        method.setName("GET");
        resource.getMethodOrResource().add(method);

        final Response response = new Response();
        method.getResponse().add(response);
        response.getStatus().add(Long.valueOf(HttpStatus.OK_200));
        final Representation representation = new Representation();
        representation.setMediaType("application/xml");
        response.getRepresentation().add(representation);
      }
View Full Code Here


   */
  public Resource createCommandResourceWadl() {
    final Resource resource = new Resource();
    resource.setPath(this.getName());

    final Method method = new Method();
    method.setName("POST");
    resource.getMethodOrResource().add(method);

    if (hasXmlSchema()) {
      if (getRequestClass().isPresent()) {
        final com.azaptree.wadl.Request request = new com.azaptree.wadl.Request();
        method.setRequest(request);
        final Representation representation = new Representation();
        representation.setMediaType("application/xml");
        final Optional<QName> elementName = getRequestXmlElement();
        if (elementName.isPresent()) {
          representation.setElement(elementName.get());
        }
        request.getRepresentation().add(representation);
      }

      if (getResponseClass().isPresent()) {
        final Response response = new Response();
        method.getResponse().add(response);
        response.getStatus().add(Long.valueOf(HttpStatus.OK_200));
        final Representation representation = new Representation();
        representation.setMediaType("application/xml");

        final Optional<QName> elementName = getResponseXmlElement();
View Full Code Here

TOP

Related Classes of com.azaptree.wadl.Method

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.