def compile_method(self, method): signature = util.StringBuilder() for annotation in method.annotations: formatter.output_annotation(annotation, signature) formatter.output_modifiers(method.modifiers, signature) signature.append(' ') if method.type_parameters: formatter.output_type_params(method.type_parameters, signature) signature.append(' ') formatter.output_type(method.return_type, signature) signature.append(' ') signature.append(method.name) signature.append('(') formatter.output_list(formatter.output_formal_param, method.parameters, signature, ', ') signature.append(')') if method.throws: signature.append(' throws ') formatter.output_list(formatter.output_exception, method.throws, signature, ', ') doc = self.__output_doc(method) directive = util.Directive('java:method', signature.build()) directive.add_content(doc) return directive
def compile_constructor(self, constructor): signature = util.StringBuilder() for annotation in constructor.annotations: formatter.output_annotation(annotation, signature) formatter.output_modifiers(constructor.modifiers, signature) signature.append(' ') if constructor.type_parameters: formatter.output_type_params(constructor.type_parameters, signature) signature.append(' ') signature.append(constructor.name) signature.append('(') formatter.output_list(formatter.output_formal_param, constructor.parameters, signature, ', ') signature.append(')') if constructor.throws: signature.append(' throws ') formatter.output_list(formatter.output_exception, constructor.throws, signature, ', ') doc = self.__output_doc(constructor) directive = util.Directive('java:constructor', signature.build()) directive.add_content(doc) return directive