1 /* FOREGEJ - FOrmatting REfactoring GEnerating Java
2 *
3 * Copyright (C) 2003 Andreas Arrgard
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19 package com.octagroup.foregej.java.lang;
20 import com.octagroup.foregej.antlr.BaseToken;
21 import com.octagroup.foregej.java.lang.tok.TOK_WS;
22 /***
23 * A java token.
24 */
25 public class JavaToken extends BaseToken
26 {
27 protected int endLine;
28 protected int endColumn;
29 protected JavaLexerBase javaLexer;
30 /***
31 * Returns the end column
32 *
33 * @return the end column
34 */
35 public int getEndColumn()
36 {
37 return endColumn;
38 }
39 /***
40 * Returns the end line
41 *
42 * @return the end line
43 */
44 public int getEndLine()
45 {
46 return endLine;
47 }
48 /***
49 * Sets the end column
50 *
51 * @param endColumn
52 */
53 public void setEndColumn(int endColumn)
54 {
55 this.endColumn=endColumn;
56 }
57 /***
58 * Sets the end line
59 *
60 * @param endLine the end line
61 */
62 public void setEndLine(int endLine)
63 {
64 this.endLine=endLine;
65 }
66 /***
67 * Returns the lexer that created this token
68 *
69 * @return the lexer that created this token
70 */
71 public JavaLexerBase getJavaLexer()
72 {
73 return javaLexer;
74 }
75 /***
76 * Sets the lexer that created this token.
77 *
78 * @param lexer the lexer that created this token.
79 */
80 public void setJavaLexer(JavaLexerBase lexer)
81 {
82 javaLexer=lexer;
83 }
84 /***
85 * Returns true if this token is followed by a white space with a new
86 * line separator.
87 *
88 * @return
89 */
90 public boolean hasNewLineAfter()
91 {
92 if(false==getHiddenAfter() instanceof TOK_WS) {
93 return false;
94 }
95 String text=getHiddenAfter().getText();
96 return text.indexOf('\r')!=-1||text.indexOf('\n')!=-1;
97 }
98 }
This page was automatically generated by Maven