Java源码示例:com.sun.javadoc.SourcePosition
示例1
/** Copy the given file.
*
* @param filename the file to copy.
* @param configuration the configuration.
* @throws DocletAbortException a runtime exception.
*/
public static void performCopy(String filename, SarlConfiguration configuration) {
if (filename.isEmpty()) {
return;
}
try {
final DocFile fromfile = DocFile.createFileForInput(configuration, filename);
final DocPath path = DocPath.create(fromfile.getName());
final DocFile toFile = DocFile.createFileForOutput(configuration, path);
if (toFile.isSameFile(fromfile)) {
return;
}
configuration.message.notice((SourcePosition) null,
"doclet.Copying_File_0_To_File_1", //$NON-NLS-1$
fromfile.toString(), path.getPath());
toFile.copyFile(fromfile);
} catch (IOException exc) {
configuration.message.error((SourcePosition) null,
"doclet.perform_copy_exception_encountered", //$NON-NLS-1$
exc.toString());
throw new DocletAbortException(exc);
}
}
示例2
/**
* 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());
}
}
}
示例3
public static SourcePosition make(FileObject file, int pos,
Position.LineMap lineMap) {
if (file == null) return null;
return new SourcePositionImpl(file, pos, lineMap);
}
示例4
public static SourcePosition make(FileObject file, int pos,
Position.LineMap lineMap) {
if (file == null) return null;
return new SourcePositionImpl(file, pos, lineMap);
}
示例5
@Override
public void printError(SourcePosition position, String error) {
errors.append(error).append("\n");
}
示例6
@Override
public void printNotice(SourcePosition position, String notice) {
notices.append(notice).append("\n");
}
示例7
@Override
public void printWarning(SourcePosition position, String warning) {
warnings.append(warning).append("\n");
}
示例8
public static SourcePosition make(FileObject file, int pos,
Position.LineMap lineMap) {
if (file == null) return null;
return new SourcePositionImpl(file, pos, lineMap);
}
示例9
public static SourcePosition make(FileObject file, int pos,
Position.LineMap lineMap) {
if (file == null) return null;
return new SourcePositionImpl(file, pos, lineMap);
}
示例10
public static SourcePosition make(FileObject file, int pos,
Position.LineMap lineMap) {
if (file == null) return null;
return new SourcePositionImpl(file, pos, lineMap);
}
示例11
public static SourcePosition make(FileObject file, int pos,
Position.LineMap lineMap) {
if (file == null) return null;
return new SourcePositionImpl(file, pos, lineMap);
}
示例12
public static SourcePosition make(FileObject file, int pos,
Position.LineMap lineMap) {
if (file == null) return null;
return new SourcePositionImpl(file, pos, lineMap);
}
示例13
public static SourcePosition make(FileObject file, int pos,
Position.LineMap lineMap) {
if (file == null) return null;
return new SourcePositionImpl(file, pos, lineMap);
}
示例14
private File resolve(String file, SourcePosition source) {
return new File(source.file().getParentFile(), file);
}
示例15
@Override
public SourcePosition position() {
return this.delegate.position();
}
示例16
@Override
public void printError(SourcePosition arg0, String arg1) {
this.delegate.printError(arg0, arg1);
}
示例17
@Override
public void printNotice(SourcePosition arg0, String arg1) {
this.delegate.printNotice(arg0, arg1);
}
示例18
@Override
public void printWarning(SourcePosition arg0, String arg1) {
this.delegate.printWarning(arg0, arg1);
}
示例19
@Override
public SourcePosition position() {
return this.delegate.position();
}
示例20
@Override
public SourcePosition position() {
return this.delegate.position();
}
示例21
@Override
public SourcePosition position() {
return this.delegate.position();
}
示例22
@Override
public SourcePosition position() {
return this.delegate.position();
}
示例23
@Override
public SourcePosition position() {
return this.delegate.position();
}
示例24
@Override
public SourcePosition position() {
return this.delegate.position();
}
示例25
@Override
public SourcePosition position() {
return this.delegate.position();
}
示例26
@Override
public void printError(SourcePosition pos, String msg) {
error();
rootDoc.printError(pos, msg);
}
示例27
@Override
public void printWarning(SourcePosition pos,
String msg)
{
rootDoc.printWarning(pos, msg);
}
示例28
@Override
public void printNotice(SourcePosition pos, String msg) {
rootDoc.printNotice(pos, msg);
}
示例29
@Override
public SourcePosition position() {
return delegate.position();
}
示例30
@Override
public void printError(SourcePosition pos, String msg) {
delegate.printError(pos, msg);
}