Main Page | Class List | File List | Class Members | Related Pages

org.doxygen.tools.DoxygenConfig Class Reference

List of all members.

Detailed Description

This class holds the Configuration properties of Doxygen.

Version:
Revision
1.1.2.2
Since:
Ant-Doxygen 1.3.1

Definition at line 84 of file DoxygenConfig.java.

Public Member Functions

 DoxygenConfig ()
final void setProperty (final String keyName, final String value)
final void setProperty (final String keyName, final int value)
final void setProperty (final String keyName, final boolean value)
final TreeMap getTaskAttributes ()
final List getNestedAttributes ()
final DoxygenTask.Property getAttribute (final String keyName)
void addNestedAttribute (DoxygenTask.Property attr)
final void writeDoxygenConfig (final String theConfigFilename)
final TreeMap readDoxygenConfig (String theConfigFilename)
final void cascadeDoxygenConfig (final TreeMap map)


Constructor & Destructor Documentation

org.doxygen.tools.DoxygenConfig.DoxygenConfig  ) 
 

Parameters:
dprocess DoxygenProcess to execute 'doxygen' command
This constructor sets the initial Doxygen properties that are different from the default Doxygen configuration. Namely (in Doxygen configuration file terms):
  • DETAILS_AT_TOP = YES
  • EXPAND_TOC = YES
  • FILE_PATTERNS = *.java
  • GENERATE_LATEX = NO
  • HAVE_DOT = YES
  • HIDE_UNDOC_MEMBERS = YES
  • PROJECT_NAME = (the Ant project name)
  • INLINE_SOURCE = YES
  • INPUT = src
  • OPTIMIZE_OUTPUT_JAVA = YES
  • OUTPUT_DIRECTORY = doc
  • QUIET = YES
  • RECURSIVE = YES
  • SOURCE_BROWSER = YES

Test:
Verify that each of these items are set to these values in the amalgamated configuration file.

Definition at line 122 of file DoxygenConfig.java.

References org.doxygen.tools.DoxygenConfig.setProperty().

00122                            {
00123         setProperty("DETAILS_AT_TOP", true);
00124         setProperty("FILE_PATTERNS", "*.java");
00125         setProperty("GENERATE_LATEX", false);
00126         setProperty("HAVE_DOT", false);
00127         setProperty("HIDE_UNDOC_MEMBERS", true);
00128         setProperty("INLINE_SOURCES", true);
00129         setProperty("INPUT", "src");
00130         setProperty("GENERATE_TREEVIEW", true);
00131         setProperty("OPTIMIZE_OUTPUT_JAVA", true);
00132         setProperty("OUTPUT_DIRECTORY", "doc");
00133         setProperty("QUIET", true);
00134         setProperty("RECURSIVE", true);
00135         setProperty("SOURCE_BROWSER", true);
00136         setProperty("TOC_EXPAND", true);
00137     }


Member Function Documentation

void org.doxygen.tools.DoxygenConfig.addNestedAttribute DoxygenTask.Property  attr  ) 
 

Add Nested Attribute to the already existing list.

Definition at line 268 of file DoxygenConfig.java.

Referenced by org.doxygen.tools.DoxygenTask.createProperty(), and org.doxygen.tools.DoxygenTask.setConfig().

00268                                                               {
00269         nestedAttributes.add(attr);        
00270             
00271     }

final void org.doxygen.tools.DoxygenConfig.cascadeDoxygenConfig final TreeMap  map  ) 
 

This method cascades all Ant task attribute and nest attribute values into the passed TreeMap instance. This TreeMap instance is supposed to have been populated from the generated or user-specified Doxygen configuraton file. <br/>

Test:
the minimalist case has open-source / Java flavor Doxygen parameters set. <br/>

<doxygen> elements can influence Doxygen. <br/>

<doxygen> nested elements can influence Doxygen. <br/>

<doxygen> nested elements take precedence over <doxygen> non-nested elements. <br/>

Todo:
Add the Doxygen parameter version checking. <br/>
Parameters:
map contains all of the Doxygen configuration file basis.

Definition at line 392 of file DoxygenConfig.java.

Referenced by org.doxygen.tools.DoxygenConfig.writeDoxygenConfig().

