Source Code Cross Referenced for StylesheetDescription.java in  » Portal » uPortal_rel-2-6-1-GA » org » jasig » portal » 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 » Portal » uPortal_rel 2 6 1 GA » org.jasig.portal 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /* Copyright 2001 The JA-SIG Collaborative.  All rights reserved.
002:         *  See license distributed with this file and
003:         *  available online at http://www.uportal.org/license.html
004:         */
005:
006:        package org.jasig.portal;
007:
008:        import java.util.Hashtable;
009:        import java.util.StringTokenizer;
010:
011:        import org.w3c.dom.ProcessingInstruction;
012:
013:        /**
014:         * Combines all of the information required to describe
015:         * an XSLT stylesheet.
016:         * @author Peter Kharchenko, pkharchenko@interactivebusiness.com
017:         * @version $Revision: 34820 $
018:         */
019:        public class StylesheetDescription {
020:            public String s_href;
021:            public String s_type;
022:            public String s_title;
023:            public String s_media;
024:            public String s_charset;
025:            public boolean b_alternate;
026:
027:            public StylesheetDescription() {
028:            }
029:
030:            public StylesheetDescription(String uri, String type) {
031:                s_href = uri;
032:                s_type = type;
033:                s_media = new String("");
034:                s_charset = null;
035:                b_alternate = false;
036:                s_title = new String("");
037:            }
038:
039:            public StylesheetDescription(String uri, String type, String title,
040:                    String media, String charset, boolean alternate) {
041:                s_href = uri;
042:                s_type = type;
043:                s_media = media;
044:                s_charset = charset;
045:                b_alternate = alternate;
046:                s_title = title;
047:            }
048:
049:            public StylesheetDescription(ProcessingInstruction pi) {
050:                // determine parameters from the ProcessingInstruction
051:                if (pi.getNodeName().equals("xml-stylesheet")) {
052:                    PIAttributes pia = new PIAttributes(pi);
053:                    s_href = pia.getAttribute("href");
054:                    s_type = pia.getAttribute("type");
055:                    s_title = pia.getAttribute("title");
056:                    s_media = pia.getAttribute("media");
057:                    s_charset = pia.getAttribute("charset");
058:
059:                    if ("yes".equals(pia.getAttribute("alternate")))
060:                        b_alternate = true;
061:                    else
062:                        b_alternate = false;
063:
064:                    if (s_media == null)
065:                        s_media = new String("");
066:
067:                    if (s_title == null)
068:                        s_title = new String("");
069:                }
070:            }
071:
072:            public StylesheetDescription(String data) {
073:                PIAttributes pia = new PIAttributes(data);
074:                s_href = pia.getAttribute("href");
075:                s_type = pia.getAttribute("type");
076:                s_title = pia.getAttribute("title");
077:                s_media = pia.getAttribute("media");
078:                s_charset = pia.getAttribute("charset");
079:
080:                if ("yes".equals(pia.getAttribute("alternate")))
081:                    b_alternate = true;
082:                else
083:                    b_alternate = false;
084:
085:                if (s_media == null)
086:                    s_media = new String("");
087:
088:                if (s_title == null)
089:                    s_title = new String("");
090:            }
091:
092:            public String getTitle() {
093:                return s_title;
094:            }
095:
096:            public String getURI() {
097:                return s_href;
098:            }
099:
100:            public String getType() {
101:                return s_type;
102:            }
103:
104:            public String getMedia() {
105:                return s_media;
106:            }
107:
108:            public boolean getAlternate() {
109:                return b_alternate;
110:            }
111:
112:            public String getCharset() {
113:                return s_charset;
114:            }
115:
116:            public void setTitle(String title) {
117:                s_title = title;
118:            }
119:
120:            public void setType(String type) {
121:                s_type = type;
122:            }
123:
124:            public void setMedia(String media) {
125:                s_media = media;
126:            }
127:
128:            public void setURI(String uri) {
129:                s_href = uri;
130:            }
131:
132:            public void setCharset(String charset) {
133:                s_charset = charset;
134:            }
135:
136:            public void setAlternate(boolean alternate) {
137:                b_alternate = alternate;
138:            }
139:
140:            /**
141:             * Parses a processing instruction's (PI) attributes for easy retrieval.
142:             */
143:            class PIAttributes {
144:                private Hashtable piAttributes = null;
145:
146:                PIAttributes(String data) {
147:                    piAttributes = new Hashtable();
148:                    StringTokenizer tokenizer = new StringTokenizer(data, "=\"");
149:                    while (tokenizer.hasMoreTokens()) {
150:                        piAttributes.put(tokenizer.nextToken().trim(),
151:                                tokenizer.nextToken().trim());
152:                    }
153:                }
154:
155:                /**
156:                 * Constructor.
157:                 * @param pi The processing instruction whose attributes are to be parsed
158:                 */
159:                PIAttributes(ProcessingInstruction pi) {
160:                    this (pi.getNodeValue());
161:                }
162:
163:                /**
164:                 * Returns value of specified attribute.
165:                 *  @param name Attribute name
166:                 *  @return Attribute value, or null if the attribute name does not exist
167:                 */
168:                String getAttribute(String name) {
169:                    return (String) piAttributes.get(name);
170:                }
171:            }
172:
173:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.