Java Doc Guideline R.SANTHANA GOPALAN. Java Doc Guideline Audience Internal Developers PQA - who write test plans PPT – who write the documentation Customers.

Slides:



Advertisements
Similar presentations
Getting Started with your Course Staff Guide. Turn Editing On Click either the link or the button as below:
Advertisements

HTML: HyperText Markup Language Hello World Welcome to the world!
Chapter 2 HTML Basics Key Concepts
Lesson 16 Enhancing Documents
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.
Object-Oriented Enterprise Application Development Javadoc Last Updated: 06/30/2001.
Using the Java API
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
Doxygen and Javadoc By Derzsy Noemi.
HTML: PART ONE. Creating an HTML Document  It is a good idea to plan out a web page before you start coding  Draw a planning sketch or create a sample.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Java Software Solutions Foundations of Program Design Sixth Edition by Lewis.
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.
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.
HTML history, Tags, Element. HTML: HyperText Markup Language Hello World Welcome to the world!
1.  Describe the anatomy of a web page  Format the body of a web page with block-level elements including headings, paragraphs, lists, and blockquotes.
Chapter 2 HTML Basics Key Concepts Copyright © 2013 Terry Ann Morris, Ed.D 1.
XP Mohammad Moizuddin Creating Web Pages with HTML Tutorial 1 1 New Perspectives on Creating Web Pages With HTML Tutorial 1: Developing a Basic Web Page.
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.
Unit 2, cont. September 12 More HTML. Attributes Some tags are modifiable with attributes This changes the way a tag behaves Modifying a tag requires.
Program documentation using the Javadoc tool 1 Program documentation Using the Javadoc tool.
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:
Java Syntax and Style JavaMethods An Introduction to Object-Oriented Programming Maria Litvin Gary Litvin Copyright © 2003 by Maria Litvin, Gary Litvin,
HTML: Hyptertext Markup Language Doman’s Sections.
Javadoc: Advanced Features & Limitations Presented By: Wes Toland.
FIRST JAVA PROGRAM. JAVA PROGRAMS Every program may consist of 1 or more classes. Syntax of a class: Each class can contain 1 or more methods. public.
Ali Alshowaish. What is HTML? HTML stands for Hyper Text Markup Language Specifically created to make World Wide Web pages Web authoring software language.
Everything Is an Object Manipulate objects with references The identifier you manipulate is actually a “reference” to an object. Like a television.
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.
Documentation Dr. Andrew Wallace PhD BEng(hons) EurIng
Javadoc Dwight Deugo Nesa Matic
JavaDoc and Contracts Spring Documenting Contracts with JavaDoc Contract model for methods Preconditions Postconditions JavaDoc Industry standard.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 2 Key Concepts 1 Copyright © Terry Felke-Morris.
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.
1 Documenting with Javadoc CS 3331 Section and Appendix B of [Jia03] How to Write Doc Comments for the Javadoc TM Tool available from
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 2- part 2 Key Concepts 1 Copyright © Terry Felke-Morris.
Agenda Comments Identifiers Keywords Syntax and Symentics Indentation Variables Datatype Operator.
Department of Computer Science, Florida State University CGS 3066: Web Programming and Design Spring
SourceAnatomy1 Java Source Anatomy Barb Ericson Georgia Institute of Technology July 2008.
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,
Department of Computer Science, Florida State University CGS 3066: Web Programming and Design Spring
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.
1 Problem Solving  The purpose of writing a program is to solve a problem  The general steps in problem solving are: Understand the problem Dissect the.
Lesson 5. XHTML Tags, Attributes and Structure XHTML Basic Structure head and body titles Paragraph headings comments Document Presentation Manipulating.
Advanced Programing practices
Lesson 16 Enhancing Documents
Lesson 16 Enhancing Documents
How to Write Good Comments
Introduction to javadoc
Statements, Comments & Simple Arithmetic
Chapter 1: Computer Systems
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
Presentation transcript:

Java Doc Guideline R.SANTHANA GOPALAN

Java Doc Guideline Audience Internal Developers PQA - who write test plans PPT – who write the documentation Customers – who are writing/customizing the application.

Java Doc source The Javadoc tool can generate output originating from four different types of "source" files : Java Source code Package comment files - these contain package comments Overview comment files - these contain comments about the set of packages Miscellaneous unprocessed files - these include images, sample source code, class files, applets, HTML files, and whatever else you might want to reference from the previous files.

JavaDoc Comment JavaDoc Comment Consists of two parts 1. Description 2. Tags A doc comment may have zero or more tags. JavaDoc comment starts with “/**” and ends with “*/”.

JavaDoc - sample Sample: /** * This is the description part of a doc comment * Comment for the tag */

