public String toString(Tag tag) { return "<u>" + tag.text() + "[" + tag + ", [" + tag.holder() + "]]</u>"; }
/** * Given the <code>Tag</code> representation of this custom * tag, return its string representation, which is output * to the generated page. * @param tag the <code>Tag</code> representation of this custom tag. * @param tagletWriter the taglet writer for output. * @return the TagletOutput representation of this <code>Tag</code>. */ public TagletOutput getTagletOutput(Tag tag, TagletWriter tagletWriter) { if (! (tag.holder() instanceof MethodDoc)) { return tagletWriter.getOutputInstance(); } return tag.name().equals("@inheritDoc") ? retrieveInheritedDocumentation(tagletWriter, (MethodDoc) tag.holder(), null, tagletWriter.isFirstSentence) : retrieveInheritedDocumentation(tagletWriter, (MethodDoc) tag.holder(), tag, tagletWriter.isFirstSentence); } }
/** * Given the <code>Tag</code> representation of this custom * tag, return its string representation, which is output * to the generated page. * @param tag the <code>Tag</code> representation of this custom tag. * @param tagletWriter the taglet writer for output. * @return the Content representation of this <code>Tag</code>. */ public Content getTagletOutput(Tag tag, TagletWriter tagletWriter) { if (! (tag.holder() instanceof ProgramElementDoc)) { return tagletWriter.getOutputInstance(); } return tag.name().equals("@inheritDoc") ? retrieveInheritedDocumentation(tagletWriter, (ProgramElementDoc) tag.holder(), null, tagletWriter.isFirstSentence) : retrieveInheritedDocumentation(tagletWriter, (ProgramElementDoc) tag.holder(), tag, tagletWriter.isFirstSentence); } }
private IAlgorithm getAlgorithmAssociatedToTag (Tag tag) { File javaFileObject = tag.holder ().position ().file(); String theClassName = ""; while (!javaFileObject.getName ().equals("net2plan")) { theClassName = javaFileObject.getName () + "." + theClassName; if (javaFileObject.getParentFile() == null) break; else javaFileObject = javaFileObject.getParentFile(); } theClassName = "com.net2plan." + theClassName; theClassName = theClassName.substring(0 , theClassName.length ()-6); //without .java IAlgorithm alg = null; try { Class algorithmClass = Taglet_Description.class.getClassLoader().loadClass(theClassName); if (!IAlgorithm.class.isAssignableFrom(algorithmClass)) return null; // not an algorithm alg = (IAlgorithm) algorithmClass.getConstructor().newInstance(); } catch (Exception e) { e.printStackTrace(); throw new RuntimeException ("Unexpected exception trying to load class of '" + theClassName + "'"); } return alg; }
private Object getAlgorithmAssociatedToTag (Tag tag) { File javaFileObject = tag.holder ().position ().file(); String theClassName = ""; while (!javaFileObject.getName ().equals("net2plan")) { theClassName = javaFileObject.getName () + "." + theClassName; if (javaFileObject.getParentFile() == null) break; else javaFileObject = javaFileObject.getParentFile(); } theClassName = "com.net2plan." + theClassName; theClassName = theClassName.substring(0 , theClassName.length ()-6); //without .java Object alg = null; try { Class algorithmClass = Taglet_Description.class.getClassLoader().loadClass(theClassName); if (IAlgorithm.class.isAssignableFrom(algorithmClass)) return (IAlgorithm) algorithmClass.getConstructor().newInstance(); if (IReport.class.isAssignableFrom(algorithmClass)) return (IReport)algorithmClass.getConstructor().newInstance(); if (IEventGenerator.class.isAssignableFrom(algorithmClass)) return (IEventGenerator)algorithmClass.getConstructor().newInstance(); if (IEventProcessor.class.isAssignableFrom(algorithmClass)) return (IEventProcessor)algorithmClass.getConstructor().newInstance(); return null; } catch (Exception e) { e.printStackTrace(); throw new RuntimeException ("Unexpected exception trying to load class of '" + theClassName + "'"); } }
@Override public String toString(Tag[] tags) { if (tags.length == 0) { return null; } ClassDoc classDoc = (ClassDoc) tags[0].holder(); return processExternalResources(classDoc) + processConfigurationParameters(classDoc); }
/** * Render the tag. * * @todo TODOs can also be used in member docs ... * * @param tag The tag to render. * @param target The target {@link StringBuilder}. * @todo ... or even parameter docs -- which is a little strange, actually. ;) * @param doclet The doclet. */ @Override public void render(Tag tag, StringBuilder target, PegdownDoclet doclet) { Counter counter; if ( tag.holder() instanceof MemberDoc ) { counter = getCounter(((MemberDoc)tag.holder()).containingClass()); } else { counter = getCounter(tag.holder()); } target.append("<div class=\"todo\">"); target.append("<div class=\"todoTitle\"><span class=\"todoTitle\">") .append(doclet.getOptions().getTodoTitle()) .append("</span><span class=\"todoCounter\">#") .append(counter.next()) .append("</span></div>"); target.append("<div class=\"todoText\">"); target.append(doclet.toHtml(tag.text().trim())); target.append("</div></div>"); }
@Override public String toString(Tag[] tags) { if (tags.length == 0) return null; // This should only be invoked with 0 or 1 tags. I suppose someone could put @tapestrydoc in the comment block // more than once. Tag tag = tags[0]; try { StringWriter writer = new StringWriter(5000); ClassDoc classDoc = (ClassDoc) tag.holder(); if (firstSeen == null) firstSeen = classDoc; ClassDescription cd = getDescription(classDoc.qualifiedName()); writeClassDescription(cd, writer); streamXdoc(classDoc, writer); return writer.toString(); } catch (Exception ex) { System.err.println(ex); System.exit(-1); return null; // unreachable } }
@Override public String toString(Tag[] tags) { if (tags.length == 0) return null; // This should only be invoked with 0 or 1 tags. I suppose someone could put @tapestrydoc in the comment block // more than once. Tag tag = tags[0]; try { StringWriter writer = new StringWriter(5000); ClassDoc classDoc = (ClassDoc) tag.holder(); if (firstSeen == null) firstSeen = classDoc; ClassDescription cd = getDescription(classDoc.qualifiedName()); writeClassDescription(cd, writer); streamXdoc(classDoc, writer); return writer.toString(); } catch (Exception ex) { System.err.println(ex); System.exit(-1); return null; // unreachable } }
String text = redirectRelativeLinks( tagelem.holder(), tagelem.text() );
if ( tag.holder() instanceof ProgramElementDoc ) { packageName = ((ProgramElementDoc)tag.holder()).containingPackage().name(); else if ( tag.holder() instanceof PackageDoc ) { packageName = ((PackageDoc)(tag.holder())).name(); else if ( tag.holder() instanceof RootDoc ) { packageName = null; doclet.printError(tag.position(), "Cannot handle tag for holder " + tag.holder()); return;
/** * {@inheritDoc} */ public Content getTagletOutput(Tag tag, TagletWriter writer) { FieldDoc field = getFieldDoc( writer.configuration(), tag, tag.text()); if (field == null) { if (tag.text().isEmpty()) { //Invalid use of @value writer.getMsgRetriever().warning(tag.holder().position(), "doclet.value_tag_invalid_use"); } else { //Reference is unknown. writer.getMsgRetriever().warning(tag.holder().position(), "doclet.value_tag_invalid_reference", tag.text()); } } else if (field.constantValue() != null) { return writer.valueTagOutput(field, field.constantValueExpression(), ! field.equals(tag.holder())); } else { //Referenced field is not a constant. writer.getMsgRetriever().warning(tag.holder().position(), "doclet.value_tag_invalid_constant", field.name()); } return writer.getOutputInstance(); } }
/** * {@inheritDoc} */ public TagletOutput getTagletOutput(Tag tag, TagletWriter writer) { FieldDoc field = getFieldDoc( writer.configuration(), tag, tag.text()); if (field == null) { //Reference is unknown. writer.getMsgRetriever().warning(tag.holder().position(), "doclet.value_tag_invalid_reference", tag.text()); } else if (field.constantValue() != null) { return writer.valueTagOutput(field, Util.escapeHtmlChars(field.constantValueExpression()), ! field.equals(tag.holder())); } else { //Referenced field is not a constant. writer.getMsgRetriever().warning(tag.holder().position(), "doclet.value_tag_invalid_constant", field.name()); } return writer.getOutputInstance(); } }
input.isTypeVariableParamTag = ((ParamTag) input.tag).isTypeParameter(); Object[] parameters = input.isTypeVariableParamTag ? (Object[]) ((MethodDoc) input.tag.holder()).typeParameters() : (Object[]) ((MethodDoc) input.tag.holder()).parameters(); String target = ((ParamTag) input.tag).parameterName(); int i;
input.isTypeVariableParamTag = ((ParamTag) input.tag).isTypeParameter(); Object[] parameters = input.isTypeVariableParamTag ? (Object[]) ((MethodDoc) input.tag.holder()).typeParameters() : (Object[]) ((MethodDoc) input.tag.holder()).parameters(); String target = ((ParamTag) input.tag).parameterName(); int i;
text = redirectRelativeLinks(tagelem.holder(), text);