/** * Parses a constructor type definition * * @param docConstructor * @return */ protected static Constructor ParseConstructor(ConstructorDoc docConstructor) { assert (docConstructor != null); Constructor xmlConstructor = new Constructor(); xmlConstructor.name = docConstructor.name(); xmlConstructor.comment = docConstructor.commentText(); xmlConstructor.scope = DetermineScope(docConstructor); xmlConstructor.isVarArgs = docConstructor.isVarArgs(); xmlConstructor.isDefault = docConstructor.position().line() == docConstructor.containingClass().position().line(); Parameter[] parameters = docConstructor.parameters(); if (parameters != null && parameters.length > 0) { ParamTag[] paramComments = docConstructor.paramTags(); ArrayList<Param> methodList = new ArrayList<Param>(); for (Parameter parameter : parameters) { ParamTag paramComment = null; // look to see if this parameter has comments // if so, paramComment will be set for (ParamTag testParam : paramComments) { String testParamName = testParam.parameterName(); if (testParamName != null) { if (testParamName.compareTo(parameter.name()) == 0) { paramComment = testParam; break; } } } methodList.add(ParseParameter(parameter, paramComment)); } xmlConstructor.parameters = methodList.toArray(new Param[] {}); } else { log.debug("No parameters for method: " + docConstructor.name()); } // parse annotations for the constructor xmlConstructor.annotationInstances = ParseAnnotationInstances(docConstructor.annotations(), docConstructor.qualifiedName()); return xmlConstructor; }