/** * Return the ClassDocImpl for field type. * * @returns null if no ClassDocImpl for field type is visible from * containingClass context. */ public ClassDoc fieldTypeDoc() { if (fieldTypeDoc == null && containingClass != null) { fieldTypeDoc = containingClass.findClass(fieldType); } return fieldTypeDoc; }
public ClassDoc findClass(String arg0) { return wrapped.findClass(arg0); }
@Override public ClassDescription getDescription(String className) { ClassDescription result = classDescriptions.get(className); if (result == null) { // System.err.printf("*** Search for CD %s ...\n", className); ClassDoc cd = firstSeen.findClass(className); // System.err.printf("CD %s ... %s\n", className, cd == null ? "NOT found" : "found"); result = cd == null ? new ClassDescription() : new ClassDescription(cd, this); classDescriptions.put(className, result); } return result; }
@Override public ClassDescription getDescription(String className) { ClassDescription result = classDescriptions.get(className); if (result == null) { // System.err.printf("*** Search for CD %s ...\n", className); ClassDoc cd = firstSeen.findClass(className); // System.err.printf("CD %s ... %s\n", className, cd == null ? "NOT found" : "found"); result = cd == null ? new ClassDescription() : new ClassDescription(cd, this); classDescriptions.put(className, result); } return result; }
/** * Print all relations for a given's class's tag * @param tagname the tag containing the given relation * @param from the source class * @param edgetype the dot edge specification */ private void allRelation(Options opt, RelationType rt, ClassDoc from) { String tagname = rt.toString().toLowerCase(); for (Tag tag : from.tags(tagname)) { String t[] = StringUtil.tokenize(tag.text()); // l-src label l-dst target if (t.length != 4) { System.err.println("Error in " + from + "\n" + tagname + " expects four fields (l-src label l-dst target): " + tag.text()); return; } ClassDoc to = from.findClass(t[3]); if (to != null) { if(hidden(to)) continue; relation(opt, rt, from, to, t[0], t[1], t[2]); } else { if(hidden(t[3])) continue; relation(opt, rt, from, from.toString(), to, t[3], t[0], t[1], t[2]); } } }
ClassDoc resultClassDoc = classDoc.findClass(resultClz.getName()); ApiTypeDoc typeDoc = new ApiTypeDoc(); typeDoc.setName(resultClz.getSimpleName());
/** * Print all relations for a given's class's tag * @param tagname the tag containing the given relation * @param from the source class * @param edgetype the dot edge specification */ private void allRelation(Options opt, RelationType rt, ClassDoc from) { String tagname = rt.lower; for (Tag tag : from.tags(tagname)) { String t[] = tokenize(tag.text()); // l-src label l-dst target t = t.length == 1 ? new String[] { "-", "-", "-", t[0] } : t; // Shorthand if (t.length != 4) { System.err.println("Error in " + from + "\n" + tagname + " expects four fields (l-src label l-dst target): " + tag.text()); return; } ClassDoc to = from.findClass(t[3]); if (to != null) { if(hidden(to)) continue; relation(opt, rt, from, to, t[0], t[1], t[2]); } else { if(hidden(t[3])) continue; relation(opt, rt, from, from.toString(), to, t[3], t[0], t[1], t[2]); } } }
if (StringUtils.isNotBlank(className)) final ClassDoc referencedClassDoc = classDoc.findClass(className); appendConstantValue(buffer, reference, referencedClassDoc);
/** * {@inheritDoc} */ public void inherit(DocFinder.Input input, DocFinder.Output output) { ClassDoc exception; if (input.tagId == null) { ThrowsTag throwsTag = (ThrowsTag) input.tag; exception = throwsTag.exception(); input.tagId = exception == null ? throwsTag.exceptionName() : throwsTag.exception().qualifiedName(); } else { exception = input.method.containingClass().findClass(input.tagId); } ThrowsTag[] tags = input.method.throwsTags(); for (int i = 0; i < tags.length; i++) { if (input.tagId.equals(tags[i].exceptionName()) || (tags[i].exception() != null && (input.tagId.equals(tags[i].exception().qualifiedName())))) { output.holder = input.method; output.holderTag = tags[i]; output.inlineTags = input.isFirstSentence ? tags[i].firstSentenceTags() : tags[i].inlineTags(); output.tagList.add(tags[i]); } else if (exception != null && tags[i].exception() != null && tags[i].exception().subclassOf(exception)) { output.tagList.add(tags[i]); } } }
/** * {@inheritDoc} */ public void inherit(DocFinder.Input input, DocFinder.Output output) { ClassDoc exception; if (input.tagId == null) { ThrowsTag throwsTag = (ThrowsTag) input.tag; exception = throwsTag.exception(); input.tagId = exception == null ? throwsTag.exceptionName() : throwsTag.exception().qualifiedName(); } else { exception = input.element.containingClass().findClass(input.tagId); } ThrowsTag[] tags = ((MethodDoc)input.element).throwsTags(); for (int i = 0; i < tags.length; i++) { if (input.tagId.equals(tags[i].exceptionName()) || (tags[i].exception() != null && (input.tagId.equals(tags[i].exception().qualifiedName())))) { output.holder = input.element; output.holderTag = tags[i]; output.inlineTags = input.isFirstSentence ? tags[i].firstSentenceTags() : tags[i].inlineTags(); output.tagList.add(tags[i]); } else if (exception != null && tags[i].exception() != null && tags[i].exception().subclassOf(exception)) { output.tagList.add(tags[i]); } } }
ClassDoc from = c.findClass(tag.text()); w.println("\t//" + c + " extends " + tag.text() + "\n" + "\t" + relationNode(from, tag.text()) + " -> " + relationNode(c) + " [dir=back,arrowtail=empty];");
/** Print a class's relations */ public void printRelations(ClassDoc c) { Options opt = optionProvider.getOptionsFor(c); if (hidden(c) || c.name().equals("")) // avoid phantom classes, they may pop up when the source uses annotations return; // Print generalization (through the Java superclass) Type s = c.superclassType(); ClassDoc sc = s != null && !s.qualifiedTypeName().equals(Object.class.getName()) ? s.asClassDoc() : null; if (sc != null && !c.isEnum() && !hidden(sc)) relation(opt, RelationType.EXTENDS, c, sc, null, null, null); // Print generalizations (through @extends tags) for (Tag tag : c.tags("extends")) if (!hidden(tag.text())) relation(opt, RelationType.EXTENDS, c, c.findClass(tag.text()), null, null, null); // Print realizations (Java interfaces) for (Type iface : c.interfaceTypes()) { ClassDoc ic = iface.asClassDoc(); if (!hidden(ic)) relation(opt, RelationType.IMPLEMENTS, c, ic, null, null, null); } // Print other associations allRelation(opt, RelationType.COMPOSED, c); allRelation(opt, RelationType.NAVCOMPOSED, c); allRelation(opt, RelationType.HAS, c); allRelation(opt, RelationType.NAVHAS, c); allRelation(opt, RelationType.ASSOC, c); allRelation(opt, RelationType.NAVASSOC, c); allRelation(opt, RelationType.DEPEND, c); }
ClassDoc parameterClassDoc = classDoc.findClass(paramClz.getName()); for (ApiParamMeta apiParamMeta : ApiMetaResolver.getApiParamMetaByBeanValue(paramClz)) { ParamDoc paramDoc = new ParamDoc();