Package com.sun.javadoc

Examples of com.sun.javadoc.MethodDoc


  }

  @Override
  public String getReturnDoc(Method method)
  {
    final MethodDoc methodDoc = _doclet.getMethodDoc(method);
    if (methodDoc != null)
    {
      for (Tag tag : methodDoc.tags())
      {
        if(tag.name().toLowerCase().equals("@return"))
        {
          return buildDoc(tag.text());
        }
View Full Code Here


  }

  @Override
  public String getMethodDoc(Method method)
  {
    final MethodDoc doc = _doclet.getMethodDoc(method);
    if (doc == null)
    {
      return null;
    }

    return buildDoc(doc.commentText());
  }
View Full Code Here

  }

  @Override
  public String getMethodDeprecatedTag(Method method)
  {
    final MethodDoc doc = _doclet.getMethodDoc(method);
    if (doc == null)
    {
      return null;
    }
View Full Code Here

  }

  @Override
  public String getParamDoc(Method method, String name)
  {
    final MethodDoc methodDoc = _doclet.getMethodDoc(method);
    if (methodDoc != null)
    {
      for (ParamTag tag: methodDoc.paramTags())
      {
        if (name.equals(tag.parameterName()))
        {
          return buildDoc(tag.parameterComment());
        }
View Full Code Here

      children.add( new DocTreeNode(this, doc, TYPE_INFO));
     
    }
    else if (doc instanceof MethodDoc)
    {
      MethodDoc docInstance = (MethodDoc) doc;
     
    }
    else if (doc instanceof ConstructorDoc)
    {
      ConstructorDoc docInstance = (ConstructorDoc) doc;
View Full Code Here

      AnnotationTypeElementDoc docInstance = (AnnotationTypeElementDoc) doc;
     
    }
    else if (doc instanceof MethodDoc)
    {
      MethodDoc docInstance = (MethodDoc) doc;
     
    }
    else if (doc instanceof ClassDoc)
    {
      ClassDoc docInstance = (ClassDoc) doc;
      Doc[] substructure;

      substructure = docInstance.enumConstants();
      Arrays.sort(substructure);
      addChildDocs(substructure );
     
      substructure = docInstance.fields();
      Arrays.sort(substructure);
      addChildDocs(substructure );
     
      substructure = docInstance.constructors();
      Arrays.sort(substructure);
      addChildDocs(substructure );
     
      substructure = docInstance.methods();
      Arrays.sort(substructure);
      addChildDocs(substructure );

      substructure = docInstance.innerClasses();
      Arrays.sort(substructure);
      addChildDocs(substructure );
     
     
    }
    else if (doc instanceof ConstructorDoc)
    {
      ConstructorDoc docInstance = (ConstructorDoc) doc;
     
    }
    else if (doc instanceof FieldDoc)
    {
      FieldDoc docInstance = (FieldDoc) doc;
     
    }
    else if (doc instanceof PackageDoc)
    {
      PackageDoc docInstance = (PackageDoc) doc;
      ClassDoc[] classes = docInstance.allClasses();
      Arrays.sort(classes);
      addChildDocs(classes );
    }
    else
    {
View Full Code Here

      AnnotationTypeElementDoc docInstance = (AnnotationTypeElementDoc) doc;
      return "AnnotationTypeElement " + docInstance.name();
    }
    else if (doc instanceof MethodDoc)
    {
      MethodDoc docInstance = (MethodDoc) doc;
      return "Method " + docInstance.name();
    }
    else if (doc instanceof ClassDoc)
    {
      ClassDoc docInstance = (ClassDoc) doc;
      return "Class " + docInstance.name();
    }
    else if (doc instanceof ConstructorDoc)
    {
      ConstructorDoc docInstance = (ConstructorDoc) doc;
      return "Constructor " + docInstance.name();
    }
    else if (doc instanceof FieldDoc)
    {
      FieldDoc docInstance = (FieldDoc) doc;
      return "Field " + docInstance.name();
    }
    else if (doc instanceof PackageDoc)
    {
      PackageDoc docInstance = (PackageDoc) doc;
      return "Package " + docInstance.name();
    }
    else
    {
      return  doc.getClass().getName();
    }
View Full Code Here

     **/
    private void writeStubMethod(IndentingWriter p, int opnum)
        throws IOException
    {
        RemoteClass.Method method = remoteMethods[opnum];
        MethodDoc methodDoc = method.methodDoc();
        String methodName = methodDoc.name();
        Type[] paramTypes = method.parameterTypes();
        String paramNames[] = nameParameters(paramTypes);
        Type returnType = methodDoc.returnType();
        ClassDoc[] exceptions = method.exceptionTypes();

        /*
         * Declare stub method; throw exceptions declared in remote
         * interface(s).
 
View Full Code Here

     **/
    private void writeSkeletonDispatchCase(IndentingWriter p, int opnum)
        throws IOException
    {
        RemoteClass.Method method = remoteMethods[opnum];
        MethodDoc methodDoc = method.methodDoc();
        String methodName = methodDoc.name();
        Type paramTypes[] = method.parameterTypes();
        String paramNames[] = nameParameters(paramTypes);
        Type returnType = methodDoc.returnType();

        p.pOlnI("case " + opnum + ": // " +
            Util.getFriendlyUnqualifiedSignature(methodDoc));
        /*
         * Use nested block statement inside case to provide an independent
         * namespace for local variables used to unmarshal parameters for
         * this remote method.
         */
        p.pOlnI("{");

        if (paramTypes.length > 0) {
            /*
             * Declare local variables to hold arguments.
             */
            for (int i = 0; i < paramTypes.length; i++) {
                p.pln(paramTypes[i].toString() + " " + paramNames[i] + ";");
            }

            /*
             * Unmarshal arguments from call stream.
             */
            p.plnI("try {");
            p.pln("java.io.ObjectInput in = call.getInputStream();");
            boolean objectsRead = writeUnmarshalArguments(p, "in",
                paramTypes, paramNames);
            p.pOlnI("} catch (java.io.IOException e) {");
            p.pln("throw new " + UNMARSHAL_EXCEPTION +
                "(\"error unmarshalling arguments\", e);");
            /*
             * If any only if readObject has been invoked, we must catch
             * ClassNotFoundException as well as IOException.
             */
            if (objectsRead) {
                p.pOlnI("} catch (java.lang.ClassNotFoundException e) {");
                p.pln("throw new " + UNMARSHAL_EXCEPTION +
                    "(\"error unmarshalling arguments\", e);");
            }
            p.pOlnI("} finally {");
            p.pln("call.releaseInputStream();");
            p.pOln("}");
        } else {
            p.pln("call.releaseInputStream();");
        }

        if (!Util.isVoid(returnType)) {
            /*
             * Declare variable to hold return type, if not void.
             */
            p.p(returnType.toString() + " $result = ");
                                                        // REMIND: why $?
        }

        /*
         * Invoke the method on the server object.  If the remote
         * implementation class is private, then we don't have a
         * reference cast to it, and so we try to cast to the remote
         * object reference to the method's declaring interface here.
         */
        String target = remoteClass.classDoc().isPrivate() ?
            "((" + methodDoc.containingClass().qualifiedName() + ") obj)" :
            "server";
        p.p(target + "." + methodName + "(");
        for (int i = 0; i < paramNames.length; i++) {
            if (i > 0)
                p.p(", ");
View Full Code Here

            /*
             * Look up the Method object in the somewhat arbitrary
             * interface that we find in the Method object.
             */
            RemoteClass.Method method = remoteMethods[i];
            MethodDoc methodDoc = method.methodDoc();
            String methodName = methodDoc.name();
            Type paramTypes[] = method.parameterTypes();

            p.p(methodDoc.containingClass().qualifiedName() + ".class.getMethod(\"" +
                methodName + "\", new java.lang.Class[] {");
            for (int j = 0; j < paramTypes.length; j++) {
                if (j > 0)
                    p.p(", ");
                p.p(paramTypes[j].toString() + ".class");
View Full Code Here

TOP

Related Classes of com.sun.javadoc.MethodDoc

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.