| java.lang.Object org.eclipse.ui.examples.readmetool.DefaultSectionsParser
DefaultSectionsParser | public class DefaultSectionsParser implements IReadmeFileParser(Code) | | This class is a simple parser implementing the IReadmeFileParser
interface. It parses a Readme file into sections based on the
existence of numbered section tags in the input. A line beginning
with a number followed by a dot will be taken as a section indicator
(for example, 1., 2., or 12.).
As well, a line beginning with a subsection-style series of numbers
will also be taken as a section indicator, and can be used to
indicate subsections (for example, 1.1, or 1.1.12).
|
Method Summary | |
protected IAdaptable | getParent(Hashtable toc, String number) Returns the mark element that is the logical parent
of the given mark number. | protected String | getText(IFile file) Returns a string containing the contents of the given
file. | public MarkElement[] | parse(IFile file) Parses the input given by the argument. | protected String | parseNumber(String heading) Returns the number for this heading. |
getParent | protected IAdaptable getParent(Hashtable toc, String number)(Code) | | Returns the mark element that is the logical parent
of the given mark number. Each dot in a mark number
represents a parent-child separation. For example,
the parent of 1.2 is 1, the parent of 1.4.1 is 1.4.
Returns null if there is no appropriate parent.
|
getText | protected String getText(IFile file)(Code) | | Returns a string containing the contents of the given
file. Returns an empty string if there were any errors
reading the file.
|
parse | public MarkElement[] parse(IFile file)(Code) | | Parses the input given by the argument.
Parameters: file - the element containing the input text an element collection representing the parsed input |
parseNumber | protected String parseNumber(String heading)(Code) | | Returns the number for this heading. A heading consists
of a number (an arbitrary string of numbers and dots), followed by
arbitrary text.
|
|
|