com.sun.javadoc.SourcePosition Java Examples

The following examples show how to use com.sun.javadoc.SourcePosition. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Utils.java    From sarl with Apache License 2.0 6 votes vote down vote up
/** 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);
	}
}
 
Example #2
Source File: MarkdownDoclet.java    From markdown-doclet with GNU General Public License v3.0 5 votes vote down vote up
/**
 * 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());
        }
    }
}
 
Example #3
Source File: MarkdownDoclet.java    From markdown-doclet with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void printError(SourcePosition pos, String msg) {
    error();
    rootDoc.printError(pos, msg);
}
 
Example #4
Source File: ProgrammaticWrappingProxyInstaller.java    From sarl with Apache License 2.0 4 votes vote down vote up
@Override
public SourcePosition position() {
	return this.delegate.position();
}
 
Example #5
Source File: ProgrammaticWrappingProxyInstaller.java    From sarl with Apache License 2.0 4 votes vote down vote up
@Override
public SourcePosition position() {
	return this.delegate.position();
}
 
Example #6
Source File: ProgrammaticWrappingProxyInstaller.java    From sarl with Apache License 2.0 4 votes vote down vote up
@Override
public SourcePosition position() {
	return this.delegate.position();
}
 
Example #7
Source File: ProgrammaticWrappingProxyInstaller.java    From sarl with Apache License 2.0 4 votes vote down vote up
@Override
public SourcePosition position() {
	return this.delegate.position();
}
 
Example #8
Source File: ProgrammaticWrappingProxyInstaller.java    From sarl with Apache License 2.0 4 votes vote down vote up
@Override
public SourcePosition position() {
	return this.delegate.position();
}
 
Example #9
Source File: ProgrammaticWrappingProxyInstaller.java    From sarl with Apache License 2.0 4 votes vote down vote up
@Override
public SourcePosition position() {
	return this.delegate.position();
}
 
Example #10
Source File: ProgrammaticWrappingProxyInstaller.java    From sarl with Apache License 2.0 4 votes vote down vote up
@Override
public void printWarning(SourcePosition arg0, String arg1) {
	this.delegate.printWarning(arg0, arg1);
}
 
Example #11
Source File: MarkdownDoclet.java    From markdown-doclet with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void printWarning(SourcePosition pos,
                         String msg)
{
    rootDoc.printWarning(pos, msg);
}
 
Example #12
Source File: MarkdownDoclet.java    From markdown-doclet with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void printNotice(SourcePosition pos, String msg) {
    rootDoc.printNotice(pos, msg);
}
 
Example #13
Source File: RootDocWrapper.java    From markdown-doclet with GNU General Public License v3.0 4 votes vote down vote up
@Override
public SourcePosition position() {
    return delegate.position();
}
 
Example #14
Source File: RootDocWrapper.java    From markdown-doclet with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void printError(SourcePosition pos, String msg) {
    delegate.printError(pos, msg);
}
 
Example #15
Source File: RootDocWrapper.java    From markdown-doclet with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void printWarning(SourcePosition pos, String msg) {
    delegate.printWarning(pos, msg);
}
 
Example #16
Source File: RootDocWrapper.java    From markdown-doclet with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void printNotice(SourcePosition pos, String msg) {
    delegate.printNotice(pos, msg);
}
 
Example #17
Source File: DocCommentProcessor.java    From markdown-doclet with GNU General Public License v3.0 4 votes vote down vote up
private void renderSeeTag(MarkdownDoclet doclet, StringBuilder tagBlock, PsiDocTag docTag) {
    final String seeText = toString(docTag, false);
    if ( seeText.startsWith("\"") ) {
        SeeTag tag = new SeeTag() {
            @Override
            public String label() {
                return null;
            }
            @Override
            public PackageDoc referencedPackage() {
                return null;
            }
            @Override
            public String referencedClassName() {
                return null;
            }
            @Override
            public ClassDoc referencedClass() {
                return null;
            }
            @Override
            public String referencedMemberName() {
                return null;
            }
            @Override
            public MemberDoc referencedMember() {
                return null;
            }
            @Override
            public String name() {
                return "@see";
            }
            @Override
            public Doc holder() {
                return null;
            }
            @Override
            public String kind() {
                return "@see";
            }
            @Override
            public String text() {
                return seeText;
            }
            @Override
            public Tag[] inlineTags() {
                return new Tag[0];
            }
            @Override
            public Tag[] firstSentenceTags() {
                return new Tag[0];
            }
            @Override
            public SourcePosition position() {
                return null;
            }
        };
        SeeTagRenderer.INSTANCE.render(tag, tagBlock, doclet);
    }
    else {
        tagBlock.append("\n@").append(docTag.getName());
        tagBlock.append(' ').append(seeText);
    }
}
 
Example #18
Source File: ProgrammaticWrappingProxyInstaller.java    From sarl with Apache License 2.0 4 votes vote down vote up
@Override
public SourcePosition position() {
	return this.delegate.position();
}
 
Example #19
Source File: SourcePositionImpl.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
public static SourcePosition make(FileObject file, int pos,
                                  Position.LineMap lineMap) {
    if (file == null) return null;
    return new SourcePositionImpl(file, pos, lineMap);
}
 
Example #20
Source File: ProgrammaticWrappingProxyInstaller.java    From sarl with Apache License 2.0 4 votes vote down vote up
@Override
public void printNotice(SourcePosition arg0, String arg1) {
	this.delegate.printNotice(arg0, arg1);
}
 
Example #21
Source File: ProgrammaticWrappingProxyInstaller.java    From sarl with Apache License 2.0 4 votes vote down vote up
@Override
public void printError(SourcePosition arg0, String arg1) {
	this.delegate.printError(arg0, arg1);
}
 
Example #22
Source File: ProgrammaticWrappingProxyInstaller.java    From sarl with Apache License 2.0 4 votes vote down vote up
@Override
public SourcePosition position() {
	return this.delegate.position();
}
 
Example #23
Source File: XMLExampleTaglet.java    From rapidminer-studio with GNU Affero General Public License v3.0 4 votes vote down vote up
private File resolve(String file, SourcePosition source) {
	return new File(source.file().getParentFile(), file);
}
 
Example #24
Source File: SourcePositionImpl.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
public static SourcePosition make(FileObject file, int pos,
                                  Position.LineMap lineMap) {
    if (file == null) return null;
    return new SourcePositionImpl(file, pos, lineMap);
}
 
Example #25
Source File: SourcePositionImpl.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
public static SourcePosition make(FileObject file, int pos,
                                  Position.LineMap lineMap) {
    if (file == null) return null;
    return new SourcePositionImpl(file, pos, lineMap);
}
 
Example #26
Source File: SourcePositionImpl.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
public static SourcePosition make(FileObject file, int pos,
                                  Position.LineMap lineMap) {
    if (file == null) return null;
    return new SourcePositionImpl(file, pos, lineMap);
}
 
Example #27
Source File: SourcePositionImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
public static SourcePosition make(FileObject file, int pos,
                                  Position.LineMap lineMap) {
    if (file == null) return null;
    return new SourcePositionImpl(file, pos, lineMap);
}
 
Example #28
Source File: SourcePositionImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
public static SourcePosition make(FileObject file, int pos,
                                  Position.LineMap lineMap) {
    if (file == null) return null;
    return new SourcePositionImpl(file, pos, lineMap);
}
 
Example #29
Source File: SourcePositionImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
public static SourcePosition make(FileObject file, int pos,
                                  Position.LineMap lineMap) {
    if (file == null) return null;
    return new SourcePositionImpl(file, pos, lineMap);
}
 
Example #30
Source File: SwaggerPropertiesDocletTest.java    From springfox-javadoc with Apache License 2.0 4 votes vote down vote up
@Override
public void printWarning(SourcePosition position, String warning) {
    warnings.append(warning).append("\n");
}