Log4j 1.1

pl.psnc.expres.model.factory
Class ResourceTypeFactory

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

public class ResourceTypeFactory
extends java.lang.Object

ResourceTypeFactory class - the Type Factory is used to get the list of resource types. The type component describes the resource type name, id and icons

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

Constructor Summary
ResourceTypeFactory()
           
 
Method Summary
static java.lang.ClassLoader getClassLoader()
          Get value of field: classLoader
static ResourceType getResourceType(int id)
          Get the resource type by the given id.
static ResourceType getResourceType(int id, java.io.InputStream inStream)
          Get the resource type by the given id
static ResourceType getResourceType(int id, java.lang.String filePath)
          Get the resource type by the given id
static java.util.List<ResourceType> getTypes(java.io.InputStream inStream)
          Load a resource types from the given source
static java.util.List<ResourceType> getTypes(java.lang.String filePath)
          Load a resource types from the given source
static void setClassLoader(java.lang.ClassLoader classLoader)
          Set value of field: classLoader
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceTypeFactory

public ResourceTypeFactory()
Method Detail

getResourceType

public static ResourceType getResourceType(int id)
                                    throws pl.psnc.vlab.exception.ResourceNotFoundException
Get the resource type by the given id. Resource types are loaded from default location - ModelKeys.Type_LOCATION

Parameters:
id - type identifier
Returns:
resource type by the given id
Throws:
pl.psnc.vlab.exception.ResourceNotFoundException - thrown when resource type cannot be found

getResourceType

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

Parameters:
id - type identifier
filePath - path to the source file
Returns:
type for the given id or ResourceNotFoundException
Throws:
pl.psnc.vlab.exception.ResourceNotFoundException - thrown when resource type cannot be found

getResourceType

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

Parameters:
id - type identifier
inStream - path to the source file
Returns:
type for the given id or ResourceNotFoundException
Throws:
pl.psnc.vlab.exception.ResourceNotFoundException - thrown when resource type cannot be found

getTypes

public static java.util.List<ResourceType> getTypes(java.lang.String filePath)
                                             throws pl.psnc.vlab.exception.ResourceNotFoundException
Load a resource types from the given source

Parameters:
filePath - path to the resource file
Returns:
resource types from the given source
Throws:
pl.psnc.vlab.exception.ResourceNotFoundException - thrown when method fails

getTypes

public static java.util.List<ResourceType> getTypes(java.io.InputStream inStream)
                                             throws pl.psnc.vlab.exception.ResourceNotFoundException
Load a resource types from the given source

Parameters:
filePath - path to the resource file
Returns:
resource types from the given source
Throws:
pl.psnc.vlab.exception.ResourceNotFoundException - thrown when method fails

getClassLoader

public static java.lang.ClassLoader getClassLoader()
Get value of field: classLoader

Returns:
the classLoader

setClassLoader

public static void setClassLoader(java.lang.ClassLoader classLoader)
Set value of field: classLoader

Parameters:
classLoader - the classLoader to set

Log4j 1.1

Copyright 2007-2008 by VLAB