16-Jun-15 javadoc. 2 Javadoc placement javadoc comments begin with /** and end with */ In a javadoc comment, a * at the beginning of the line is not part.

Slides:



Advertisements
Similar presentations
Programmer-defined classes Part 2. Topics Returning objects from methods The this keyword Overloading methods Class methods Packaging classes Javadoc.
Advertisements

Basic HTML Tags.
CompSci 427jd.1 Javadoc. CompSci 427jd.2 Javadoc The Plan  What is Javadoc?  Writing Javadoc comments  Using the Javadoc tool  Practice.
Utilities (Part 3) Implementing static features 1.
11-Jun-15 Using the Java API
Object-Oriented Enterprise Application Development Javadoc Last Updated: 06/30/2001.
Using the Java API
23-Jun-15 HTML. 2 Web pages are HTML HTML stands for HyperText Markup Language Web pages are plain text files, written in HTML Browsers display web pages.
26-Jun-15 Methods. About methods A method is a named group of declarations and statements If a method is in the same class, you execute those declarations.
1 Doc Comment Conventions. 2 Write for your audience Rule 32: Write documentation for– those who must use your code Users should not need to care how.
29-Jun-15 Using the Java API
JavaDoc COMP 302. JavaDoc javadoc: The program to generate java code documentation. Input: Java source files (.java)  Individual source files  Root.
Concordia University Department of Computer Science and Software Engineering Click to edit Master title style ADVANCED PROGRAMING PRACTICES API documentation.
1 Documenting with Javadoc CS 3331 Fall 2009 How to Write Doc Comments for the Javadoc TM Tool available from java.sun.com.
ULI101: XHTML Basics (Part III) Introduction to XHTML / Continued … Block-Level vs. Inline Elements (tags) Manipulating Text,  , Text Characteristics,,,,,,,,,,,,,,,
3.1 Documentation & Java Language Elements Purpose of documentation Assist the programmer with developing the program Assist other programers who.
HTML HTML stands for "Hyper Text Mark-up Language“. Technically, HTML is not a programming language, but rather a markup language. Used to create web pages.
Javadoc. The Plan ● What is Javadoc? ● Writing Javadoc comments ● Using the Javadoc tool ● Demo ● Practice.
JavaDoc1 JavaDoc DEPARTMENT OF COMPUTER SCIENCE AND SOFTWARE ENGINEERING CONCORDIA UNIVERSITY July 24, 2006 by Emil Vassev & Joey Paquet revision 1.2 –
Writing JavaDocs Mimi Opkins CECS 274 Copyright (c) Pearson All rights reserved.
Program documentation using the Javadoc tool 1 Program documentation Using the Javadoc tool.
Chapter 13. Applets and HTML HTML Applets Computer Programming with JAVA.
1 Documenting with Javadoc. 2 Motivation  Why document programs? To make it easy to understand, e.g., for reuse and maintenance  What to document? Interface:
Classes CS 21a: Introduction to Computing I First Semester,
Question of the Day  On a game show you’re given the choice of three doors: Behind one door is a car; behind the others, goats. After you pick a door,
Utilities (Part 2) Implementing static features 1.
Documentation and Programming Style Appendix A © 2015 Pearson Education, Inc., Hoboken, NJ. All rights reserved.
Javadoc Comments.  Java API has a documentation tool called javadoc  The javadoc tool is used on the source code embedded with javadoc-style comments.
Software Documentation Section 5.5 ALBING’s Section JIA’s Appendix B JIA’s.
Documentation javadoc. Documentation not a programmer's first love lives in a separate file somewhere usually a deliverable on the schedule often not.
Javadoc A very short tutorial. What is it A program that automatically generates documentation of your Java classes in a standard format For each X.java.
CSC 212 – Data Structures Prof. Matthew Hertz WTC 207D /
Javadoc Dwight Deugo Nesa Matic
JavaDoc and Contracts Spring Documenting Contracts with JavaDoc Contract model for methods Preconditions Postconditions JavaDoc Industry standard.
Javadoc. Purpose of javadoc javadoc is a program that reads your Java program and produces great-looking documentation in HTML format Without any help,
Javadoc. Purpose of javadoc  javadoc is a program that reads your Java program and produces great-looking documentation in HTML format  Without any.
A brief introduction to javadoc and doxygen. What’s in a program file? 1. Comments 2. Code.
Javadoc Summary. Javadoc comments Delemented by /** and */ Used to document – Classes – Methods – Fields Must be placed immediately above the feature.
Page 1 – Autumn 2009Steffen Vissing Andersen SDJ I1, Autumn 2009 Agenda: Java API Documentation Code Documenting (in javadoc format) Debugging.
Java Doc Guideline R.SANTHANA GOPALAN. Java Doc Guideline Audience Internal Developers PQA - who write test plans PPT – who write the documentation Customers.
1 Documenting with Javadoc CS 3331 Section and Appendix B of [Jia03] How to Write Doc Comments for the Javadoc TM Tool available from
Documentation Javadocs. Design/Documentation An essential ingredient of good Object Oriented programming is known as design by contract. This means that.
CompSci 427jd.1 Javadoc. CompSci 427jd.2 Javadoc The Plan  What is Javadoc?  Writing Javadoc comments  Using the Javadoc tool  Practice.
28-Feb-16 How to Write Good Comments. 2 Write for your audience Program documentation is for programmers, not end users There are two groups of programmers,
Winter 2006CISC121 - Prof. McLeod1 Stuff We had better discuss a midterm date… –27 Feb. to 3 March or –6 to 10 March.
1 Documenting with Javadoc How to Write Doc Comments for the Javadoc TM Tool available from java.sun.com.
Today Javadoc. Packages and static import. Viewing API source code. Upcoming Topics: –protected access modifier –Using the debugger in Eclipse –JUnit testing.
3-July-2002cse142-D2-Methods © 2002 University of Washington1 Methods CSE 142, Summer 2002 Computer Programming 1
Variable Scope & Lifetime
More on Arrays Review of Arrays of ints, doubles, chars
Advanced Programing practices
More Sophisticated Behavior
Working with Java.
JavaDoc CECS277 Mimi Opkins.
How to Write Good Comments
CMPE212 – Stuff… Assn 2 due next Friday. Winter 2018
Introduction to javadoc
Fall 2018 CISC124 12/1/2018 CISC124 Note that the next assignment, on encapsulation, is due next Wednesday at 7pm – not Friday. The next Quiz is not until.
Comp 110/401 Documentation: Comments
JavaDoc and Contracts Fall 2008.
Advanced Programing practices
How to Write Good Comments
How to Write Good Comments
Introduction to javadoc
How to Write Good Comments
Classes CS 21a: Introduction to Computing I
How to Write Good Comments
CMPE212 – Reminders Assignment 2 due in a week.
Introduction to Computer Science and Object-Oriented Programming
Presentation transcript:

