A brief introduction to javadoc and doxygen. What’s in a program file? 1. Comments 2. Code.

Slides:



Advertisements
Similar presentations
Introduction to Java 2 Programming Lecture 4 Writing Java Applications, Java Development Tools.
Advertisements

Classes  All code in a Java program is part of a class  A class has two purposes  Provide functions to do work for the programmer  Represent data.
The Web Warrior Guide to Web Design Technologies
CompSci 427jd.1 Javadoc. CompSci 427jd.2 Javadoc The Plan  What is Javadoc?  Writing Javadoc comments  Using the Javadoc tool  Practice.
Introduction to C Programming
1 Chapter 2 Introduction to Java Applications Introduction Java application programming Display ____________________ Obtain information from the.
CIS101 Introduction to Computing Week 12. Agenda Your questions Solutions to practice text Final HTML/JavaScript Project Copy and paste assignment JavaScript:
CMPUT 101 Lab # 5 October 22, :00 – 17:00.
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.
Introduction to C Programming Overview of C Hello World program Unix environment C programming basics.
Information Hiding and Encapsulation
Guide To UNIX Using Linux Third Edition
Understanding class definitions Looking inside classes.
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 4 th Ed Chapter Chapter 7 Defining Your Own Classes Part 2.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Java Software Solutions Foundations of Program Design Sixth Edition by Lewis.
Concordia University Department of Computer Science and Software Engineering Click to edit Master title style ADVANCED PROGRAMING PRACTICES API documentation.
Java Programming, 3e Concepts and Techniques Chapter 2 - Part 2 Creating a Java Application and Applet.
(C) 2010 Pearson Education, Inc. All rights reserved.  Java programs normally go through five phases  edit  compile  load  verify  execute.
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.
Introduction to Programming David Goldschmidt, Ph.D. Computer Science The College of Saint Rose Java Fundamentals (Comments, Variables, etc.)
A brief introduction to javadoc and doxygen Cont’d.
Copyright © Curt Hill Java Looking at our first console application in Eclipse.
Program documentation Using the Doxygen tool Program documentation1.
Intro and Review Welcome to Java. Introduction Java application programming Use tools from the JDK to compile and run programs. Videos at
Classes CS 21a: Introduction to Computing I First Semester,
 Pearson Education, Inc. All rights reserved Introduction to Java Applications.
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 Array and Searching. Documentation rules Easy rules: –Naming convention for variables, constants and methods Difficult rules: –Professional.
Documentation javadoc. Documentation not a programmer's first love lives in a separate file somewhere usually a deliverable on the schedule often not.
Documentation Dr. Andrew Wallace PhD BEng(hons) EurIng
Javadoc Dwight Deugo Nesa Matic
Javadoc. Purpose of javadoc javadoc is a program that reads your Java program and produces great-looking documentation in HTML format Without any help,
CSE IntroductiontoDoxygen. Contents Introduction Main Steps for creating documentation Examples.
A brief introduction to doxygen. What does a compiler do?  A compiler ignores comments and processes the code.  What does doxygen do? –It ignores the.
 2008 Pearson Education, Inc. All rights reserved JavaScript: Introduction to Scripting.
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.
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.
CSE 1030: Implementing Static Features Mark Shtern.
SourceAnatomy1 Java Source Anatomy Barb Ericson Georgia Institute of Technology July 2008.
CSC 110 – Intro to Computing - Programming
Winter 2006CISC121 - Prof. McLeod1 Stuff We had better discuss a midterm date… –27 Feb. to 3 March or –6 to 10 March.
Execution ways of program References: www. en.wikipedia.org/wiki/Integrated_development_environment  You can execute or run a simple java program with.
Chapter 7- Defining Your Own Classes Part 2 : Objectives After you have read and studied this chapter, you should be able to –Describe how objects are.
Today Javadoc. Packages and static import. Viewing API source code. Upcoming Topics: –protected access modifier –Using the debugger in Eclipse –JUnit testing.
Comp1004: Introduction III Java. Content How Java Works: The JVM Writing a Class in Java – Class – Member Variables – Method – Statement Magic incantations.
CCSA 221 Programming in C CHAPTER 3 COMPILING AND RUNNING YOUR FIRST PROGRAM 1 ALHANOUF ALAMR.
Problem Solving With C++ Doxygen Oct/Nov Introduction Doxygen is a documentation generator, a tool for writing software reference documentation.
Introduction to Programming
Advanced Programing practices
Working with Java.
Introduction to Scripting
A brief introduction to doxygen
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.
Chapter 1: Computer Systems
Class Commenting Doxygen for Classes.
Chap 1 Chap 2 Chap 3 Chap 5 Surprise Me
Anatomy of a Java Program
Advanced Programing practices
Introduction to javadoc
Classes CS 21a: Introduction to Computing I
Java Looking at our first console application in Eclipse
Compile and run c files.
Presentation transcript:

