pl.edu.agh.cast.rawdata.stat
Class ErrorRegistry

java.lang.Object
  extended by pl.edu.agh.cast.rawdata.stat.ErrorRegistry

public final class ErrorRegistry
extends Object

Registry for raw data errors. All errors handlers should use this class to fetch appropriate error types.

Author:
AGH CAST Team

Method Summary
 boolean containsErrorCode(Integer code)
          Checks if registry contains an error by given code.
 ErrorType get(Integer code)
          Gets error type by given error code.
 Collection<ErrorType> getAll()
          Returns all error types.
static ErrorRegistry getInstance()
           
 void register(ErrorType err)
          Registers a given error type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static ErrorRegistry getInstance()

register

public void register(ErrorType err)
              throws ErrorAlreadyExistsException
Registers a given error type.

Parameters:
err - error type to register
Throws:
ErrorAlreadyExistsException - when error to register already exists in registry

containsErrorCode

public boolean containsErrorCode(Integer code)
Checks if registry contains an error by given code.

Parameters:
code - error code
Returns:
true if error exists in registry, false otherwise

get

public ErrorType get(Integer code)
Gets error type by given error code.

Parameters:
code - error code
Returns:
error type with given code, null if there is no error with the code

getAll

public Collection<ErrorType> getAll()
Returns all error types.

Returns:
all error types.


Copyright © 2007-2009 IISG AGH-UST Krakow, Poland. All Rights Reserved.