A marker class whose purpose is to add compile-time type safety to node annotations.
Represents an external Link.
Represents an external Link. The children of this node represent the label of the link. If the source does not define a label explicitly, a TextNode containing the link destination will be the only child.
The destination URI of this link
The nodes of the label of this link
The source line number of this link
Represents an InterWiki Link.
Represents an InterWiki Link. The children of this node represent the label of the link. If the source does not define a label explicitly, a TextNode containing the link destination will be the only child.
The destination WikiTitle of this link
The nodes of the label of this link
The source line number of this link
Represents an internal Link.
Represents an internal Link. The children of this node represent the label of the link. If the source does not define a label explicitly, a TextNode containing the link destination will be the only child.
The destination WikiTitle of this link
The nodes of the label of this link
The source line number of this link
Represents a Link.
Represents a Link. This class is abstract and derived by ExternalLinkNode and InternalLinkNode. The children of this node represent the label of the link. If the source does not define a label explicitly, a TextNode containing the link destination will be the only child.
Namespaces codes.
Namespaces codes.
FIXME: This object should not exist. We must load the namespaces for a MediaWiki instance from its api.php or from a file. These values must then be injected into all objects that need them.
FIXME: separate Wikipedia and DBpedia namespaces. We cannot even be sure that there are no name clashes. "Mapping ko" may mean "Template talk" in some language...
Base class of all nodes in the abstract syntax tree.
Base class of all nodes in the abstract syntax tree.
This class is NOT thread-safe.
Represents a page.
Represents a parser function.
Represents a parser function.
The title of the page, where this parser function is defined
The properties of this parser function
The source line number of this parser function
Represents a template property.
Represents a template property.
The key by which this property is identified in the template.
The contents of the value of this property
The source line number of this property
Represents a section.
Represents a section.
The name of this section
The level of this section. This corresponds to the number of '=' in the WikiText source
The nodes of the section name
The source line number of this section
Represents a table cell
Represents a table cell
The contents of this cell
The (first) line where this table cell is located in the source
Represents a table.
Represents a table.
The rows are represents as child nodes. Each row itself contains a child node for each of its cells.
The caption of this table
The rows of this table
The (first) line where this table is located in the source
Represents a table row
Represents a table row
The cells of this table row.
The (first) line where this table row is located in the source
Represents a template.
Represents a template.
The title of the page, where this template is defined
The properties of this template
The source line number of this property
Represents a template property.
Represents a template property.
The key by which this property is identified in the template.
The contents of the value of this property
The source line number of this property
Represents plain text.
Represents plain text.
The text
The source line number where this text begins
Represents a wiki page
Represents a wiki page
TODO: use redirect id to check redirect extractor. Or get rid of redirect extractor.
Parses WikiText source and builds an Abstract Syntax Tree.
Parses WikiText source and builds an Abstract Syntax Tree. Create new instances of this trait by using the companion object.
Thrown whenever a parsing error is encountered.
Represents a page title.
Represents a page title. Or a link to a page.
FIXME: a link is different from a title and should be represented by a different class.
Utility functions for working with nodes.
Creates new WikiParser instances.
A marker class whose purpose is to add compile-time type safety to node annotations. Replaces annotation key names. Usage is similar to annotation key names, but annotation key names are distinguished by equality, while AnnotationKey objects are distinguished by identity. Thus, this class does not override hashCode and equals.
Note: we could add a name to objects of this class, which would probably be nice for debugging, but could lead to confusion: one might think that the name is the actual key, but is isn't, and cannot be, because we cannot associate the name with the type of the annotation - at run-time, the type is gone because of erasure. Two annotation key objects with the same name would still be completely unrelated keys.
TODO: as a dedugging aid, call Thread.currentThread.getStackTrace in the constructor and save class name, method name and line number of the place where the annotation key was created. Probably the second element in the stack trace array, but that's not guaranteed.