Log4j 1.1

pl.psnc.expres.model.factory
Class ResourceFactory

java.lang.Object
  extended by pl.psnc.expres.model.factory.ResourceFactory

public class ResourceFactory
extends java.lang.Object

ResourceFactory class - factory is used to get a list of resource.

Author:
Dominik Stoklosa (~osa~)
Email address
osa@man.poznan.pl

Constructor Summary
ResourceFactory()
           
 
Method Summary
protected static ResourceValue getResource(int id)
          Get the resource by the given id
static ResourceValue getResource(int id, java.io.InputStream inStream)
          Get the resource by the given id
static ResourceValue getResource(int id, java.lang.String filePath)
          Get the resource by the given id
static ResourceValue getResource(java.lang.String abbreviation, java.io.InputStream resourceIn)
          Get the resource by the given id
static ResourceValue getResource(java.lang.String abbreviation, java.lang.String filePath)
          Get the resource by the given id
static java.util.List<ResourceValue> getResources()
          Get the resource list from default location defined by ModelKeys.RESOURCE_LOCATION
static java.util.List<ResourceValue> getResources(java.io.InputStream inStream)
          Get the resource list
static java.util.List<ResourceValue> getResources(java.lang.String filePath)
          Get the resource list
static java.util.List<ResourceValue> getResourcesFromString(java.lang.String resourceAsString)
          Get the resource list from string
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceFactory

public ResourceFactory()
Method Detail

getResource

protected static ResourceValue getResource(int id)
                                    throws pl.psnc.vlab.exception.ResourceNotFoundException
Get the resource by the given id

Parameters:
id - resource id
Returns:
resource value object
Throws:
pl.psnc.vlab.exception.ResourceNotFoundException

getResource

public static ResourceValue getResource(int id,
                                        java.lang.String filePath)
                                 throws pl.psnc.vlab.exception.ResourceNotFoundException
Get the resource by the given id

Parameters:
id - resource id
filePath - path to a Json file with resource description
Returns:
resource value object
Throws:
pl.psnc.vlab.exception.ResourceNotFoundException

getResource

public static ResourceValue getResource(int id,
                                        java.io.InputStream inStream)
                                 throws pl.psnc.vlab.exception.ResourceNotFoundException
Get the resource by the given id

Parameters:
id - resource id
inStream - path to a Json file with resource description
Returns:
resource value object
Throws:
pl.psnc.vlab.exception.ResourceNotFoundException

getResource

public static ResourceValue getResource(java.lang.String abbreviation,
                                        java.lang.String filePath)
                                 throws pl.psnc.vlab.exception.ResourceNotFoundException
Get the resource by the given id

Parameters:
abbreviation - resource abbreviation
filePath - path to a Json file with resource description
Returns:
resource value object
Throws:
pl.psnc.vlab.exception.ResourceNotFoundException

getResource

public static ResourceValue getResource(java.lang.String abbreviation,
                                        java.io.InputStream resourceIn)
                                 throws pl.psnc.vlab.exception.ResourceNotFoundException
Get the resource by the given id

Parameters:
abbreviation - resource abbreviation
filePath - path to a Json file with resource description
Returns:
resource value object
Throws:
pl.psnc.vlab.exception.ResourceNotFoundException

getResources

public static java.util.List<ResourceValue> getResources(java.lang.String filePath)
                                                  throws pl.psnc.vlab.exception.ResourceNotFoundException
Get the resource list

Parameters:
filePath - path to a Json file with resource description
Returns:
resource ResourceValues array
Throws:
pl.psnc.vlab.exception.ResourceNotFoundException

getResourcesFromString

public static java.util.List<ResourceValue> getResourcesFromString(java.lang.String resourceAsString)
                                                            throws pl.psnc.vlab.exception.ResourceNotFoundException
Get the resource list from string

Parameters:
resourceAsString - resource text representation
Returns:
resource ResourceValues array
Throws:
pl.psnc.vlab.exception.ResourceNotFoundException

getResources

public static java.util.List<ResourceValue> getResources(java.io.InputStream inStream)
                                                  throws pl.psnc.vlab.exception.ResourceNotFoundException
Get the resource list

Parameters:
inStream - input stream with resource description (Json format)
Returns:
resource ResourceValues array
Throws:
pl.psnc.vlab.exception.ResourceNotFoundException

getResources

public static java.util.List<ResourceValue> getResources()
                                                  throws pl.psnc.vlab.exception.ResourceNotFoundException
Get the resource list from default location defined by ModelKeys.RESOURCE_LOCATION

Parameters:
filePath - path to a Json file with resource description
Returns:
resource ResourceValues array
Throws:
pl.psnc.vlab.exception.ResourceNotFoundException

Log4j 1.1

Copyright 2007-2008 by VLAB