A brief introduction to javadoc and doxygen

What’s in a program file? 1. Comments 2. Code

What’s a compiler? A program A program Input Input Processing Processing Output Output

What’s a compiler? A program A program Input: Input: Text file (your program) Text file (your program) Processing: Processing: Convert HLL statements into machine code (or similar) Convert HLL statements into machine code (or similar) Ignore comments Ignore comments Output: Output: A binary file of machine code (or similar) A binary file of machine code (or similar)

What does a compiler do? A compiler ignores comments and processes the code. A compiler ignores comments and processes the code. What does doxygen (or javadoc) do? What does doxygen (or javadoc) do? It ignores the code and processes to comments. It ignores the code and processes to comments. Used to create HTML documentation. Used to create HTML documentation.

Traditional documentation Code files are separate from design documents. Code files are separate from design documents. Wouldn’t it be great if we could bring code and documentation together into the same file(s)? Wouldn’t it be great if we could bring code and documentation together into the same file(s)?

Tools like javadoc and doxygen A program A program Input: Input: Text file (your program) Text file (your program) Processing: Processing: Convert (specially formatted) comments into documentation Convert (specially formatted) comments into documentation Ignore HLL statements Ignore HLL statements Output: Output: Documentation (typically in HTML) Documentation (typically in HTML)

JAVADOC

javadoc-formatted comments /** * Summary sentence. * Summary sentence. * More general information about the * More general information about the * program, class, method or variable which * program, class, method or variable which * follows the comment, using as many lines * follows the comment, using as many lines * as necessary. * as necessary. * * zero or more tags to specify more specific kinds * zero or more tags to specify more specific kinds * of information, such as parameters and return * of information, such as parameters and return * values for a method * values for a method */ */ Note the extra *.

javadoc-umenting a variable /** * The number of students in the class. This variable must not be * The number of students in the class. This variable must not be * negative or greater than 200. * negative or greater than 200. */ */ public int numStudents; /** represents the game board */ private int[][] board;

javadoc-umenting a method /** ConnectFour ctor for a new game. */ /** ConnectFour ctor for a new game. */ public ConnectFour ( ) { public ConnectFour ( ) { //add code here to start a new game //add code here to start a new game }

javadoc-umenting a method w/ parameters /** /** * This method loads a previously saved game from the specified file. * This method loads a previously saved game from the specified file. fileName is the name of the file that contains the fileName is the name of the file that contains the * previously saved game to load. * previously saved game to load. */ */ private void onLoad ( final String fileName ) { //load a previously saved game //load a previously saved game} param tag

javadoc-umenting a method w/ parameters & a return value /** /** * This method loads a previously saved game from the specified file. * This method loads a previously saved game from the specified file. fileName is the name of the file that contains the fileName is the name of the file that contains the * previously saved game to load. * previously saved game to load. true if successful; false otherwise. true if successful; false otherwise. */ */ private boolean onLoad ( final String fileName ) { //load a previously saved game //load a previously saved game}

// /** * * * File name:ConnectFour.java * File name:ConnectFour.java * Author:George J. Grevera, Ph.D. * Author:George J. Grevera, Ph.D. * Date:8/1/2007 * Date:8/1/2007 * Program/Lab #:0 * Program/Lab #:0 * * Detailed description: * Detailed description: * This file contains the ConnectFour class that implements a game of * This file contains the ConnectFour class that implements a game of * Connect Four. * Connect Four. * * Description of the input and output: * Description of the input and output: * Input consists of an optional file that contains a previously saved * Input consists of an optional file that contains a previously saved * game. * game. * Output consists of an optional file to save a game. * Output consists of an optional file to save a game. * * */ */// public class ConnectFour { /** represents the game board */ /** represents the game board */ private int[][] board; private int[][] board;… javadoc-umenting a class Note the HTML.

javadoc Complete example: Complete example: Result: Result:

Required documentation rules 1. Each file, class, method, and member variable must be documented w/ javadoc. 2. The contents of the body of each method may and should contains comments, but none of these comments should be in the javadoc format. (Not every comment is a javadoc comment!)

Running javadoc 1. Search for javadoc.exe. Ex. c:\Program Files\Java\jdk1.5.0_06\bin\javadoc.exe Ex. c:\Program Files\Java\jdk1.5.0_06\bin\javadoc.exe 2. Open a command prompt window. 3. cd to the folder (directory) where your.java files are. 4. Run javadoc (“” required because of space) Ex. “c:\Program Files\Java\jdk1.5.0_06\bin\javadoc” –d html –private ConnectFour.java Ex. “c:\Program Files\Java\jdk1.5.0_06\bin\javadoc” –d html –private ConnectFour.java

Running javadoc via jgrasp

Running javadoc via netbeans

Running javadoc via eclipse