Java 类com.sun.javadoc.SourcePosition 实例源码

项目:docdown    文件:MarkupDoc.java   
public SourcePosition getSourcePosition() {
    return new SourcePosition() {
        @Override
        public File file() {
            return sourceFilePath.toFile();
        }

        @Override
        public int line() {
            return 0;
        }

        @Override
        public int column() {
            return 0;
        }

        @Override
        public String toString() {
            return file().toString();
        }
    };
}
项目:cdk-build-util    文件:CDKGitTaglet.java   
private String expand(Tag tag) {
    // create the URL
    SourcePosition file = tag.position();
    String pathAndFile = file.file().toString();
    pathAndFile = pathAndFile.substring(pathAndFile.indexOf("src/main"));
    pathAndFile = correctSlashes(pathAndFile);
    Matcher matcher = pathPattern.matcher(pathAndFile);
    if (matcher.matches()) {
        String url = "https://github.com/cdk/cdk/tree/" + BRANCH + "/" + 
                matcher.group(1);
        return "<a href=\"" + url + "\" target=\"_blank\">" + BRANCH + "</a>";
    } else {
        System.out.println("Could not resolve class name from: " + pathAndFile);
    }
    return "";
}
项目:htmldoclet4jdk8    文件:ConfigurationImpl.java   
@Override
public boolean showMessage(SourcePosition pos, String key) {
       if (root instanceof RootDocImpl) {
           return pos == null || ((RootDocImpl) root).showTagMessages();
       }
       return true;
}
项目:umldoclet    文件:LogSupport.java   
/**
 * Reporter alias method for {@link #info(String, Object...)} with position info.
 *
 * @param msg The message (without parameters).
 * @see #info(String, Object...)
 */
@Override
public void printNotice(SourcePosition pos, String msg) {
    try (GlobalPosition gp = new GlobalPosition(pos)) {
        info(msg);
    }
}
项目:umldoclet    文件:LogSupport.java   
/**
 * Reporter alias method for {@link #warn(String, Object...)} with position info.
 *
 * @param msg The message (without parameters).
 * @see #warn(String, Object...)
 */
@Override
public void printWarning(SourcePosition pos, String msg) {
    try (GlobalPosition gp = new GlobalPosition(pos)) {
        warn(msg);
    }
}
项目:umldoclet    文件:LogSupport.java   
/**
 * Reporter alias method for {@link #error(String, Object...)} with position info.
 *
 * @param msg The message (without parameters).
 * @see #error(String, Object...)
 */
@Override
public void printError(SourcePosition pos, String msg) {
    try (GlobalPosition gp = new GlobalPosition(pos)) {
        error(msg);
    }
}
项目:closure-maven-plugin    文件:PluginConfigDoclet.java   
void error(Doc d, String s) {
  SourcePosition sp = d != null ? d.position() : null;
  if (sp != null) {
    root.printError(sp, s);
  } else {
    root.printError(s);
  }
  okSoFar = false;
}
项目:closure-maven-plugin    文件:PluginConfigDoclet.java   
void info(Doc d, String s) {
  if (verbose) {
    SourcePosition sp = d != null ? d.position() : null;
    if (log != null) {
      log.println((sp != null ? sp.toString() + " : " : "") + s);
      log.flush();
    }
    if (sp != null) {
      root.printNotice(sp, s);
    } else {
      root.printNotice(s);
    }
  }
}
项目:closure-maven-plugin    文件:PluginConfigDoclet.java   
void notice(Doc d, String s) {
  SourcePosition sp = d != null ? d.position() : null;
  if (log != null) {
    log.println((sp != null ? sp.toString() + " : " : "") + s);
    log.flush();
  }
  if (sp != null) {
    root.printNotice(sp, s);
  } else {
    root.printNotice(s);
  }
}
项目:cdk-build-util    文件:CDKIOOptionsTaglet.java   
/**
 * Extract the full class name from the tag source position.
 *
 * @param tag the tag on a given source file
 * @return the class name
 */
private static String getClassName(Tag tag){

    SourcePosition position = tag.position();
    File file               = position.file();

    String path = file.getPath().replaceAll(File.separator, ".");

    return path.substring(path.indexOf("org.openscience.cdk"),
                          path.lastIndexOf(".java"));
}
项目:markdown-doclet    文件:MarkdownDoclet.java   
/**
 * Default processing of any documentation node.
 *
 * @param doc              The documentation.
 * @param fixLeadingSpaces `true` if leading spaces should be fixed.
 *
 * @see Options#toHtml(String, boolean)
 */