00392                                                               {
00393         if  (taskAttributes.size() > 0) {
00394             Iterator iter = taskAttributes.values().iterator();
00395             while (iter.hasNext()) {
00396                 DoxygenTask.Property attribute = 
00397                         (DoxygenTask.Property) iter.next();
00398                 map.put(attribute.getName(), attribute.getValue());
00399             }
00400         }
00401         if  (nestedAttributes.size() > 0) {
00402             Iterator iter = nestedAttributes.iterator();
00403             while (iter.hasNext()) {
00404                 DoxygenTask.Property attribute = 
00405                         (DoxygenTask.Property) iter.next();
00406                 map.put(attribute.getName(), attribute.getValue());
00407             }
00408         }
00409     }

final DoxygenTask.Property org.doxygen.tools.DoxygenConfig.getAttribute final String  keyName  ) 
 

This method returns the attributes for jUnit test analysis.

Parameters:
keyName to be retreived.
Returns:
a Property containing as much of the specified attribute as is currently set.

Definition at line 252 of file DoxygenConfig.java.

Referenced by org.doxygen.tools.DoxygenConfig.setProperty().

00252                                                                          {
00253         DoxygenTask.Property retval = null;
00254         if  (taskAttributes.containsKey(keyName)) {
00255             retval = (DoxygenTask.Property) taskAttributes.get(keyName);
00256         }
00257         if  (retval == null) {
00258             retval = new DoxygenTask.Property();
00259             retval.setName(keyName);
00260         }
00261         return retval;
00262     }

final List org.doxygen.tools.DoxygenConfig.getNestedAttributes  ) 
 

This method returns the list of nested attributes for jUnit test analysis. <br/>

Note:
this method is for jUnit testing. <br/>
Returns:
a List containing all nested attributes set by this Ant task.

Definition at line 235 of file DoxygenConfig.java.

00235                                             {
00236         return nestedAttributes;
00237     }

final TreeMap org.doxygen.tools.DoxygenConfig.getTaskAttributes  ) 
 

This method returns the task attributes for jUnit test analysis. <br/>

Note:
this method is for jUnit testing.
Returns:
a TreeMap containing all <doxygen> tag attributes set by this Ant task.

Definition at line 218 of file DoxygenConfig.java.

Referenced by org.doxygen.tools.DoxygenTask.getTaskAttributes().

00218                                              {
00219         return taskAttributes;
00220     }

final TreeMap org.doxygen.tools.DoxygenConfig.readDoxygenConfig String  theConfigFilename  ) 
 

This method reads the Doxygen generated configuration file. <br/>

Note:
Due to the use of java.util.Properties, all comments in the base configuration file are dropped in the almagamated configuration file. This is acceptable, since the base configuration file is not overwritten and the almagamated file is alphabetized. <br/>

Bug:
ID=xxxxxx: In controlling Doxygen config file generation verbosity, that output now appears in the config file input stream. <br/>

ID=xxxxxx: Related to input stream mangling. PROJECT_NUMBER is loaded at ROJECT_NUMBER, which Doxygen complains about. Small fixup to reflect it back to the proper parameter name. <br/>

Parameters:
theConfigFilename generated by Doxygen -g.
Returns:
a TreeMap containing all of the Doxygen parameters to be used in the amalgamated configuration file.

Definition at line 343 of file DoxygenConfig.java.

Referenced by org.doxygen.tools.DoxygenConfig.writeDoxygenConfig().

00343                                                                      {
00344         TreeMap map = new TreeMap();
00345         Properties p = new Properties();
00346         try {
00347             p.load(new FileInputStream(theConfigFilename));
00348             if  (p.containsKey("Configuration")) {      // bug ID=xxxxxx
00349                 p.remove("Configuration");
00350                 p.remove("to");
00351                 p.remove("doxygen");
00352                 p.remove("Now");
00353                 p.remove("");
00354             }
00355             if (p.containsKey("ROJECT_NUMBER")) {       // bug ID=xxxxxx
00356                 p.setProperty("PROJECT_NUMBER", p.getProperty("ROJECT_NUMBER"));
00357                 p.remove("ROJECT_NUMBER");
00358             }
00359             Enumeration e = p.keys();
00360             while (e.hasMoreElements()) {
00361                 String arg = (String) e.nextElement();
00362                 map.put(arg, p.getProperty(arg));
00363             }
00364         } catch (IOException ioe) {
00365             throw new BuildException("Unable to read Doxygen config file: "
00366                                      + "[" + theConfigFilename + "]", ioe);
00367         }
00368         return map;
00369     }

