Java Doc for XMLCatalogResolver.java in  » XML » xerces-2_9_1 » org » apache » xerces » util » 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 » XML » xerces 2_9_1 » org.apache.xerces.util 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.xerces.util.XMLCatalogResolver

XMLCatalogResolver
public class XMLCatalogResolver implements XMLEntityResolver,EntityResolver2,LSResourceResolver(Code)

The catalog resolver handles the resolution of external identifiers and URI references through XML catalogs. This component supports XML catalogs defined by the OASIS XML Catalogs Specification. It encapsulates the XML Commons resolver. An instance of this class may be registered on the parser as a SAX entity resolver, as a DOM LSResourceResolver or as an XNI entity resolver by setting the property (http://apache.org/xml/properties/internal/entity-resolver).

It is intended that this class may be used standalone to perform catalog resolution outside of a parsing context. It may be shared between several parsers and the application.


author:
   Michael Glavassevich, IBM
version:
   $Id: XMLCatalogResolver.java 570138 2007-08-27 14:21:51Z mrglavas $



Constructor Summary
public  XMLCatalogResolver()
    
public  XMLCatalogResolver(String[] catalogs)
    
public  XMLCatalogResolver(String[] catalogs, boolean preferPublic)
    

Method Summary
final public synchronized  voidclear()
    
final public synchronized  String[]getCatalogList()
    
public  InputSourcegetExternalSubset(String name, String baseURI)
    

Locates an external subset for documents which do not explicitly provide one.

final public  booleangetPreferPublic()
    

Returns the preference for whether system or public matches are preferred.

final public  booleangetUseLiteralSystemId()
    

Returns the preference for whether the literal system identifier should be used when resolving system identifiers when both it and the expanded system identifier are available.

public  InputSourceresolveEntity(String publicId, String systemId)
    

Resolves an external entity.

public  InputSourceresolveEntity(String name, String publicId, String baseURI, String systemId)
    

Resolves an external entity.

public  XMLInputSourceresolveEntity(XMLResourceIdentifier resourceIdentifier)
    

Resolves an external entity.

public  StringresolveIdentifier(XMLResourceIdentifier resourceIdentifier)
    

Resolves an identifier using the catalog.

final public synchronized  StringresolvePublic(String publicId, String systemId)
    

Returns the URI mapping in the catalog for the given external identifier or null if no mapping exists.

public  LSInputresolveResource(String type, String namespaceURI, String publicId, String systemId, String baseURI)
    

Resolves a resource using the catalog.

final public synchronized  StringresolveSystem(String systemId)
    

Returns the URI mapping in the catalog for the given external identifier or null if no mapping exists.

final public synchronized  StringresolveURI(String uri)
    

Returns the URI mapping in the catalog for the given URI reference or null if no mapping exists.

final public synchronized  voidsetCatalogList(String[] catalogs)
    

Sets the initial list of catalog entry files.

final public  voidsetPreferPublic(boolean preferPublic)
    

Sets the preference for whether system or public matches are preferred.

final public  voidsetUseLiteralSystemId(boolean useLiteralSystemId)
    

Sets the preference for whether the literal system identifier should be used when resolving system identifiers when both it and the expanded system identifier are available.

The literal system identifier is the URI as it was provided before absolutization.



Constructor Detail
XMLCatalogResolver
public XMLCatalogResolver()(Code)

Constructs a catalog resolver with a default configuration.




XMLCatalogResolver
public XMLCatalogResolver(String[] catalogs)(Code)

Constructs a catalog resolver with the given list of entry files.


Parameters:
  catalogs - an ordered array list of absolute URIs



XMLCatalogResolver
public XMLCatalogResolver(String[] catalogs, boolean preferPublic)(Code)

Constructs a catalog resolver with the given list of entry files and the preference for whether system or public matches are preferred.


Parameters:
  catalogs - an ordered array list of absolute URIs
Parameters:
  preferPublic - the prefer public setting




Method Detail
clear
final public synchronized void clear()(Code)

Forces the cache of catalog mappings to be cleared.




getCatalogList
final public synchronized String[] getCatalogList()(Code)

Returns the initial list of catalog entry files.

the initial list of catalog entry files



getExternalSubset
public InputSource getExternalSubset(String name, String baseURI) throws SAXException, IOException(Code)

Locates an external subset for documents which do not explicitly provide one. This method always returns null. It should be overrided if other behaviour is required.


Parameters:
  name - the identifier of the document root element
Parameters:
  baseURI - the document's base URI
throws:
  SAXException - any SAX exception, possibly wrapping another exception
throws:
  IOException - thrown if some i/o error occurs



getPreferPublic
final public boolean getPreferPublic()(Code)

Returns the preference for whether system or public matches are preferred. This is used in the absence of any occurrence of the prefer attribute on the catalog entry of a catalog. If this property has not yet been explicitly set its value is true.

the prefer public setting



getUseLiteralSystemId
final public boolean getUseLiteralSystemId()(Code)

Returns the preference for whether the literal system identifier should be used when resolving system identifiers when both it and the expanded system identifier are available. If this property has not yet been explicitly set its value is true.

the preference for using literal system identifiersfor catalog resolution
See Also:   XMLCatalogResolver.setUseLiteralSystemId



resolveEntity
public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException(Code)

Resolves an external entity. If the entity cannot be resolved, this method should return null. This method returns an input source if an entry was found in the catalog for the given external identifier. It should be overridden if other behaviour is required.


Parameters:
  publicId - the public identifier, or null if none was supplied
Parameters:
  systemId - the system identifier
throws:
  SAXException - any SAX exception, possibly wrapping another exception
throws:
  IOException - thrown if some i/o error occurs



resolveEntity
public InputSource resolveEntity(String name, String publicId, String baseURI, String systemId) throws SAXException, IOException(Code)

Resolves an external entity. If the entity cannot be resolved, this method should return null. This method returns an input source if an entry was found in the catalog for the given external identifier. It should be overridden if other behaviour is required.


Parameters:
  name - the identifier of the external entity
Parameters:
  publicId - the public identifier, or null if none was supplied
Parameters:
  baseURI - the URI with respect to which relative systemIDs are interpreted.
Parameters:
  systemId - the system identifier
throws:
  SAXException - any SAX exception, possibly wrapping another exception
throws:
  IOException - thrown if some i/o error occurs



resolveEntity
public XMLInputSource resolveEntity(XMLResourceIdentifier resourceIdentifier) throws XNIException, IOException(Code)

Resolves an external entity. If the entity cannot be resolved, this method should return null. This method only calls resolveIdentifier and returns an input source if an entry was found in the catalog. It should be overridden if other behaviour is required.


Parameters:
  resourceIdentifier - location of the XML resource to resolve
throws:
  XNIException - thrown on general error
throws:
  IOException - thrown if some i/o error occurs



resolveIdentifier
public String resolveIdentifier(XMLResourceIdentifier resourceIdentifier) throws IOException, XNIException(Code)

Resolves an identifier using the catalog. This method interprets that the namespace of the identifier corresponds to uri entries in the catalog. Where both a namespace and an external identifier exist, the namespace takes precedence.


Parameters:
  resourceIdentifier - the identifier to resolve
throws:
  XNIException - thrown on general error
throws:
  IOException - thrown if some i/o error occurs



resolvePublic
final public synchronized String resolvePublic(String publicId, String systemId) throws IOException(Code)

Returns the URI mapping in the catalog for the given external identifier or null if no mapping exists. Public identifiers are normalized before comparison.


Parameters:
  publicId - the public identifier to locate in the catalog
Parameters:
  systemId - the system identifier to locate in the catalog the mapped URI or null if no mappingwas found in the catalog
throws:
  IOException - if an i/o error occurred while readingthe catalog



resolveResource
public LSInput resolveResource(String type, String namespaceURI, String publicId, String systemId, String baseURI)(Code)

Resolves a resource using the catalog. This method interprets that the namespace URI corresponds to uri entries in the catalog. Where both a namespace and an external identifier exist, the namespace takes precedence.


Parameters:
  type - the type of the resource being resolved
Parameters:
  namespaceURI - the namespace of the resource being resolved, or null if none was supplied
Parameters:
  publicId - the public identifier of the resource being resolved,or null if none was supplied
Parameters:
  systemId - the system identifier of the resource being resolved,or null if none was supplied
Parameters:
  baseURI - the absolute base URI of the resource being parsed, or null if there is no base URI



resolveSystem
final public synchronized String resolveSystem(String systemId) throws IOException(Code)

Returns the URI mapping in the catalog for the given external identifier or null if no mapping exists. If the system identifier is an URN in the publicid namespace it is converted into a public identifier by URN "unwrapping" as specified in the XML Catalogs specification.


Parameters:
  systemId - the system identifier to locate in the catalog the mapped URI or null if no mappingwas found in the catalog
throws:
  IOException - if an i/o error occurred while readingthe catalog



resolveURI
final public synchronized String resolveURI(String uri) throws IOException(Code)

Returns the URI mapping in the catalog for the given URI reference or null if no mapping exists. URI comparison is case sensitive. If the URI reference is an URN in the publicid namespace it is converted into a public identifier by URN "unwrapping" as specified in the XML Catalogs specification and then resolution is performed following the semantics of external identifier resolution.


Parameters:
  uri - the URI to locate in the catalog the mapped URI or null if no mappingwas found in the catalog
throws:
  IOException - if an i/o error occurred while readingthe catalog



setCatalogList
final public synchronized void setCatalogList(String[] catalogs)(Code)

Sets the initial list of catalog entry files. If there were any catalog mappings cached from the previous list they will be replaced by catalog mappings from the new list the next time the catalog is queried.


Parameters:
  catalogs - an ordered array list of absolute URIs



setPreferPublic
final public void setPreferPublic(boolean preferPublic)(Code)

Sets the preference for whether system or public matches are preferred. This is used in the absence of any occurrence of the prefer attribute on the catalog entry of a catalog.


Parameters:
  preferPublic - the prefer public setting



setUseLiteralSystemId
final public void setUseLiteralSystemId(boolean useLiteralSystemId)(Code)

Sets the preference for whether the literal system identifier should be used when resolving system identifiers when both it and the expanded system identifier are available.

The literal system identifier is the URI as it was provided before absolutization. It may be embedded within an entity. It may be provided externally or it may be the result of redirection. For example, redirection may have come from the protocol level through HTTP or from an application's entity resolver.

The expanded system identifier is an absolute URI which is the result of resolving the literal system identifier against a base URI.


Parameters:
  useLiteralSystemId - the preference for using literal system identifiers for catalog resolution



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.