com.dyuproject.ioc
Class Resource

java.lang.Object
  extended by com.dyuproject.ioc.Resource

public class Resource
extends Object

An arbitrary resource where you can obtain a Reader to read data.

Author:
David Yu
Date created:
Feb 23, 2009

Nested Class Summary
static interface Resource.Resolver
          A Resource resolver that basically allows it to be read via getReader().
 
Constructor Summary
Resource(Reader reader)
           
Resource(String path)
           
Resource(String path, String type)
           
Resource(String path, String type, Reader reader)
           
 
Method Summary
 File getFile()
          Gets the file if any.
 String getPath()
          Gets the path.
 Reader getReader()
          Gets the reader
 org.mortbay.util.ajax.JSON.ReaderSource getSource()
          Gets the reader source that can be used for parsing json.
 String getType()
          Gets the type.
 boolean isResolved()
          Checks if this resource is already resolved.
 void resolve(Reader reader)
          Resolves the resource via setting the reader.
 void resolve(Reader reader, String type)
          Resolves the resource via setting the readerand type.
 void resolve(Reader reader, String type, File file)
          Resolves the resource via setting the reader, type and file.
 void setPath(String path)
          Sets the path.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Resource

public Resource(String path)

Resource

public Resource(String path,
                String type)

Resource

public Resource(String path,
                String type,
                Reader reader)

Resource

public Resource(Reader reader)
Method Detail

getPath

public String getPath()
Gets the path.


setPath

public void setPath(String path)
Sets the path.


getType

public String getType()
Gets the type.


getReader

public Reader getReader()
Gets the reader


getSource

public org.mortbay.util.ajax.JSON.ReaderSource getSource()
Gets the reader source that can be used for parsing json.


getFile

public File getFile()
Gets the file if any.


resolve

public void resolve(Reader reader)
Resolves the resource via setting the reader.


resolve

public void resolve(Reader reader,
                    String type)
Resolves the resource via setting the readerand type.


resolve

public void resolve(Reader reader,
                    String type,
                    File file)
Resolves the resource via setting the reader, type and file.


isResolved

public boolean isResolved()
Checks if this resource is already resolved.



Copyright © 2008-2013. All Rights Reserved.