final void org.doxygen.tools.DoxygenConfig.setProperty final String  keyName,
final boolean  value
 

This method translates an Ant <doxygen> task element into a Doxygen configuration file property name/value pair. <br/>

Test:
true / false values become "YES" / "NO" values.
Parameters:
keyName for this property.
value for this property.
minVersion required to use this property.

Definition at line 195 of file DoxygenConfig.java.

References org.doxygen.tools.DoxygenConfig.getAttribute().

00196                                                        {
00197         DoxygenTask.Property attribute = getAttribute(keyName);
00198         taskAttributes.put(keyName, attribute);
00199 
00200         String val = "YES";
00201         if  (!value) { val = "NO"; }
00202         attribute.setValue(val);
00203     }

final void org.doxygen.tools.DoxygenConfig.setProperty final String  keyName,
final int  value
 

This method translates an Ant <doxygen> task element into a Doxygen configuration file property name/value pair.

Parameters:
keyName for this property.
value for this property.
minVersion required to use this property.

Definition at line 174 of file DoxygenConfig.java.

References org.doxygen.tools.DoxygenConfig.getAttribute().

00175                                                    {
00176         DoxygenTask.Property attribute = getAttribute(keyName);
00177         taskAttributes.put(keyName, attribute);
00178         attribute.setValue("" + value);
00179     }

final void org.doxygen.tools.DoxygenConfig.setProperty final String  keyName,
final String  value
 

This method translates an Ant <doxygen> task element into a Doxygen configuration file property name/value pair. <br/>

Test:
String properties containing spaces are double quoted. <br/>
Parameters:
keyName for this property.
value for this property.
minVersion required to use this property.

Definition at line 151 of file DoxygenConfig.java.

References org.doxygen.tools.DoxygenConfig.getAttribute().

Referenced by org.doxygen.tools.DoxygenConfig.DoxygenConfig().

00152                                                       {
00153         DoxygenTask.Property attribute = getAttribute(keyName);
00154         taskAttributes.put(keyName, attribute);
00155 
00156         String val = value;
00157         if (val.indexOf(' ') > -1) { val =  "\"" + val + "\""; }
00158         attribute.setValue(val);
00159 
00160     }

final void org.doxygen.tools.DoxygenConfig.writeDoxygenConfig final String  theConfigFilename  ) 
 

This method writes and synchronizes the properties. <br/>

Test:
If specified, the base configuration file is not overwritten.
Parameters:
theConfigFilename used by Doxygen.

Definition at line 282 of file DoxygenConfig.java.

References org.doxygen.tools.DoxygenConfig.cascadeDoxygenConfig(), and org.doxygen.tools.DoxygenConfig.readDoxygenConfig().

Referenced by org.doxygen.tools.DoxygenTask.execute().

00282                                                                          {
00283 
00284         PrintStream ps = null;
00285         TreeMap map = readDoxygenConfig(theConfigFilename);
00286         cascadeDoxygenConfig(map);
00287         try {
00288             ps = new PrintStream(
00289                 new FileOutputStream(DoxygenTask.CONFIG_FILE));
00290             Set keys = map.entrySet();
00291 
00292             Iterator i = keys.iterator();
00293             while (i.hasNext()) {
00294                 Map.Entry me = (Map.Entry) i.next();
00295                 String param = (String) me.getKey();
00296                 String value = (String) me.getValue();
00297                 String line  = param + "\t=";
00298                 if  (value != null) { line += " " + value; }
00299                 ps.println(line);
00300             }
00301 /*            activityLog(false, "Updated Doxygen config file: "
00302                         + "[" + DoxygenTask.CONFIG_FILE + "]");
00303                         */
00304         } catch (IOException ioe) {
00305             throw new BuildException("Unable to update Doxygen config file: "
00306                                      + "[" + theConfigFilename + "]", ioe);
00307         } finally {
00308             if  (ps != null) {
00309                 ps.close();
00310                 ps = null;
00311             }
00312         }
00313     }


The documentation for this class was generated from the following file:
Generated on Sat Jan 31 02:17:29 2004 for Ant-Doxygen by doxygen 1.3.4