org.eclipse.wst.common.environment.uri
Class SimpleURIFactory

java.lang.Object
  extended by org.eclipse.wst.common.environment.uri.SimpleURIFactory
All Implemented Interfaces:
IURIFactory

public class SimpleURIFactory
extends java.lang.Object
implements IURIFactory

This class provides a default implementation of the IURIFactory interface.

Since:
1.0

Constructor Summary
SimpleURIFactory()
           
 
Method Summary
 IURI newURI(java.lang.String uri)
          Creates and returns a new IURI for the given string.
 IURI newURI(java.net.URL url)
          Creates and returns a new IURI for the given URL.
 IURIScheme newURIScheme(java.lang.String schemeOrURI)
          Creates and returns a new IURIScheme for the given scheme string.
 void registerScheme(java.lang.String protocol, IURIScheme scheme)
          This method registers a scheme for a particular protocol.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleURIFactory

public SimpleURIFactory()
Method Detail

newURI

public IURI newURI(java.lang.String uri)
            throws URIException
Description copied from interface: IURIFactory
Creates and returns a new IURI for the given string.

Specified by:
newURI in interface IURIFactory
Parameters:
uri - the uri to be created.
Returns:
Creates and returns a new IURI for the given string.
Throws:
URIException - if an error occurs creating this URI.

newURI

public IURI newURI(java.net.URL url)
            throws URIException
Description copied from interface: IURIFactory
Creates and returns a new IURI for the given URL.

Specified by:
newURI in interface IURIFactory
Parameters:
url - the url to use to create this uri.
Returns:
Creates and returns a new IURI for the given URL.
Throws:
URIException - if an error occurs creating this URI.

newURIScheme

public IURIScheme newURIScheme(java.lang.String schemeOrURI)
                        throws URIException
Description copied from interface: IURIFactory
Creates and returns a new IURIScheme for the given scheme string. If the string contains no colons, the entire string is interpretted as the name of the scheme. If the string contains a colon, then the substring up to but excluding the first colon is interpretted as the name of the scheme, meaning the caller can pass in any IURI string in order to get a IURIScheme object.

Specified by:
newURIScheme in interface IURIFactory
Parameters:
schemeOrURI - the scheme name or URI from which this scheme is to be created.
Returns:
Creates and returns a new IURIScheme for the given scheme string. If the string contains no colons, the entire string is interpretted as the name of the scheme. If the string contains a colon, then the substring up to but excluding the first colon is interpretted as the name of the scheme, meaning the caller can pass in any IURI string in order to get a IURIScheme object.
Throws:
URIException - if an error occurs creating this URI scheme.

registerScheme

public void registerScheme(java.lang.String protocol,
                           IURIScheme scheme)
This method registers a scheme for a particular protocol.

Parameters:
protocol - the protocol.
scheme - the scheme.