16-Jun-15 javadoc

2 Javadoc placement javadoc comments begin with /** and end with */ In a javadoc comment, a * at the beginning of the line is not part of the comment text javadoc comments must be immediately before: a class (plain, inner, abstract, or enum) an interface a constructor a method a field (instance or static) Anywhere else, javadoc comments will be ignored! Plus, they look silly

3 javadoc format Use this format for all doc comments: /** * This is where the text starts. The asterisk lines * up with the first asterisk above; there is a space * after each asterisk. The first sentence is the most * important: it becomes the “summary.” * x Describe the first parameter (don’t say its type). y Describe the first parameter (don’t say its type). Tell what value is being returned (don’t say its type). */ public String myMethod(int x, int y) { // p lines up with the / in /**

4 HTML in doc comments javadoc comments (but not other kinds of comments) are written in HTML In a doc comment, you must replace: with > & with &...because these characters are special in HTML Other things you may use:... to make something italic Example: This case should never occur!... to make something boldface to start a new paragraph … to wrap the names of variables, methods, etc. … to use a monospaced font and preserve whitespace to put in a nonbreaking space

5 More HTML You can create a bulleted list with: first list element second list element You can create a numbered list with: first list element second list element You can insert a hyperlink with: visible text There’s more--most non-document oriented HTML can be used

6 Who the javadoc is for Javadoc comments should be written for programmers who want to use your code Example: The way you use Sun’s Java API Javadoc comments should not be written for: Programmers who need to debug, maintain, or upgrade the code Internal ( // or /*…*/ ) comments should be used for this purpose People who just want to use the program Therefore: Javadoc comments should describe exactly how to use the class, method, constructor, etc. Javadoc comments should not describe the internal workings of the class or method (unless it affects the user in some way) In addition, javadoc method comments should not tell who uses the method (inappropriate, but also difficult to keep up to date)

7 Tags in doc comments Use the standard ordering for javadoc tags In class and interface descriptions, your a version number or date Use tag in your assignments for all top-level classes!!! These tags are only used for classes and interfaces In method descriptions, p A description of parameter A description of the value returned (not used if the method returns e Describe any thrown exception. Do not mention the type tags-- javadoc will do this (and get it right)

8 Rules for writing summaries The first sentence should summarize the purpose of the element For methods, omit the subject and write in the third-person narrative form Good: Finds the first blank in the string. Not as good: Find the first blank in the string. Bad: This method finds the first blank in the string. Worse: Method findBlank(String s) finds the first blank in the string. Use the word this rather than “the” when referring to instances of the current class (for example, Multiplies this fraction… ) Do not add parentheses to a method or constructor name unless you want to specify a particular signature Keep comments up to date!

9 Bugs and missing features Document known problems! There are three “standard” flags that you can put into any comment TODO -- describes a feature that should be added FIXME -- describes a bug in the method XXX -- this needs to be thought about some more Eclipse and NetBeans both recognize these flags and can open a window that lists all occurrences of them You can create additional tags of your own in your IDE

10 The End