Libraries anvil runtime Doc

class Doc
extends anvil.lang.object
Doc is a node in documentation tree, consisting of type, identifier and text.

Type is one of

If document is one marked with asterisk (*) then it will also contain identifier which indicates the name of documented entity.

Doc may also contain children docs.


Methods

Doc getChild()
Returns first child from this document.
Doc getChild(string type)
Returns first child from this document matching given type.
Doc getChild(string type, string ident)
Returns first child from this document matching given type and identifier.
Parameters type -  Type of document to search for
ident -  Identifier of document to search for
Returns Doc or undefined, if there were no matching documents.

list getChildren()
Returns children of this document.
list getChildren(string type)
Returns children of this document matching given type.
list getChildren(string type, string ident)
Returns children of this document matching given type and identifier.
Parameters type -  Type of document to search for
ident -  Identifier of document to search for
Returns list of Doc's

string getHead()
Returns first sentence from this document's text.
string getHead(string type)
Returns first sentence from first child document that matches given type.
string getHead(string type, string ident)
Returns first sentence from first child document that matches given type and identifier.
Parameters type -  Type of document to search for
ident -  Identifier of document to search for

string getIdent()
Returns document's identitier.

string getName()
Returns document's name (same getType).

Doc getNext()
Returns next document (sibling).
Returns Doc or undefined, if there is no next sibling.

string getText()
Returns this document's text.
string getText(string type)
Returns text of first child document matching given type.
string getText(string type, string ident)
Returns text of first child document matching given type and identifier.
Parameters type -  Type of document to search for
ident -  Identifier of document to search for

string getType()
Returns document's type (same getName).

boolean hasChildren()
Checks if this document has children.