Package com.sun.javadoc

Examples of com.sun.javadoc.MemberDoc


    // Intentionally reverses the order.
    //
    String myId;
    String myTitle;
    if (doc instanceof MemberDoc) {
      MemberDoc memberDoc = (MemberDoc) doc;
      myId = getId(memberDoc);
      myTitle = memberDoc.name();
    } else if (doc instanceof ClassDoc) {
      ClassDoc classDoc = (ClassDoc) doc;
      myId = getId(classDoc);
      myTitle = classDoc.name();
    } else if (doc instanceof PackageDoc) {
View Full Code Here


    return packageDoc.name();
  }

  private Doc getParentDoc(Doc doc) {
    if (doc instanceof MemberDoc) {
      MemberDoc memberDoc = (MemberDoc) doc;
      return memberDoc.containingClass();
    } else if (doc instanceof ClassDoc) {
      ClassDoc classDoc = (ClassDoc) doc;
      Doc enclosingClass = classDoc.containingClass();
      if (enclosingClass != null) {
        return enclosingClass;
View Full Code Here

  private void processSeeTag(SeeTag seeTag) {
    String ref = null;
    ClassDoc cd = null;
    PackageDoc pd = null;
    MemberDoc md = null;
    String title = null;

    // Check for HTML links
    if (seeTag.text().startsWith("<")) {
      // TODO: ignore for now
View Full Code Here

        }
    }

    private static String getSerializedLinkFromTag(final SeeTag linkTag) {
        final MemberDoc referencedMember = linkTag.referencedMember();

        if (referencedMember == null) {
            throw new NullPointerException("Referenced member of @link " + print(linkTag) + " cannot be resolved.");
        }

        if (!referencedMember.isStatic()) {
            LOG.warning("Referenced member of @link " + print(linkTag) + " is not static." +
                    " Right now only references to static members are supported.");
            return null;
        }

        /* Get referenced example bean
         */
        final ClassDoc containingClass = referencedMember.containingClass();
        final Object object;
        try {
            Field declaredField = Class.forName(containingClass.qualifiedName(), false, Thread.currentThread()
                    .getContextClassLoader()).getDeclaredField(referencedMember.name());
            if (referencedMember.isFinal()) {
                declaredField.setAccessible(true);
            }
            object = declaredField.get(null);
            LOG.log(Level.FINE, "Got object " + object);
        } catch (Exception e) {
            LOG.info("Have classloader: " + ResourceDoclet.class.getClassLoader().getClass());
            LOG.info("Have thread classloader " + Thread.currentThread().getContextClassLoader().getClass());
            LOG.info("Have system classloader " + ClassLoader.getSystemClassLoader().getClass());
            LOG.log(Level.SEVERE, "Could not get field " + referencedMember.qualifiedName(), e);
            return null;
        }

        /* marshal the bean to xml
         */
 
View Full Code Here

        }
    }

    private static String getSerializedLinkFromTag(final SeeTag linkTag) {
        final MemberDoc referencedMember = linkTag.referencedMember();

        if (referencedMember == null) {
            throw new NullPointerException("Referenced member of @link " + print(linkTag) + " cannot be resolved.");
        }

        if (!referencedMember.isStatic()) {
            LOG.warning("Referenced member of @link " + print(linkTag) + " is not static." +
                    " Right now only references to static members are supported.");
            return null;
        }

        /* Get referenced example bean
         */
        final ClassDoc containingClass = referencedMember.containingClass();
        final Object object;
        try {
            final Field declaredField = Class.forName(containingClass.qualifiedName(), false, Thread.currentThread()
                    .getContextClassLoader()).getDeclaredField(referencedMember.name());
            if (referencedMember.isFinal()) {
                declaredField.setAccessible(true);
            }
            object = declaredField.get(null);
            LOG.log(Level.FINE, "Got object " + object);
        } catch (final Exception e) {
            LOG.info("Have classloader: " + ResourceDoclet.class.getClassLoader().getClass());
            LOG.info("Have thread classloader " + Thread.currentThread().getContextClassLoader().getClass());
            LOG.info("Have system classloader " + ClassLoader.getSystemClassLoader().getClass());
            LOG.log(Level.SEVERE, "Could not get field " + referencedMember.qualifiedName(), e);
            return null;
        }

        /* marshal the bean to xml
         */
 
View Full Code Here

        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()));
        }
View Full Code Here

           
        }
    }

    private static String getSerializedLinkFromTag( final SeeTag linkTag ) {
        final MemberDoc referencedMember = linkTag.referencedMember();
       
        if ( referencedMember == null ) {
            throw new NullPointerException( "Referenced member of @link "+ print( linkTag ) +" cannot be resolved." );
        }
       
        if ( !referencedMember.isStatic() ) {
            LOG.warning( "Referenced member of @link "+ print( linkTag ) +" is not static." +
                    " Right now only references to static members are supported." );
            return null;
        }
       
        /* Get referenced example bean
         */
        final ClassDoc containingClass = referencedMember.containingClass();
        final Object object;
        try {
            Field declaredField = Class.forName( containingClass.qualifiedName(), false, Thread.currentThread().getContextClassLoader() ).getDeclaredField( referencedMember.name() );
            if ( referencedMember.isFinal() ) {
                declaredField.setAccessible( true );
            }
            object = declaredField.get( null );
            LOG.log( Level.FINE, "Got object " + object );
        } catch ( Exception e ) {
            LOG.info( "Have classloader: " + ResourceDoclet.class.getClassLoader().getClass() );
            LOG.info( "Have thread classloader " + Thread.currentThread().getContextClassLoader().getClass() );
            LOG.info( "Have system classloader " + ClassLoader.getSystemClassLoader().getClass() );
            LOG.log( Level.SEVERE, "Could not get field " + referencedMember.qualifiedName(), e );
            return null;
        }
       
        /* marshal the bean to xml
         */
 
View Full Code Here

           
        }
    }

    private static String getSerializedLinkFromTag( final SeeTag linkTag ) {
        final MemberDoc referencedMember = linkTag.referencedMember();
       
        if ( referencedMember == null ) {
            throw new NullPointerException( "Referenced member of @link "+ print( linkTag ) +" cannot be resolved." );
        }
       
        if ( !referencedMember.isStatic() ) {
            LOG.warning( "Referenced member of @link "+ print( linkTag ) +" is not static." +
                    " Right now only references to static members are supported." );
            return null;
        }
       
        /* Get referenced example bean
         */
        final ClassDoc containingClass = referencedMember.containingClass();
        final Object object;
        try {
            Field declaredField = Class.forName( containingClass.qualifiedName(), false, Thread.currentThread().getContextClassLoader() ).getDeclaredField( referencedMember.name() );
            if ( referencedMember.isFinal() ) {
                declaredField.setAccessible( true );
            }
            object = declaredField.get( null );
            LOG.log( Level.FINE, "Got object " + object );
        } catch ( Exception e ) {
            LOG.info( "Have classloader: " + ResourceDoclet.class.getClassLoader().getClass() );
            LOG.info( "Have thread classloader " + Thread.currentThread().getContextClassLoader().getClass() );
            LOG.info( "Have system classloader " + ClassLoader.getSystemClassLoader().getClass() );
            LOG.log( Level.SEVERE, "Could not get field " + referencedMember.qualifiedName(), e );
            return null;
        }
       
        /* marshal the bean to xml
         */
 
View Full Code Here

TOP

Related Classes of com.sun.javadoc.MemberDoc

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.