JavaDoc - Coding Standard The first line starts with the begin- comment symbol (/**) followed by a return. This line is indented to line up with the code Subsequent lines start with an asterisk *. They are indented an additional space so the asterisks line up. A space separates the asterisk from the descriptive text or tag that follows it.

JavaDoc - Coding Standard Insert a blank comment line between the description and the list of tags, as shown. Insert additional blank lines to create "blocks" of related tags (discussed in greater detail below).

JavaDoc – Description text Description may have multiple sentences but first sentence is very important. The first sentence of each doc comment should be a summary sentence. The first sentence should be concise but complete description of the API item Write summary sentences that distinguish overloaded methods from each other.

JavaDoc – Description Example /** * Class constructor specifying number of objects to create. */ foo(int n) { … }

JavaDoc – Description How Javadoc tool identified the first sentence? JavaDoc first sentence ends at the first period that is followed by a blank, tab, or line terminator, or at the first tag. Question: How to solve if the first sentence required “.”. In otherwords how do include “Dr. Watson” in first sentence

JavaDoc – Description Answer: Typing an HTML meta-character such as "&" or "<" immediately after the period. Example: /** * This is a simulation of Dr.&nbsp Watson Unix computer. */

JavaDoc - Tag Use style for keywords and names. Keywords and names are offset by... when mentioned in a description. This includes: Java keywords Code examples...

JavaDoc - Tag package names class names method names interface names field names argument names

JavaDoc - Tag Example: An applet is marked active just before its start method is called. Returns an Image object that can then be painted on the screen The name argument is case insensitive.

JavaDoc - Tag NullPointerException if the entry name is man the optional true if the applet is active; false otherwise.

JavaDoc Tag param_name description Applicable to methods and constructors. tags should be listed in argument-declaration order.

JavaDoc Tag description Applicable to tag is required for every method that returns something other than void. Whenever possible, supply return values for special cases (such as specifying the value returned when an out-of-bounds argument is supplied).

JavaDoc Tag true if the String are equal; false a hash code value for this object.

JavaDoc Tag description Indicates that this API should no longer be used (even though it may continue to work). By convention, the text describes the API (or APIs) which replace the deprecated API. Replaced by setBounds(int, int, int, As of JDK 1.1, replaced by #setBounds(int,int,int,int)} If the API is obsolete and there is no replacement, the argument should be "No replacement".

JavaDoc Tag APIName Label Adds a hyperlinked "See Also" entry to the class documentation. APIName can be the name of a Java API or an HTML anchor java.lang.String // java.lang.String The String class // The String Java Spec // Java Spec A doc comment may contain tags.

JavaDoc Tag The character # separates the name of a class from the name of one of its fields, methods, or constructors. One of several overloaded methods or constructors may be selected by including a parenthesized list of argument types after the method or constructor name. Whitespace classname is significant. If there is more than one argument, there must be a single blank character between the arguments. java.io.File#File(java.io.File, java.lang.String)

JavaDoc Tag Syntax 1: APIName Label} Syntax 2: reference} Adds an inline link to other tag begins and ends with curly braces to separate it from the rest of the inline text.

JavaDoc Tag A doc comment may contain multiple tags. Example: … contains a link Class#getClassLoader() loader} to … … by Class#getClassLoader()} is...

JavaDoc Tag class-name description Adds a "Throws" subheading to the generated documentation, with the class-name and description text. The class-name is the name of the exception that may be thrown by the method.

JavaDoc Tag Both and are is introduced in JDK1.0 is introduced in JDK1.2 Tag.

Javadocs - HTML Tag Simple tags << >> Space \\ && "“ New line

Javadocs - HTML Tag - paragraph If you have more than one paragraph in the doc comment, separate the paragraphs with a paragraph tag. … - Bold … - Italic … - Underline

Javadocs - HTML Tag SuperScript - tag Example: 2 32 Subscript - tag Example: log 2

Javadocs - HTML Tag … - Fixed Width Font Used in class name, method name, interface name, field name. Similar to “ … ”. … - Indent

Javadocs - HTML Tag - used to write the code snipets. Also use for intend. Example: * * void printClassName(Object obj) * { * String name= obj.getClass().getName()); *.... * } *

Javadocs - HTML Tags Bullet Item Bullet 1 Bullet 2 Bullet 3

Javadocs - HTML Tags Number Item Item 1 Item 2 Item 3

Javadocs - HTML Tag Table 1x1 1x2 2x1 2x2

JavaDocs - Questions What is the difference ? What is the difference ?

JavaDocs - Q&A How to include “Overrides:” in JavaDoc? Javadoc tool identified the Override methods and include into JavaDoc. We don’t need to worry about this. Example: java.lang.String.equals() overrides equals() in class java.lang.Object.

JavaDocs - Q&A Is there any way to exclude the particular “public” method? Now there is no solution. Sun has proposed to introduce tag to solve this problem. Another way is simply ignore particular class.

JavaDocs - Q&A Is there any easy way to find the missing JavaDocs? Using the Doclet we can easily find. We are using “doclint” doclet to find the missing JavaDocs.

JavaDocs - Reference Reference Links Writing Java API Specification Write Doc Comments for the Javadoc tool