com.dyuproject.ioc
Class URLResolver

java.lang.Object
  extended by com.dyuproject.ioc.AbstractResolver
      extended by com.dyuproject.ioc.URLResolver
All Implemented Interfaces:
Resource.Resolver

public final class URLResolver
extends AbstractResolver

A resolver that resolves a resource by opening the stream to the URL.

Author:
David Yu
Date created:
Feb 23, 2009

Field Summary
static URLResolver DEFAULT
          The default instance.
static String TYPE
          The type of this resolver.
 
Fields inherited from class com.dyuproject.ioc.AbstractResolver
_bufferSize, _encoding, DEFAULT_BUFFER_SIZE, DEFAULT_ENCODING
 
Constructor Summary
URLResolver()
           
 
Method Summary
 Resource createResource(String path)
          Creates a resource from a given path string.
 Resource createResource(URL url)
          Creates a resource from a given url.
static URLResolver getDefault()
          Gets the default instance.
 String getType()
          Gets the type (id) of resolver
 void resolve(Resource resource, Context context)
          Resolves a resource by setting the Reader property of the Resource.
 
Methods inherited from class com.dyuproject.ioc.AbstractResolver
generateTypeFromClass, getBufferSize, getEncoding, newReader
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE

public static final String TYPE
The type of this resolver. ("url")


DEFAULT

public static final URLResolver DEFAULT
The default instance.

Constructor Detail

URLResolver

public URLResolver()
Method Detail

getDefault

public static URLResolver getDefault()
Gets the default instance.


getType

public String getType()
Description copied from interface: Resource.Resolver
Gets the type (id) of resolver


resolve

public void resolve(Resource resource,
                    Context context)
             throws IOException
Description copied from interface: Resource.Resolver
Resolves a resource by setting the Reader property of the Resource. That is done via Resource.resolve(Reader).

Throws:
IOException

createResource

public Resource createResource(String path)
                        throws IOException
Description copied from interface: Resource.Resolver
Creates a resource from a given path string.

Throws:
IOException

createResource

public Resource createResource(URL url)
                        throws IOException
Creates a resource from a given url.

Throws:
IOException


Copyright © 2008-2013. All Rights Reserved.