org.jibx.schema
Class UrlResolver

java.lang.Object
  extended by org.jibx.schema.UrlResolver
All Implemented Interfaces:
ISchemaResolver

public class UrlResolver
extends Object
implements ISchemaResolver

Basic resolver supporting relative URL paths.

Author:
Dennis M. Sosnoski

Constructor Summary
UrlResolver(String path, URL url)
          Constructor.
 
Method Summary
 boolean equals(Object obj)
           
 InputStream getContent()
          Get the content associated with this schema document.
 String getId()
          Get unique identifier for this schema.
 String getName()
          Get the schema name.
 URL getUrl()
          Get the document URL.
 int hashCode()
           
 ISchemaResolver resolve(String loc, String tns)
          Resolve a schema reference, which may be relative to this schema location.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UrlResolver

public UrlResolver(String path,
                   URL url)
Constructor. This converts paths to a standard form by eliminating "./" and "../" relative path components.

Parameters:
path -
url -
Method Detail

getContent

public InputStream getContent()
                       throws IOException
Description copied from interface: ISchemaResolver
Get the content associated with this schema document.

Specified by:
getContent in interface ISchemaResolver
Returns:
input stream
Throws:
IOException - on access error

getName

public String getName()
Description copied from interface: ISchemaResolver
Get the schema name.

Specified by:
getName in interface ISchemaResolver
Returns:
name

getId

public String getId()
Description copied from interface: ISchemaResolver
Get unique identifier for this schema.

Specified by:
getId in interface ISchemaResolver
Returns:
identifier

resolve

public ISchemaResolver resolve(String loc,
                               String tns)
                        throws IOException
Description copied from interface: ISchemaResolver
Resolve a schema reference, which may be relative to this schema location. If a schema location is provided in the call that location should be used to identify the schema; the target namespace should only be used when the schema location is implicit.

Specified by:
resolve in interface ISchemaResolver
Parameters:
loc - target URL (null if none supplied)
tns - target namespace URI (null if none supplied)
Returns:
resolver for target
Throws:
IOException - on resolve error

getUrl

public URL getUrl()
Get the document URL.

Returns:
url

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2005-2012 jibx.org. All Rights Reserved.