ptolemy.vergil.actor
Class DocBuilder

java.lang.Object
  extended by ptolemy.kernel.util.NamedObj
      extended by ptolemy.kernel.util.Attribute
          extended by ptolemy.vergil.actor.DocBuilder
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, Changeable, Debuggable, DebugListener, Derivable, ModelErrorHandler, MoMLExportable, Moveable, Nameable

public class DocBuilder
extends Attribute

Build Documentation for Java and Actors.

This class sets the commands that build the Java classes.

Since:
Ptolemy II 5.2
Version:
$Id: DocBuilder.java 59634 2010-10-21 05:24:30Z cxh $
Author:
Christopher Brooks
See Also:
Serialized Form
Accepted Rating:
Yellow (eal)
Proposed Rating:
Yellow (eal)

Nested Class Summary
 
Nested classes/interfaces inherited from class ptolemy.kernel.util.NamedObj
NamedObj.ContainedObjectsIterator
 
Field Summary
private  Configuration _configuration
          The configuration in which we look up the _applicationName and _docApplicationSpecializer parameters.
private  ExecuteCommands _executeCommands
          The object that actually executes the commands.
 Parameter cleanFirst
          If true, then clean before building documentation.
 
Fields inherited from class ptolemy.kernel.util.NamedObj
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS
 
Constructor Summary
DocBuilder(NamedObj container, java.lang.String name)
          Create a new instance of the DocBuilder.
 
Method Summary
private static java.lang.String _compilePtDoclet(java.io.File ptII)
          Return the command to compile ptII/doc/doclets/PtDoclet.
private  int _executeCommands()
          Build the documentation.
 int buildDocs()
          Build the Java class and Actor documentation.
 ExecuteCommands getExecuteCommands()
          Get the command executor, which can be either non-graphical or graphical.
 void setConfiguration(Configuration configuration)
          Set the configuration.
 void setExecuteCommands(ExecuteCommands executeCommands)
          Set the command executor, which can be either non-graphical or graphical.
 
Methods inherited from class ptolemy.kernel.util.Attribute
_checkContainer, _getContainedObject, _propagateExistence, clone, getContainer, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, setContainer, setName, updateContent
 
Methods inherited from class ptolemy.kernel.util.NamedObj
_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _debug, _debug, _debug, _debug, _debug, _description, _exportMoMLContents, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _propagateValue, _recordDecoratedAttributes, _removeAttribute, _splitName, _stripNumericSuffix, _validateSettables, addChangeListener, addDebugListener, attributeChanged, attributeList, attributeList, attributeTypeChanged, clone, containedObjectsIterator, deepContains, depthInHierarchy, description, description, event, executeChangeRequests, exportMoML, exportMoML, exportMoML, exportMoML, exportMoML, exportMoMLPlain, getAttribute, getAttribute, getAttributes, getChangeListeners, getClassName, getDecoratorAttribute, getDecoratorAttributes, getDerivedLevel, getDerivedList, getDisplayName, getElementName, getFullName, getModelErrorHandler, getName, getName, getPrototypeList, getSource, handleModelError, isDeferringChangeRequests, isOverridden, isPersistent, lazyContainedObjectsIterator, message, propagateExistence, propagateValue, propagateValues, removeChangeListener, removeDebugListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setDisplayName, setModelErrorHandler, setPersistent, setSource, sortContainedObjects, toplevel, toString, uniqueName, validateSettables, workspace
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

cleanFirst

public Parameter cleanFirst
If true, then clean before building documentation. The default value is false.


_configuration

private Configuration _configuration
The configuration in which we look up the _applicationName and _docApplicationSpecializer parameters.


_executeCommands

private ExecuteCommands _executeCommands
The object that actually executes the commands.

Constructor Detail

DocBuilder

public DocBuilder(NamedObj container,
                  java.lang.String name)
           throws IllegalActionException,
                  NameDuplicationException
Create a new instance of the DocBuilder.

Parameters:
container - The container.
name - The name of the code generator.
Throws:
IllegalActionException - If the super class throws the exception or error occurs when setting the file path.
NameDuplicationException - If the super class throws the exception or an error occurs when setting the file path.
Method Detail

buildDocs

public int buildDocs()
              throws IllegalActionException
Build the Java class and Actor documentation. The default is to run make in $PTII/doc. However, if the configuration set by setConfiguration(Configuration) then the configuration is searched for a _docApplicationSpecializer parameter. If that parameter exists it is assumed to name a class that implements the DocApplicationSpecializer interface and the DocApplicationSpecializer.buildCommands(ExecuteCommands) method which returns the commands to invoke.

Returns:
The return value of the last subprocess that was executed. or -1 if no commands were executed.
Throws:
IllegalActionException - If there is a problem building the documentation.

getExecuteCommands

public ExecuteCommands getExecuteCommands()
Get the command executor, which can be either non-graphical or graphical. The initial default is non-graphical, which means that stderr and stdout from subcommands is written to the console.

Returns:
executeCommands The subprocess command executor.
See Also:
setExecuteCommands(ExecuteCommands)

setConfiguration

public void setConfiguration(Configuration configuration)
Set the configuration.

Parameters:
configuration - The configuration in which we look up the _applicationName and _docApplicationSpecializer parameters.

setExecuteCommands

public void setExecuteCommands(ExecuteCommands executeCommands)
Set the command executor, which can be either non-graphical or graphical. The initial default is non-graphical, which means that stderr and stdout from subcommands is written to the console.

Parameters:
executeCommands - The subprocess command executor.
See Also:
getExecuteCommands()

_compilePtDoclet

private static java.lang.String _compilePtDoclet(java.io.File ptII)
Return the command to compile ptII/doc/doclets/PtDoclet.


_executeCommands

private int _executeCommands()
                      throws IllegalActionException
Build the documentation.

Returns:
The return value of the last subprocess that was executed or -1 if no commands were executed.
Throws:
IllegalActionException