protected void defaultProcess(Doc doc, boolean fixLeadingSpaces) {
    try {
        StringBuilder buf = new StringBuilder();
        buf.append(getOptions().toHtml(doc.commentText(), fixLeadingSpaces));
        buf.append('\n');
        for ( Tag tag : doc.tags() ) {
            processTag(tag, buf);
            buf.append('\n');
        }
        doc.setRawCommentText(buf.toString());
    }
    catch ( final ParserRuntimeException e ) {
        if ( doc instanceof RootDoc ) {
            printError(new SourcePosition() {
                @Override
                public File file() {
                    return options.getOverviewFile();
                }
                @Override
                public int line() {
                    return 0;
                }
                @Override
                public int column() {
                    return 0;
                }
            }, e.getMessage());
        }
        else {
            printError(doc.position(), e.getMessage());
        }
    }
}
项目:OpenJSharp    文件:SourcePositionImpl.java   
public static SourcePosition make(FileObject file, int pos,
                                  Position.LineMap lineMap) {
    if (file == null) return null;
    return new SourcePositionImpl(file, pos, lineMap);
}
项目:openjdk-jdk10    文件:SourcePositionImpl.java   
public static SourcePosition make(FileObject file, int pos,
                                  Position.LineMap lineMap) {
    if (file == null) return null;
    return new SourcePositionImpl(file, pos, lineMap);
}
项目:openjdk9    文件:SourcePositionImpl.java   
public static SourcePosition make(FileObject file, int pos,
                                  Position.LineMap lineMap) {
    if (file == null) return null;
    return new SourcePositionImpl(file, pos, lineMap);
}
项目:lookaside_java-1.8.0-openjdk    文件:SourcePositionImpl.java   
public static SourcePosition make(FileObject file, int pos,
                                  Position.LineMap lineMap) {
    if (file == null) return null;
    return new SourcePositionImpl(file, pos, lineMap);
}
项目:rapidminer-studio    文件:XMLExampleTaglet.java   
private File resolve(String file, SourcePosition source) {
    return new File(source.file().getParentFile(), file);
}
项目:jsr308-langtools    文件:SourcePositionImpl.java   
public static SourcePosition make(FileObject file, int pos,
                                  Position.LineMap lineMap) {
    if (file == null) return null;
    return new SourcePositionImpl(file, pos, lineMap);
}
项目:form-follows-function    文件:SourcePositionImpl.java   
public static SourcePosition make(String file, int pos,
                                  Position.LineMap lineMap) {
    if (file == null) return null;
    return new SourcePositionImpl(file, pos, lineMap);
}
项目:form-follows-function    文件:SourcePositionImpl.java   
public static SourcePosition make(String file, int pos,
                                  Position.LineMap lineMap) {
    if (file == null) return null;
    return new SourcePositionImpl(file, pos, lineMap);
}
项目:infobip-open-jdk-8    文件:SourcePositionImpl.java   
public static SourcePosition make(FileObject file, int pos,
                                  Position.LineMap lineMap) {
    if (file == null) return null;
    return new SourcePositionImpl(file, pos, lineMap);
}
项目:openjdk-source-code-learn    文件:SourcePositionImpl.java   
public static SourcePosition make(FileObject file, int pos,
                                  Position.LineMap lineMap) {
    if (file == null) return null;
    return new SourcePositionImpl(file, pos, lineMap);
}
项目:OLD-OpenJDK8    文件:SourcePositionImpl.java   
public static SourcePosition make(FileObject file, int pos,
                                  Position.LineMap lineMap) {
    if (file == null) return null;
    return new SourcePositionImpl(file, pos, lineMap);
}
项目:s4j    文件:SourcePositionImpl.java   
public static SourcePosition make(FileObject file, int pos,
                                  Position.LineMap lineMap) {
    if (file == null) return null;
    return new SourcePositionImpl(file, pos, lineMap);
}
项目:jdk7-langtools    文件:SourcePositionImpl.java   
public static SourcePosition make(FileObject file, int pos,
                                  Position.LineMap lineMap) {
    if (file == null) return null;
    return new SourcePositionImpl(file, pos, lineMap);
}
项目:rapidminer-5    文件:XMLExampleTaglet.java   
private File resolve(String file, SourcePosition source) {
    return new File(source.file().getParentFile(), file);
}
项目:openjdk-icedtea7    文件:SourcePositionImpl.java   
public static SourcePosition make(FileObject file, int pos,
                                  Position.LineMap lineMap) {
    if (file == null) return null;
    return new SourcePositionImpl(file, pos, lineMap);
}
项目:metricgenerator-jdk-compiler    文件:SourcePositionImpl.java   
public static SourcePosition make(FileObject file, int pos,
                                  Position.LineMap lineMap) {
    if (file == null) return null;
    return new SourcePositionImpl(file, pos, lineMap);
}
项目:INF5000-StaticProxy    文件:SourcePositionImpl.java   
public static SourcePosition make(FileObject file, int pos,
                                  Position.LineMap lineMap) {
    if (file == null) return null;
    return new SourcePositionImpl(file, pos, lineMap);
}
项目:markdown-doclet    文件:MarkdownDoclet.java   
@Override
public void printError(SourcePosition pos, String msg) {
    error();
    rootDoc.printError(pos, msg);
}
项目:markdown-doclet    文件:MarkdownDoclet.java   
@Override
public void printWarning(SourcePosition pos,
                         String msg)
{
    rootDoc.printWarning(pos, msg);
}
项目:markdown-doclet    文件:MarkdownDoclet.java   
@Override
public void printNotice(SourcePosition pos, String msg) {
    rootDoc.printNotice(pos, msg);
}
项目:markdown-doclet    文件:RootDocWrapper.java   
@Override
public SourcePosition position() {
    return delegate.position();
}
项目:markdown-doclet    文件:RootDocWrapper.java   
@Override
public void printError(SourcePosition pos, String msg) {
    delegate.printError(pos, msg);
}
项目:markdown-doclet    文件:RootDocWrapper.java   
@Override
public void printWarning(SourcePosition pos, String msg) {
    delegate.printWarning(pos, msg);
}
项目:markdown-doclet    文件:RootDocWrapper.java   
@Override
public void printNotice(SourcePosition pos, String msg) {
    delegate.printNotice(pos, msg);
}
项目:umldoclet    文件:GlobalPosition.java   
/**
 * Only sets a new global position if the source position is non-null.
 *
 * @param pos The new 'current' global position (<code>null</code> will be ignored).
 */
public GlobalPosition(SourcePosition pos) {
    this.pos = pos;
    if (pos != null) setPos(this);
}
项目:classpath    文件:ClassDocReflectedImpl.java   
public SourcePosition position() { return null; }