当前位置: 首页>>代码示例>>Java>>正文


Java SourcePosition类代码示例

本文整理汇总了Java中com.sun.javadoc.SourcePosition的典型用法代码示例。如果您正苦于以下问题:Java SourcePosition类的具体用法?Java SourcePosition怎么用?Java SourcePosition使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


SourcePosition类属于com.sun.javadoc包,在下文中一共展示了SourcePosition类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getSourcePosition

import com.sun.javadoc.SourcePosition; //导入依赖的package包/类
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();
        }
    };
}
 
开发者ID:nicolaschriste,项目名称:docdown,代码行数:24,代码来源:MarkupDoc.java

示例2: expand

import com.sun.javadoc.SourcePosition; //导入依赖的package包/类
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 "";
}
 
开发者ID:cdk,项目名称:cdk-build-util,代码行数:17,代码来源:CDKGitTaglet.java

示例3: showMessage

import com.sun.javadoc.SourcePosition; //导入依赖的package包/类
@Override
public boolean showMessage(SourcePosition pos, String key) {
       if (root instanceof RootDocImpl) {
           return pos == null || ((RootDocImpl) root).showTagMessages();
       }
       return true;
}
 
开发者ID:WinRoad-NET,项目名称:htmldoclet4jdk8,代码行数:8,代码来源:ConfigurationImpl.java

示例4: printNotice

import com.sun.javadoc.SourcePosition; //导入依赖的package包/类
/**
 * 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);
    }
}
 
开发者ID:talsma-ict,项目名称:umldoclet,代码行数:13,代码来源:LogSupport.java

示例5: printWarning

import com.sun.javadoc.SourcePosition; //导入依赖的package包/类
/**
 * 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);
    }
}
 
开发者ID:talsma-ict,项目名称:umldoclet,代码行数:13,代码来源:LogSupport.java

示例6: printError

import com.sun.javadoc.SourcePosition; //导入依赖的package包/类
/**
 * 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);
    }
}
 
开发者ID:talsma-ict,项目名称:umldoclet,代码行数:13,代码来源:LogSupport.java

示例7: error

import com.sun.javadoc.SourcePosition; //导入依赖的package包/类
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;
}
 
开发者ID:mikesamuel,项目名称:closure-maven-plugin,代码行数:10,代码来源:PluginConfigDoclet.java

示例8: info

import com.sun.javadoc.SourcePosition; //导入依赖的package包/类
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);
    }
  }
}
 
开发者ID:mikesamuel,项目名称:closure-maven-plugin,代码行数:15,代码来源:PluginConfigDoclet.java

示例9: notice

import com.sun.javadoc.SourcePosition; //导入依赖的package包/类
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);
  }
}
 
开发者ID:mikesamuel,项目名称:closure-maven-plugin,代码行数:13,代码来源:PluginConfigDoclet.java

示例10: getClassName

import com.sun.javadoc.SourcePosition; //导入依赖的package包/类
/**
 * 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"));
}
 
开发者ID:cdk,项目名称:cdk-build-util,代码行数:17,代码来源:CDKIOOptionsTaglet.java

示例11: defaultProcess

import com.sun.javadoc.SourcePosition; //导入依赖的package包/类
/**
 * 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());
        }
    }
}
 
开发者ID:Abnaxos,项目名称:markdown-doclet,代码行数:42,代码来源:MarkdownDoclet.java

示例12: make

import com.sun.javadoc.SourcePosition; //导入依赖的package包/类
public static SourcePosition make(FileObject file, int pos,
                                  Position.LineMap lineMap) {
    if (file == null) return null;
    return new SourcePositionImpl(file, pos, lineMap);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:6,代码来源:SourcePositionImpl.java

示例13: resolve

import com.sun.javadoc.SourcePosition; //导入依赖的package包/类
private File resolve(String file, SourcePosition source) {
	return new File(source.file().getParentFile(), file);
}
 
开发者ID:rapidminer,项目名称:rapidminer-studio,代码行数:4,代码来源:XMLExampleTaglet.java

示例14: make

import com.sun.javadoc.SourcePosition; //导入依赖的package包/类
public static SourcePosition make(String file, int pos,
                                  Position.LineMap lineMap) {
    if (file == null) return null;
    return new SourcePositionImpl(file, pos, lineMap);
}
 
开发者ID:unktomi,项目名称:form-follows-function,代码行数:6,代码来源:SourcePositionImpl.java

示例15: printError

import com.sun.javadoc.SourcePosition; //导入依赖的package包/类
@Override
public void printError(SourcePosition pos, String msg) {
    error();
    rootDoc.printError(pos, msg);
}
 
开发者ID:Abnaxos,项目名称:markdown-doclet,代码行数:6,代码来源:MarkdownDoclet.java


注:本文中的com.sun.javadoc.SourcePosition类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。