Package com.lunatech.doclets.jax.jaxrs.model

Examples of com.lunatech.doclets.jax.jaxrs.model.Resource


    open("tr");
    around("th class='TableHeader'", "Name");
    around("th class='TableHeader'", "Description");
    close("tr");
    for (String subResourceKey : resources.keySet()) {
      Resource realSubResource = resources.get(subResourceKey);
      Resource subResource = deepFilter(realSubResource);
      open("tr");
      open("td");
      String path = subResource.getPathFrom(resource);
      if (subResource != realSubResource) {
        String realPath = realSubResource.getName();
        around("a href='" + realPath + "/index.html'", realPath);
        tag("br");
        print(" ↳ ");
        open("span class='deep-resource'");
        around("a href='" + path + "/index.html'", path);
        close("span");

      } else
        around("a href='" + path + "/index.html'", path);
      close("td");
      open("td");
      Doc javaDoc = subResource.getJavaDoc();
      if (javaDoc != null && javaDoc.firstSentenceTags() != null)
        writer.printSummaryComment(javaDoc);
      close("td");
      close("tr");
    }
View Full Code Here


    String jaxrscontext = getJAXRSConfiguration().jaxrscontext;
    String name = resource.getName();
    if (Utils.isEmptyOrNull(name))
      name = Utils.unStartSlashify(Utils.unEndSlashify(jaxrscontext));
    StringBuffer buf = new StringBuffer(name);
    Resource _resource = this.resource;
    String rel = "";
    while ((_resource = _resource.getParent()) != null) {
      rel = "../" + rel;
      String resourceName = _resource.getName();
      if (Utils.isEmptyOrNull(resourceName)) {
        if (!Utils.isEmptyOrNull(jaxrscontext)) {
          resourceName = Utils.unStartSlashify(Utils.unEndSlashify(jaxrscontext));
        } else {
          // start with slash
View Full Code Here

   * Override links to JAX-RS methods to output method + path text and an appropriate resource page link. POJO DTO pages are generated using
   * the standard page location conventions, so the default works for them.
   */
  @Override
  public String seeTagToString(SeeTag tag) {
    Resource res = null;
    String linkText = null;
    String hash = null;

    if (tag.referencedClassName() != null) {
      final ClassDoc cDoc = tag.referencedClass();

      if (cDoc == null) {
        // JavaDoc was unable to locate the DTO/resource class
        return invalidLink(tag, String.format("can't find referenced class %s", tag.referencedClassName()));
      }

      // Check for a resource class first
      res = application.findResourceClass(cDoc);
      if (res != null) {
        linkText = Utils.getAbsolutePath(this.config, res);
      }

      // If we found a resource class, then we can look further for a resource method
      if ((res != null) && (tag.referencedMemberName() != null)) {
        MemberDoc member = tag.referencedMember();
        if (member == null) {
          // No point looking if JavaDoc can't find the member
          return invalidLink(tag, String.format("can't find resource method %s in %s", tag.referencedMemberName(), cDoc.qualifiedName()));
        }

        if (member instanceof MethodDoc) {
          // Check for a resource method
          res = application.findResourceForMethod(cDoc, (MethodDoc) member);

          if (res != null) {
            ResourceMethod rMethod = res.findMethod((MethodDoc) member);
            if (rMethod != null) {
              linkText = getDisplayText(res, rMethod);
              hash = rMethod.getMethods().get(0);
            }
          }
View Full Code Here

      for (String httpMethod : method.getMethods()) {
        printMethod(resource, method, httpMethod);
      }
    }
    for (String name : resource.getResources().keySet()) {
      Resource subResource = resource.getResources().get(name);
      printResource(subResource);
    }
  }
View Full Code Here

    if (resource.hasRealMethods())
      printResourceLine(resource);
    // now recurse
    Map<String, Resource> subResources = resource.getResources();
    for (String name : subResources.keySet()) {
      Resource subResource = subResources.get(name);
      printResource(subResource);
    }
  }
View Full Code Here

    return new JAXRSConfiguration(configuration);
  }

  public void start() {
    JAXRSApplication app = new JAXRSApplication(conf);
    Resource rootResource = app.getRootResource();

    PojoTypes types = new PojoTypes(conf);

    rootResource.write(this, conf, app, types);
    new IndexWriter(conf, app, this).write();
    new SummaryWriter(conf, app, this).write();

    if (conf.enablePojoJsonDataObjects) {
      types.resolveSubclassDtos();
View Full Code Here

TOP

Related Classes of com.lunatech.doclets.jax.jaxrs.model.Resource

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.