org.jboss.util.xml
Class CatalogLocation

java.lang.Object
  extended by org.jboss.util.xml.CatalogLocation

public class CatalogLocation
extends Object

A ThreadSpecificCatalogs class maintains all catalogfiles catolog.xml found in the Thread.currentThread().getContextClassLoader().

Version:
$Revision: 1.2 $
Author:
Daniel Wiese

Constructor Summary
CatalogLocation(URL url)
          Create a new CatalogLocation.
 
Method Summary
 boolean equals(Object other)
          To catalog locations are qual if the location is equal.
 int hashCode()
          Two catalog locations have the same hash code if the location is equal.
 boolean isEntityResolved()
          Returns the boolean value to inform id DTD was found in the XML file or not
static URL lookupCatalogFiles()
          Seach the path for oasis catalog files.
 InputSource resolveEntity(String publicId, String systemId)
          Tries to resolve the entity using the thread specific catolog resolvers
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CatalogLocation

public CatalogLocation(URL url)
                throws IOException
Create a new CatalogLocation.

Parameters:
url - - the location of the catalog xml file
Throws:
IOException - if the catalog files cannot be loaded
Method Detail

resolveEntity

public InputSource resolveEntity(String publicId,
                                 String systemId)
                          throws MalformedURLException,
                                 IOException
Tries to resolve the entity using the thread specific catolog resolvers

Parameters:
publicId - - Public ID of DTD, or null if it is a schema
systemId - - the system ID of DTD or Schema
Returns:
InputSource of entity
Throws:
MalformedURLException - - if the url is wrong
IOException - - error reading the local file

lookupCatalogFiles

public static URL lookupCatalogFiles()
                              throws IOException
Seach the path for oasis catalog files. The classpath of Thread.currentThread().getContextClassLoader() is used for the lookup.

Returns:
the url where the jax-ws-catalog.xml is located
Throws:
IOException - if the catalog files cannot be loaded

isEntityResolved

public boolean isEntityResolved()
Returns the boolean value to inform id DTD was found in the XML file or not

Returns:
boolean - true if DTD was found in XML

equals

public boolean equals(Object other)
To catalog locations are qual if the location is equal.

Overrides:
equals in class Object
Parameters:
other - - the catlog location to compare
Returns:
true if equal

hashCode

public int hashCode()
Two catalog locations have the same hash code if the location is equal.

Overrides:
hashCode in class Object
Returns:
- the hash code


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.