use of com.redhat.ceylon.model.typechecker.model.Annotation in project ceylon-compiler by ceylon.
the class ClassOrPackageDoc method writeAliases.
protected final void writeAliases(Declaration decl) throws IOException {
Annotation see = Util.getAnnotation(decl.getUnit(), decl.getAnnotations(), "aliased");
if (see == null)
return;
open("div class='aliased section'");
around("span class='title'", "Aliases: ");
open("span class='value'");
boolean first = true;
for (String target : see.getPositionalArguments()) {
if (!first) {
write(", ");
} else {
first = false;
}
open("code class='signature'");
String cssClass = decl instanceof TypeDeclaration ? "type-identifier" : "identifier";
open("span class='" + cssClass + "'");
write(target);
close("span");
close("code");
}
close("span");
close("div");
}
use of com.redhat.ceylon.model.typechecker.model.Annotation in project ceylon-compiler by ceylon.
the class ClassOrPackageDoc method writeSee.
protected final void writeSee(Declaration decl) throws IOException {
Annotation see = Util.getAnnotation(decl.getUnit(), decl.getAnnotations(), "see");
if (see == null)
return;
open("div class='see section'");
around("span class='title'", "See also ");
open("span class='value'");
boolean first = true;
for (String target : see.getPositionalArguments()) {
if (!first) {
write(", ");
} else {
first = false;
}
//TODO: add 'identifier' or 'type-identitier' CSS class
linkRenderer().to(target).withinText(true).useScope(decl).printAbbreviated(false).printTypeParameters(false).write();
}
close("span");
close("div");
}
use of com.redhat.ceylon.model.typechecker.model.Annotation in project ceylon-compiler by ceylon.
the class ClassOrPackageDoc method writeParameterAssertions.
private void writeParameterAssertions(Declaration decl, Map<Tree.Assertion, List<Tree.Condition>> parameterAssertions) throws IOException {
if (parameterAssertions == null || parameterAssertions.isEmpty()) {
return;
}
PhasedUnit pu = tool.getUnit(decl);
open("div class='assertions' title='Parameter assertions'");
open("ul");
for (Tree.Assertion assertion : parameterAssertions.keySet()) {
List<Annotation> annotations = new ArrayList<Annotation>();
buildAnnotations(assertion.getAnnotationList(), annotations);
String doc = Util.getRawDoc(decl.getUnit(), annotations);
if (!Util.isEmpty(doc)) {
open("li");
write("<i class='icon-assertion'></i>");
write(Util.wikiToHTML(doc, linkRenderer()));
close("li");
} else {
for (Tree.Condition c : parameterAssertions.get(assertion)) {
String sourceCode = getSourceCode(pu, c);
open("li");
write("<i class='icon-assertion'></i>");
around("code", sourceCode);
close("li");
}
}
}
close("ul");
close("div");
}
Aggregations