Source Code Cross Referenced for Tag.java in  » Web-Framework » anvil » anvil » script » statements » taglib » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Web Framework » anvil » anvil.script.statements.taglib 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * $Id: Tag.java,v 1.4 2002/09/16 08:05:06 jkl Exp $
003:         *
004:         * Copyright (c) 2002 Njet Communications Ltd. All Rights Reserved.
005:         *
006:         * Use is subject to license terms, as defined in
007:         * Anvil Sofware License, Version 1.1. See LICENSE 
008:         * file, or http://njet.org/license-1.1.txt
009:         */
010:        package anvil.script.statements.taglib;
011:
012:        import java.util.Enumeration;
013:        import anvil.java.util.Hashlist;
014:        import anvil.script.Grammar;
015:
016:        /**
017:         * class Tag
018:         *
019:         * @author: Jani Lehtimäki
020:         */
021:        public class Tag {
022:            private TagLibrary _library;
023:            private String _name;
024:            private boolean _hasContent = false;
025:            private boolean _anyAttributes = false;
026:            private String _initHandler = null;
027:            private String _startHandler = null;
028:            private String _startMethod = null;
029:            private String _endHandler = null;
030:            private String _endMethod = null;
031:            private String _releaseHandler = null;
032:            private String _releaseMethod = null;
033:            private String _info = "";
034:            private Hashlist _attributes = new Hashlist();
035:
036:            public Tag(TagLibrary library, String name) {
037:                _library = library;
038:                _name = name;
039:            }
040:
041:            protected String validate(Parser parser, String name, String value) {
042:                value = value.trim();
043:                if (!Grammar.isValidIdentifier(value)) {
044:                    parser.error("Value of property '" + name
045:                            + "' is not a valid identifier");
046:                }
047:                return value;
048:            }
049:
050:            boolean setAttribute(Parser parser, String name, String value) {
051:                if (name.equalsIgnoreCase("hascontent")) {
052:                    _hasContent = value.trim().equalsIgnoreCase("true");
053:
054:                } else if (name.equalsIgnoreCase("anyattributes")) {
055:                    _anyAttributes = value.trim().equalsIgnoreCase("true");
056:
057:                } else if (name.equalsIgnoreCase("inithandler")) {
058:                    _initHandler = validate(parser, "inithandler", value);
059:
060:                } else if (name.equalsIgnoreCase("starthandler")) {
061:                    _startHandler = validate(parser, "starthandler", value);
062:
063:                } else if (name.equalsIgnoreCase("endhandler")) {
064:                    _endHandler = validate(parser, "endhandler", value);
065:
066:                } else if (name.equalsIgnoreCase("releasehandler")) {
067:                    _releaseHandler = validate(parser, "releasehandler", value);
068:
069:                } else if (name.equalsIgnoreCase("startmethod")) {
070:                    _startMethod = validate(parser, "startmethod", value);
071:
072:                } else if (name.equalsIgnoreCase("endmethod")) {
073:                    _endMethod = validate(parser, "endmethod", value);
074:
075:                } else if (name.equalsIgnoreCase("releasemethod")) {
076:                    _releaseMethod = validate(parser, "releasemethod", value);
077:
078:                } else if (name.equalsIgnoreCase("info")) {
079:                    _info = value.trim();
080:
081:                } else {
082:                    return false;
083:                }
084:                return true;
085:            }
086:
087:            void addAttribute(Attribute attr) {
088:                _attributes.put(attr.getName(), attr);
089:            }
090:
091:            public TagLibrary getLibrary() {
092:                return _library;
093:            }
094:
095:            public String getName() {
096:                return _name;
097:            }
098:
099:            public boolean hasContent() {
100:                return _hasContent;
101:            }
102:
103:            public boolean allowAnyAttributes() {
104:                return _anyAttributes;
105:            }
106:
107:            public String getInitHandler() {
108:                return _initHandler;
109:            }
110:
111:            public String getStartHandler() {
112:                return _startHandler;
113:            }
114:
115:            public String getEndHandler() {
116:                return _endHandler;
117:            }
118:
119:            public String getReleaseHandler() {
120:                return _releaseHandler;
121:            }
122:
123:            public String getStartMethod() {
124:                return _startMethod;
125:            }
126:
127:            public String getEndMethod() {
128:                return _endMethod;
129:            }
130:
131:            public String getReleaseMethod() {
132:                return _releaseMethod;
133:            }
134:
135:            public String getInfo() {
136:                return _info;
137:            }
138:
139:            public Enumeration getAttributes() {
140:                return _attributes.elements();
141:            }
142:
143:            public boolean hasAttribute(String name) {
144:                return _attributes.containsKey(name);
145:            }
146:
147:            public Attribute getAttribute(String name) {
148:                return (Attribute) _attributes.get(name);
149:            }
150:
151:            public String toString() {
152:                StringBuffer buffer = new StringBuffer();
153:                buffer.append("  Tag {\n    name:");
154:                buffer.append(_name);
155:                buffer.append("\n    hasContent:");
156:                buffer.append(_hasContent);
157:                buffer.append("\n    info:'");
158:                buffer.append(_info);
159:                buffer.append("\'\n");
160:                Enumeration e = _attributes.elements();
161:                while (e.hasMoreElements()) {
162:                    buffer.append(e.nextElement().toString());
163:                }
164:                buffer.append("  }\n");
165:                return buffer.toString();
166:            }
167:
168:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.