KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jface > text > rules > MultiLineRule


1 /*******************************************************************************
2  * Copyright (c) 2000, 2005 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.jface.text.rules;
12
13
14 /**
15  * A rule for detecting patterns which begin with a given
16  * sequence and may end with a given sequence thereby spanning
17  * multiple lines.
18  */

19 public class MultiLineRule extends PatternRule {
20
21     /**
22      * Creates a rule for the given starting and ending sequence
23      * which, if detected, will return the specified token.
24      *
25      * @param startSequence the pattern's start sequence
26      * @param endSequence the pattern's end sequence
27      * @param token the token to be returned on success
28      */

29     public MultiLineRule(String JavaDoc startSequence, String JavaDoc endSequence, IToken token) {
30         this(startSequence, endSequence, token, (char) 0);
31     }
32
33     /**
34      * Creates a rule for the given starting and ending sequence
35      * which, if detected, will return the specific token.
36      * Any character which follows the given escape character will be ignored.
37      *
38      * @param startSequence the pattern's start sequence
39      * @param endSequence the pattern's end sequence
40      * @param token the token to be returned on success
41      * @param escapeCharacter the escape character
42      */

43     public MultiLineRule(String JavaDoc startSequence, String JavaDoc endSequence, IToken token, char escapeCharacter) {
44         this(startSequence, endSequence, token, escapeCharacter, false);
45     }
46
47     /**
48      * Creates a rule for the given starting and ending sequence
49      * which, if detected, will return the specific token. Any character that follows the
50      * given escape character will be ignored. <code>breakOnEOF</code> indicates whether
51      * EOF is equivalent to detecting the <code>endSequence</code>.
52      *
53      * @param startSequence the pattern's start sequence
54      * @param endSequence the pattern's end sequence
55      * @param token the token to be returned on success
56      * @param escapeCharacter the escape character
57      * @param breaksOnEOF indicates whether the end of the file terminates this rule successfully
58      * @since 2.1
59      */

60     public MultiLineRule(String JavaDoc startSequence, String JavaDoc endSequence, IToken token, char escapeCharacter, boolean breaksOnEOF) {
61         super(startSequence, endSequence, token, escapeCharacter, false, breaksOnEOF);
62     }
63 }
64
Popular Tags