Source Code Cross Referenced for XMLLump.java in  » Web-Framework » RSF » uk » org » ponder » rsf » template » 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 » RSF » uk.org.ponder.rsf.template 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Created on Jul 27, 2005
003:         */
004:        package uk.org.ponder.rsf.template;
005:
006:        import java.util.HashMap;
007:        import java.util.Map;
008:
009:        import uk.org.ponder.arrayutil.ArrayUtil;
010:
011:        /**
012:         * A primitive "lump" of an XML document, representing a "significant" 
013:         * character span. The basic function is to hold indexes start, length into
014:         * the character array for the document, as well as various housekeeping 
015:         * information to aid navigation and debugging.
016:         * 
017:         * @author Antranig Basman (antranig@caret.cam.ac.uk)
018:         */
019:        public class XMLLump {
020:            public int lumpindex;
021:            public int line, column;
022:            public int nestingdepth;
023:
024:            public XMLViewTemplate parent;
025:
026:            public int start, length;
027:            public String rsfID;
028:            public XMLLump open_end; // lump containing " >"
029:            public XMLLump close_tag; // lump containing "</close">
030:            public XMLLump uplump;
031:            // open and close will be the same for empty tag case " />"
032:            // headlump has standard text of |<tagname | to allow easy identification.
033:            public XMLLumpMMap downmap;
034:
035:            // potentially present on *every* tag - maps branch names to their final close lump 
036:            private Map endmap;
037:            // map from attribute name to lump where value occurs.
038:            // this may be reformed to map to text if we collapse attribute lumps?
039:            // this is a HashMap so that the fast clone method is easily accessible
040:            public HashMap attributemap;
041:            // the (XHTML) attribute appearing in the template file designating a 
042:            // template component. 
043:            public static final String ID_ATTRIBUTE = "rsf:id";
044:            /** The prefix indicating an rsf:id for a 
045:             * {@link uk.org.ponder.rsf.renderer.scr.StaticComponentRenderer}
046:             */
047:            public static final String SCR_PREFIX = "scr=";
048:            /** The prefix indicating an rsf:id for a simple internationalised message **/
049:            public static final String MSG_PREFIX = "msg=";
050:            /** Value for rsf:id that represents a CollectingSCR */
051:            public static final String SCR_CONTRIBUTE_PREFIX = "scr=contribute-";
052:            // A value for the rsf:id attribute indicating that the actual (leaf) component
053:            // to be targetted by component rendering is somewhere inside the component
054:            // holding the ID. NEVER issue a component with this ID! In this case, the
055:            // component holding the ID will be either a div or a span.
056:            public static final String PAYLOAD_COMPONENT = "payload-component";
057:            // this occurs in the SAME CONTAINER scope as the target???
058:            public static final String FORID_PREFIX = "message-for:";// + SplitID.SEPARATOR;
059:            public static final String FORID_SUFFIX = "*";
060:            /** This prefix for an rsf:id will elide the surrounding tag when rendered. This
061:             * cannot be combined with an empty body*/
062:            public static final String ELISION_PREFIX = "~";
063:
064:            public XMLLump() {
065:            }
066:
067:            public XMLLump(int lumpindex, int nestingdepth) {
068:                this .lumpindex = lumpindex;
069:                this .nestingdepth = nestingdepth;
070:            }
071:
072:            public XMLLump getDownHolder() {
073:                XMLLump move = this ;
074:                while (move != null && move.downmap == null)
075:                    move = move.uplump;
076:                return move;
077:            }
078:
079:            public XMLLump getFinal(String id) {
080:                return (XMLLump) (endmap == null ? null : endmap.get(id));
081:            }
082:
083:            public void setFinal(String ID, XMLLump lump) {
084:                if (endmap == null) {
085:                    endmap = new HashMap(8);
086:                }
087:                endmap.put(ID, lump);
088:            }
089:
090:            public boolean textEquals(String tocheck) {
091:                return ArrayUtil.equals(tocheck, parent.buffer, start, length);
092:            }
093:
094:            public static String tagToText(String tagname) {
095:                return "<" + tagname + " ";
096:            }
097:
098:            public static String textToTag(String text) {
099:                return text.substring(1, text.length() - 1);
100:            }
101:
102:            public String getTag() {
103:                return new String(parent.buffer, start + 1, length - 2);
104:            }
105:
106:            public String toDebugString() {
107:                return "lump line " + line + " column " + column + " index "
108:                        + lumpindex;
109:            }
110:
111:            public String toString() {
112:                return new String(parent.buffer, start, length)
113:                        + " at "
114:                        + toDebugString()
115:                        + (parent.fullpath == null ? "" : " in file "
116:                                + parent.fullpath);
117:            }
118:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.