Jump to content

Extension:NetlabsClassTree: Difference between revisions

From NikiWiki
Cla (talk | contribs)
added category and class tree
Cla (talk | contribs)
added feature list and more
Line 7: Line 7:
Object Class definitions can be written in a simple list format, contained by the custom -ClassTree- tag. Here is a sample:
Object Class definitions can be written in a simple list format, contained by the custom -ClassTree- tag. Here is a sample:


  -ClassTree title="Api title"-
  -ClassTree title="API Title"-
  * class1:baseclass:This class implements base functionality for all classes implemented here.
  * class1:baseclass:This class implements base functionality for all classes implemented here.
  ** setValue(char * newvalue)
  ** setValue(char * newvalue):This method sets the value.
  ** queryValue( char* value, int maxsize)
  ** queryValue( char* value, int maxsize):This method queries the value.
  * class2:class1:this is a subclass.
  * class2:class1:this is a subclass.
  ** setValue(char * newvalue):this override modifies how the new value is being set.
  ** setValue(char * newvalue):this override modifies how the new value is being set.
  -/ClassTree-
  -/ClassTree-


This results in the following class tree:
=== Sample Output ===
Te above sample results in the following class tree:


<ClassTree title="Api title">
<ClassTree title="API Title">
* class1:baseclass:This class implements base functionality for all classes implemented here.
* class1:baseclass:This class implements base functionality for all classes implemented here.
** setValue(char * newvalue)
** setValue(char * newvalue):This method sets the value.
** queryValue( char* value, int maxsize)
** queryValue( char* value, int maxsize):This method queries the value.
* class2:class1:this is a subclass.
* class2:class1:this is a subclass.
** setValue(char * newvalue):this override modifies how the new value is being set.
** setValue(char * newvalue):this override modifies how the new value is being set.
</ClassTree>
</ClassTree>
=== List Features ===
The ClassTree output implements the following features:
* the output consists of a
** class hierarchy list
*** the hierarchy starts with the top parent classes, where the list of these top parents is not sorted
*** the title of the class links display the class description 8move the mouse pointer over a class link to view it)
** a class description list, containing the class description and a method list per class
*** the classes are ordered like they appear in the class hierarchy list
*** the methods are sorted alphabetically
* classes in the hierarchy list provide a link to its class description section within the class description list
* methods that override the same method of a parent class
** link to the same method of the parent class
** list all parent implementors of the same mthod
=== List Format ===
The following rules apply to the ClassTree definition:
* The title of the desribed API is specified with the attribute title of the ClassTree element
* Within the classTree definition, classes are specified on a line starting with a single * character, with the following syntax
* thisclass:parentclass:classdescription
* Within the classTree definition, methods are specfied below the class definition on a line starting with two * characters, with the following syntax
** method(type parm, type parm,...):methoddescription
* when defining overrides (specifying the same method for a subclass)
** the parameter list must be the same (spaces don't matter, but all other must match case-sensitive). This is a restriction to classes being implemented with the Netlabs Object Model (NOM),as polymorphism is not supported by NOM. If a method override specifies a different parameter list, an error is being prepended to the ClassTree output
** the description for that method is inherited from the parent class to the subclass, if no description is given for that method within the subclass

Revision as of 21:56, 15 August 2007


This extension adds a -ClassTree- tag that formts a simple list with information about classes and their methods into a Class Tree.

Usage

Syntax

Object Class definitions can be written in a simple list format, contained by the custom -ClassTree- tag. Here is a sample:

-ClassTree title="API Title"-
* class1:baseclass:This class implements base functionality for all classes implemented here.
** setValue(char * newvalue):This method sets the value.
** queryValue( char* value, int maxsize):This method queries the value.
* class2:class1:this is a subclass.
** setValue(char * newvalue):this override modifies how the new value is being set.
-/ClassTree-

Sample Output

Te above sample results in the following class tree:

<ClassTree title="API Title">

  • class1:baseclass:This class implements base functionality for all classes implemented here.
    • setValue(char * newvalue):This method sets the value.
    • queryValue( char* value, int maxsize):This method queries the value.
  • class2:class1:this is a subclass.
    • setValue(char * newvalue):this override modifies how the new value is being set.

</ClassTree>

List Features

The ClassTree output implements the following features:

  • the output consists of a
    • class hierarchy list
      • the hierarchy starts with the top parent classes, where the list of these top parents is not sorted
      • the title of the class links display the class description 8move the mouse pointer over a class link to view it)
    • a class description list, containing the class description and a method list per class
      • the classes are ordered like they appear in the class hierarchy list
      • the methods are sorted alphabetically
  • classes in the hierarchy list provide a link to its class description section within the class description list
  • methods that override the same method of a parent class
    • link to the same method of the parent class
    • list all parent implementors of the same mthod

List Format

The following rules apply to the ClassTree definition:

  • The title of the desribed API is specified with the attribute title of the ClassTree element
  • Within the classTree definition, classes are specified on a line starting with a single * character, with the following syntax
* thisclass:parentclass:classdescription
  • Within the classTree definition, methods are specfied below the class definition on a line starting with two * characters, with the following syntax
** method(type parm, type parm,...):methoddescription
  • when defining overrides (specifying the same method for a subclass)
    • the parameter list must be the same (spaces don't matter, but all other must match case-sensitive). This is a restriction to classes being implemented with the Netlabs Object Model (NOM),as polymorphism is not supported by NOM. If a method override specifies a different parameter list, an error is being prepended to the ClassTree output
    • the description for that method is inherited from the parent class to the subclass, if no description is given for that method within the subclass