Package com.sun.javadoc

Examples of com.sun.javadoc.SourcePosition.line()


    }
  }

  private boolean looksSynthesized(ExecutableMemberDoc memberDoc) {
    SourcePosition memberPos = memberDoc.position();
    int memberLine = memberPos.line();

    SourcePosition classPos = memberDoc.containingClass().position();
    int classLine = classPos.line();

    if (memberLine == classLine) {
View Full Code Here


  private boolean looksSynthesized(ExecutableMemberDoc memberDoc) {
    SourcePosition memberPos = memberDoc.position();
    int memberLine = memberPos.line();

    SourcePosition classPos = memberDoc.containingClass().position();
    int classLine = classPos.line();

    if (memberLine == classLine) {
      return true;
    } else {
      return false;
View Full Code Here

      ClassDoc cd = cda[i];

      // Make sure we have source.
      //
      SourcePosition p = cd.position();
      if (p == null || p.line() == 0) {
        // Skip this since it isn't ours (otherwise we would have source).
        //
        continue;
      }
View Full Code Here

    //
    // Add annotations
    //
    for (MethodDoc md : methodDocs) {
      SourcePosition sp = md.position();
      int line = sp.line() + 2;
      if (isTest(md)) {
        lines.add(line, "  @Test" + groupsLine);
      }
      else if (isSetUp(md)) {
        ppp("ADDING NEW BEFORE AT " + line);
View Full Code Here

  private void setPosition(MAnnotation target, Tag tag) {
    //add source position info, if available
    SourcePosition pos = tag.position();
    if (pos != null) {
      MSourcePosition mpos = target.createSourcePosition();
      mpos.setLine(pos.line());
      mpos.setColumn(pos.column());
      if (pos.file() != null) mpos.setSourceURI(pos.file().toURI());
    }
  }
View Full Code Here

  private void setPosition(MAnnotation target, Tag tag) {
    //add source position info, if available
    SourcePosition pos = tag.position();
    if (pos != null) {
      MSourcePosition mpos = target.createSourcePosition();
      mpos.setLine(pos.line());
      mpos.setColumn(pos.column());
      if (pos.file() != null) mpos.setSourceURI(pos.file().toURI());
    }
  }
View Full Code Here

    //TODO improvement: There is a tree field in the doc with the code in it. May be that can be used.
    //Be aware that when no constructor is declared a default constructor is created including source code 
    SourcePosition start = method.position();
    ClassDoc classDoc = method.containingClass();
   
    int startline = start.line();
    int endline = -1;
    boolean foundMethod = false;
    for (MethodDoc methoddoc: classDoc.methods()){
      if (foundMethod){
        endline = methoddoc.position().line();
View Full Code Here

      return false;
   
   
    SourcePosition sourcecodePosition = constructor.position();
    ClassOrInterfaceSource source =  new DocUtils().getSourceFile(sourcecodePosition.file());
    String declarationLine = source.getSourcecode(sourcecodePosition.line(), sourcecodePosition.line() +1);
    for (String word: declarationLine.split("\\s")) {//whitespace
      if ("class".equals(word)) //then the line is probable the class definition line
        return true;
    }
   
View Full Code Here

      return false;
   
   
    SourcePosition sourcecodePosition = constructor.position();
    ClassOrInterfaceSource source =  new DocUtils().getSourceFile(sourcecodePosition.file());
    String declarationLine = source.getSourcecode(sourcecodePosition.line(), sourcecodePosition.line() +1);
    for (String word: declarationLine.split("\\s")) {//whitespace
      if ("class".equals(word)) //then the line is probable the class definition line
        return true;
    }
   
View Full Code Here

    // Be aware that the position of the method does not include comments
    // and Annotations.

    ClassDoc classDoc = method.containingClass();
   
    int startline = start.line();
    int endline = -1;
    boolean foundMethod = false;
    for (MethodDoc methoddoc: classDoc.methods()){
      if (foundMethod){
        endline = methoddoc.position().line();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.