Source Code Cross Referenced for XMLBaselessContext.java in  » RSS-RDF » Jena-2.5.5 » com » hp » hpl » jena » rdf » arp » impl » 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 » RSS RDF » Jena 2.5.5 » com.hp.hpl.jena.rdf.arp.impl 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         (c) Copyright 2003, 2004, 2005, 2006, 2007, 2008 Hewlett-Packard Development Company, LP
003:         [See end of file]
004:         $Id: XMLBaselessContext.java,v 1.6 2008/01/02 12:09:05 andy_seaborne Exp $
005:         */
006:        package com.hp.hpl.jena.rdf.arp.impl;
007:
008:        import org.xml.sax.SAXParseException;
009:
010:        import com.hp.hpl.jena.iri.IRI;
011:        import com.hp.hpl.jena.rdf.arp.ARPErrorNumbers;
012:
013:        /**
014:         * @author <a href="mailto:Jeremy.Carroll@hp.com">Jeremy Carroll</a>
015:         * 
016:         */
017:        public class XMLBaselessContext extends AbsXMLContext implements 
018:                ARPErrorNumbers {
019:
020:            final int errno;
021:
022:            final String errmsg;
023:
024:            public XMLBaselessContext(XMLHandler f, int eno) {
025:                this (f, eno, f.sameDocRef());
026:            }
027:
028:            //    XMLBaselessContext(XMLHandler f, int eno, String baseURI) {
029:            //        this(f,eno,f.iriFactory().create(baseURI).create(""));
030:            //    }
031:            XMLBaselessContext(XMLHandler f, int eno, IRI baseURI) {
032:                super (true, null, baseURI, new TaintImpl(), "", new TaintImpl());
033:                errno = eno;
034:                switch (errno) {
035:                case ERR_RESOLVING_URI_AGAINST_NULL_BASE:
036:                    errmsg = "Base URI is null, but there are relative URIs to resolve.";
037:                    break;
038:                case WARN_RESOLVING_URI_AGAINST_EMPTY_BASE:
039:                    errmsg = "Base URI is \"\", relative URIs left as relative.";
040:                    break;
041:                case ERR_RESOLVING_AGAINST_MALFORMED_BASE:
042:                    errmsg = "Resolving against bad URI <" + baseURI + ">";
043:                    break;
044:                case ERR_RESOLVING_AGAINST_RELATIVE_BASE:
045:                    errmsg = "Resolving against relative URI <" + baseURI + ">";
046:                    break;
047:                default:
048:                    throw new IllegalArgumentException("Unknown error code: "
049:                            + eno);
050:                }
051:            }
052:
053:            private XMLBaselessContext(AbsXMLContext document, IRI uri,
054:                    Taint baseT, String lang, Taint langT,
055:                    XMLBaselessContext parent) {
056:                super (true, document, uri, baseT, lang, langT);
057:                errno = parent.errno;
058:                errmsg = parent.errmsg;
059:            }
060:
061:            AbsXMLContext clone(IRI u, Taint baseT, String lng, Taint langT) {
062:                return new XMLBaselessContext(document, u, baseT, lng, langT,
063:                        this );
064:            }
065:
066:            public AbsXMLContext withBase(XMLHandler forErrors, String b)
067:                    throws SAXParseException {
068:                TaintImpl taintB = new TaintImpl();
069:                IRI newB = resolveAsURI(forErrors, taintB, b, false);
070:                if (newB.isRelative())
071:                    return new XMLBaselessContext(forErrors, errno, newB
072:                            .create(""));
073:
074:                if (newB.hasViolation(false))
075:                    return new XMLBaselessContext(forErrors,
076:                            ERR_RESOLVING_AGAINST_MALFORMED_BASE, newB);
077:                return new XMLContext(keepDocument(forErrors), document, newB
078:                        .create(""), taintB, lang, langTaint);
079:            }
080:
081:            boolean keepDocument(XMLHandler forErrors) {
082:                return !forErrors.ignoring(IGN_XMLBASE_SIGNIFICANT);
083:            }
084:
085:            boolean isSameAsDocument() {
086:                return this  == document;
087:            }
088:
089:            void baseUsed(XMLHandler forErrors, Taint taintMe, String relUri,
090:                    String string) throws SAXParseException {
091:                forErrors
092:                        .warning(taintMe, errno, errmsg + ": <" + relUri + ">");
093:
094:            }
095:
096:            void checkBaseUse(XMLHandler forErrors, Taint taintMe,
097:                    String relUri, IRI rslt) throws SAXParseException {
098:
099:                String resolvedURI = rslt.toString();
100:                if (relUri.equals(resolvedURI) && rslt.isAbsolute())
101:                    return;
102:
103:                forErrors
104:                        .warning(taintMe, errno, errmsg + ": <" + relUri + ">");
105:
106:            }
107:
108:        }
109:
110:        /*
111:         * (c) Copyright 2003, 2004, 2005, 2006, 2007, 2008 Hewlett-Packard Development Company, LP All
112:         * rights reserved.
113:         * 
114:         * Redistribution and use in source and binary forms, with or without
115:         * modification, are permitted provided that the following conditions are met:
116:         * 
117:         * 1. Redistributions of source code must retain the above copyright notice,
118:         * this list of conditions and the following disclaimer.
119:         * 
120:         * 2. Redistributions in binary form must reproduce the above copyright notice,
121:         * this list of conditions and the following disclaimer in the documentation
122:         * and/or other materials provided with the distribution.
123:         * 
124:         * 3. The name of the author may not be used to endorse or promote products
125:         * derived from this software without specific prior written permission.
126:         * 
127:         * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
128:         * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
129:         * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
130:         * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
131:         * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
132:         * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
133:         * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
134:         * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
135:         * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
136:         * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
137:         */
w_w___w___.ja__v___a__2s__.___c___o_m_ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.