Source Code Cross Referenced for ProfileRef.java in  » Web-Server » Jigsaw » org » w3c » jigsaw » ccpp » 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 Server » Jigsaw » org.w3c.jigsaw.ccpp 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        // ProfileRef.java
002:        // $Id: ProfileRef.java,v 1.2 2000/08/16 21:37:34 ylafon Exp $
003:        // (c) COPYRIGHT MIT, INRIA and Keio, 2000.
004:        // Please first read the full copyright statement in file COPYRIGHT.html
005:
006:        package org.w3c.jigsaw.ccpp;
007:
008:        /**
009:         * A Profile reference 
010:         * (syntax described at http://www.w3.org/1999/06/NOTE-CCPPexchange-19990624)
011:         * @version $Revision: 1.2 $
012:         * @author  Benoît Mahé (bmahe@w3.org)
013:         */
014:        public class ProfileRef {
015:
016:            int number = -1;
017:            boolean isDiff = false;
018:            String diffname = null;
019:            String ref = null;
020:            String uri = null;
021:            boolean parsed = false;
022:
023:            /**
024:             * Get the unparsed profile reference (used for error message)
025:             * @return a String;
026:             */
027:            public String getUnparsedRef() {
028:                return ref;
029:            }
030:
031:            /**
032:             * Is this Profile reference an absolute URI?
033:             * @return a boolean
034:             */
035:            public boolean isURI() {
036:                return !isDiff;
037:            }
038:
039:            /**
040:             * Get the URI
041:             * @return a String (or null if this reference is not an URI)
042:             * @exception InvalidProfileException if the profile reference is not valid
043:             */
044:            public String getURI() throws InvalidProfileException {
045:                parse();
046:                return uri;
047:            }
048:
049:            /**
050:             * Is this Profile reference a profile diff name?
051:             * @return a boolean
052:             */
053:            public boolean isDiffName() {
054:                return isDiff;
055:            }
056:
057:            /**
058:             * Get the diff number
059:             * @return a integer (or -1 if this reference is not a profile diff name)
060:             * @exception InvalidProfileException if the profile reference is not valid
061:             */
062:            public int getDiffNumber() throws InvalidProfileException {
063:                parse();
064:                return number;
065:            }
066:
067:            /**
068:             * Get the profile diff name
069:             * @return a String (or null if this reference is not a profile diff name)
070:             * @exception InvalidProfileException if the profile reference is not valid
071:             */
072:            public String getDiffName() throws InvalidProfileException {
073:                parse();
074:                return diffname;
075:            }
076:
077:            protected void parse() throws InvalidProfileException {
078:                if (!parsed) {
079:                    if (isDiff) {
080:                        int idx = ref.indexOf('-');
081:                        if (idx != -1) {
082:                            this .diffname = ref.substring(idx + 1);
083:                            String snum = ref.substring(0, idx);
084:                            try {
085:                                number = Integer.parseInt(snum);
086:                            } catch (NumberFormatException ex) {
087:                                number = -1;
088:                            }
089:                        } else {
090:                            throw new InvalidProfileException(ref);
091:                        }
092:                    } else {
093:                        uri = ref;
094:                    }
095:                    parsed = true;
096:                }
097:            }
098:
099:            /**
100:             * Constructor
101:             * @param ref the raw profile reference. ie :
102:             * <ul>
103:             * <li> "http://www.aaa.com/hw"
104:             * <li> "1-uKhjE/AEeeMzFSejsYshHg=="
105:             * </ul>
106:             */
107:            public ProfileRef(String ref) {
108:                this .ref = ref;
109:                this .isDiff = !(ref.indexOf(':') != -1);
110:            }
111:
112:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.