/** * {@inheritDoc} */ public Content getSignature(ConstructorDoc constructor) { Content pre = new HtmlTree(HtmlTag.PRE); writer.addAnnotationInfo(constructor, pre); addModifiers(constructor, pre); if (configuration.linksource) { Content constructorName = new StringContent(constructor.name()); writer.addSrcLink(constructor, constructorName, pre); } else { addName(constructor.name(), pre); } int indent = pre.charCount(); addParameters(constructor, pre, indent); addExceptions(constructor, pre, indent); return pre; }
/** * Write the signature for the given constructor. * * @param constructor the constructor being documented. */ public void writeSignature(ConstructorDoc constructor) { writer.displayLength = 0; writer.pre(); writer.writeAnnotationInfo(constructor); printModifiers(constructor); //printReturnType((ConstructorDoc)constructor); if (configuration().linksource) { writer.printSrcLink(constructor, constructor.name()); } else { strong(constructor.name()); } writeParameters(constructor); writeExceptions(constructor); writer.preEnd(); assert !writer.getMemberDetailsListPrinted(); }
/** Print the class's constructors m */ private boolean operations(Options opt, ConstructorDoc m[]) { boolean printed = false; for (ConstructorDoc cd : m) { if (hidden(cd)) continue; stereotype(opt, cd, Align.LEFT); String cs = visibility(opt, cd) + cd.name() // + (opt.showType ? "(" + parameter(opt, cd.parameters()) + ")" : "()"); tableLine(Align.LEFT, cs); tagvalue(opt, cd); printed = true; } return printed; }
/** Print the class's constructors m */ private boolean operations(Options opt, ConstructorDoc m[]) { boolean printed = false; for (ConstructorDoc cd : m) { if (hidden(cd)) continue; stereotype(opt, cd, Align.LEFT); String cs = visibility(opt, cd) + cd.name(); if (opt.showType) { cs += "(" + parameter(opt, cd.parameters()) + ")"; } else { cs += "()"; } tableLine(Align.LEFT, cs); printed = true; tagvalue(opt, cd); } return printed; }
/** * Write the constructor header for the given constructor. * * @param constructor the constructor being documented. * @param isFirst the flag to indicate whether or not the constructor is the * first to be documented. */ public void writeConstructorHeader(ConstructorDoc constructor, boolean isFirst) { if (! isFirst) { writer.printMemberHeader(); } writer.println(); String erasureAnchor; if ((erasureAnchor = getErasureAnchor(constructor)) != null) { writer.anchor(erasureAnchor); } writer.anchor(constructor); writer.h3(); writer.print(constructor.name()); writer.h3End(); }
/** * {@inheritDoc} */ public Content getConstructorDocTreeHeader(ConstructorDoc constructor, Content constructorDetailsTree) { String erasureAnchor; if ((erasureAnchor = getErasureAnchor(constructor)) != null) { constructorDetailsTree.addContent(writer.getMarkerAnchor((erasureAnchor))); } constructorDetailsTree.addContent( writer.getMarkerAnchor(writer.getAnchor(constructor))); Content constructorDocTree = writer.getMemberTreeHeader(); Content heading = new HtmlTree(HtmlConstants.MEMBER_HEADING); heading.addContent(constructor.name()); constructorDocTree.addContent(heading); return constructorDocTree; }
protected Constructor parseConstructor(ConstructorDoc constructorDoc) { Constructor constructorNode = objectFactory.createConstructor(); constructorNode.setName(constructorDoc.name()); constructorNode.setQualified(constructorDoc.qualifiedName()); String comment = constructorDoc.commentText(); if (comment.length() > 0) { constructorNode.setComment(comment); } constructorNode.setScope(parseScope(constructorDoc)); constructorNode.setIncluded(constructorDoc.isIncluded()); constructorNode.setFinal(constructorDoc.isFinal()); constructorNode.setNative(constructorDoc.isNative()); constructorNode.setStatic(constructorDoc.isStatic()); constructorNode.setSynchronized(constructorDoc.isSynchronized()); constructorNode.setVarArgs(constructorDoc.isVarArgs()); constructorNode.setSignature(constructorDoc.signature()); for (Parameter parameter : constructorDoc.parameters()) { constructorNode.getParameter().add(parseMethodParameter(parameter)); } for (Type exceptionType : constructorDoc.thrownExceptionTypes()) { constructorNode.getException().add(parseTypeInfo(exceptionType)); } for (AnnotationDesc annotationDesc : constructorDoc.annotations()) { constructorNode.getAnnotation().add(parseAnnotationDesc(annotationDesc, constructorDoc.qualifiedName())); } for (Tag tag : constructorDoc.tags()) { constructorNode.getTag().add(parseTag(tag)); } return constructorNode; }
result = factory.constructOperation( doc.name() ); result.setSpecification( false ); // assume the method exists, so it is not a specification result.setQuery( false ); // the constructors are not read-only