com.dyuproject.ioc
Class FileResolver

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

public class FileResolver
extends AbstractResolver

A resolver that resolves a resource by from the filesystem.

Author:
David Yu
Date created:
Feb 23, 2009

Field Summary
static FileResolver DEFAULT
           
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
FileResolver()
           
 
Method Summary
 Resource createResource(File file)
          Creates a resource from a given file.
 Resource createResource(String path)
          Creates a resource from a given path string.
static FileResolver 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. ("file")


DEFAULT

public static final FileResolver DEFAULT
Constructor Detail

FileResolver

public FileResolver()
Method Detail

getDefault

public static FileResolver 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(File file)
                        throws IOException
Creates a resource from a given file.

Throws:
IOException


Copyright © 2008-2013. All Rights Reserved.