KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > spi > jsp > lexer > JspParseData


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20
21 package org.netbeans.spi.jsp.lexer;
22
23 import java.util.Collections JavaDoc;
24 import java.util.Map JavaDoc;
25
26
27 /** Holds data relevant to the JSP coloring for one JSP page.
28  *
29  * @author Marek Fukala
30  */

31 public final class JspParseData {
32     
33     private Map JavaDoc<String JavaDoc, String JavaDoc> prefixMap;
34     private boolean isELIgnored, isXMLSyntax;
35     
36     public JspParseData() {
37         prefixMap = Collections.emptyMap();
38         isELIgnored = false;
39         isXMLSyntax = false;
40     }
41     
42     /** Updates coloring data. The update is initiated by parser successfuly finished parsing. */
43     public void updateParseData(Map JavaDoc<String JavaDoc,String JavaDoc> prefixMap, boolean isELIgnored, boolean isXMLSyntax) {
44         this.prefixMap = prefixMap;
45         this.isELIgnored = isELIgnored;
46         this.isXMLSyntax = isXMLSyntax;
47     }
48     
49     /** Returns true if the given tag library prefix is known in this page.
50      */

51     public boolean isTagLibRegistered(String JavaDoc prefix) {
52         if (prefixMap == null) {
53             return false;
54         }
55         return prefixMap.containsKey(prefix);
56     }
57     
58     /** Returns true if the EL is ignored in this page.
59      */

60     public boolean isELIgnored() {
61         return isELIgnored;
62     }
63     
64     /** Returns true if the page is in xml syntax (JSP Documnet).
65      * If the page is in standard syntax, returns false.
66      */

67     public boolean isXMLSyntax(){
68         return isXMLSyntax;
69     }
70     
71 }
72
Popular Tags