it.avutils.jmapper.config
Class Error

java.lang.Object
  extended by it.avutils.jmapper.config.Error

public final class Error
extends Object

This Class exposes all common methods to handle technical errors.
The scope is to centralize the management of exceptions and make the code more readable.
The constants used are the keys of the "jmapper.msg.properties" file present in this package.

Author:
Alessandro Vurro

Constructor Summary
Error()
           
 
Method Summary
static void absentRelationship(Class<?> configuredClass, Class<?> targetClass)
          Thrown when there isn't correspondence between classes.
static void attributeAbsent(Class<?> aClass, Attribute aField)
          Thrown if the attribute doesn't exist in aClass.
static void attributeInexistent(String attributeName, Class<?> aClass)
          Thrown if attributes isn't present in the xml file.
static void bodyContainsIllegalCode(Method method, Exception additionalInformation)
          Thrown when the code contained in the body method is illegal.
static void classesAbsent(String fieldName, Class<?> aClass)
          Thrown if the configured field hasn't classes parameter.
static void classesNotConfigured(Class<?> destination, Class<?> source)
          Thrown when the xml configuration doesn't exist.
static void classInexistent(String aClass)
          Thrown if class is present in the xml configuration file but doesn't exist.
static void classNotConfigured(Class<?> clazz)
          Thrown when the xml configuration of the clazz doesn't exist.
static void classNotMapped(Class<?> aClass)
          Thrown if the class isn't mapped.
static void classNotMapped(Object sourceClass, Class<?> configuredClass)
          Thrown if the sourceClass isn't mapped in configuredClass.
static void configNotPresent(Class<?> destination, Class<?> source, XML xml)
          Thrown when the xml configuration doesn't contains the classes configuration.
static void configNotPresent(Class<?> clazz, XML xml)
          Thrown when missing the configuration belonging to clazz.
static void emptyConstructorAbsent(Class<?> aClass)
          Thrown if the class haven't an empty constructor.
static void fileNotFound()
          Thrown when the file isn't found.
static void fileNotFound(String path)
          Thrown when the file isn't found.
static void illegalCode(Class<?> destination, Class<?> source, String path, Throwable e)
          Thrown when there is an error in mapper generated class.
static void illegalCode(Class<?> destination, Class<?> source, Throwable e)
          Thrown when there is an error in mapper generated class.
static void illegalCode(Exception e, String methodName, String className)
          Thrown when the explicit conversion method defined has a null pointer.
static void illegalCode(Exception e, String methodName, String className, String path)
          Thrown when the explicit conversion method defined has a null pointer.
static void improperUseOfTheParameter(String conversionName, String xmlPath, String className)
          Thrown if the use of the parameters is incorrect.
static void incorrectBodyDefinition(String methodName, String className)
          Thrown when the body method don't respects the convetions beloging to the dynamic conversion implementation.
static void incorrectMethodDefinition(String methodName, String className)
          Thrown when the method don't respects the convetions beloging to the dynamic conversion implementation.
static void interfaceClass(String className)
          Thrown if the class is an interface.
static void mapping(String mappedFieldName, Class<?> mappedClass, Class<?> targetClass)
          Thrown when there is an error in the configuration.
static void mapping(String mappedFieldName, String mappedClassName)
          Thrown when the length of classes and attribute parameter isn't the same.
static void mapping(String mappedFieldName, String mappedClassName, String targetClassName)
          Thrown when the target class doesn't exist in classes parameter.
static void mapping(String mappedFieldName, String mappedClassName, String targetFieldName, String targetClassName)
          Thrown when the target field doesn't exist.
static void method(String methodName, String fieldName, Class<?> clazz)
          Thrown when the bean doesn't respect the javabean conventions.
static void notFoundException(Exception e)
          Thrown when javassist don't find classes.
static void nullMappedClass(String className)
          Thrown if the class is null.
static void parametersUsageNotAllowed(String methodName, String className)
          Thrown when the parameters number is incorrect.
static void unableLoadingFile()
          Thrown when the file can't be loaded.
static void undefinedMapping(Field destinationField, Class<?> destinationClass, Field sourceField, Class<?> sourceClass)
          Thrown when the instruction isn't defined.
static void wrongParameterNumber(String methodName, String className)
          Thrown when the parameters number is incorrect.
static void xmlAttributeExistent(String path, Attribute attribute, Class<?> aClass)
          Thrown if attribute is present in the xml file.
static void xmlAttributeInexistent(String path, String attributeName, Class<?> aClass)
          Thrown if attribute is present in the xml file.
static void xmlClassExistent(String path, Class<?> aClass)
          Thrown if class is present in xml file.
static void xmlClassInexistent(String path, Class<?> aClass)
          Thrown if class isn't present in xml file.
static void xmlConversionNameUndefined(String xmlPath, String className)
          Thrown when the conversion name is undefined.
static void xmlConversionTypeIncorrect(String conversionName, String xmlPath, String className, String type)
          Thrown if conversion type is wrong.
static void xmlWrongMethod(Class<?> aClass)
          Thrown when the class has only one attribute.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Error

public Error()
Method Detail

illegalCode

public static void illegalCode(Exception e,
                               String methodName,
                               String className)
Thrown when the explicit conversion method defined has a null pointer.

Parameters:
className - class name

illegalCode

public static void illegalCode(Exception e,
                               String methodName,
                               String className,
                               String path)
Thrown when the explicit conversion method defined has a null pointer.

Parameters:
className - class name
path - xml path file

bodyContainsIllegalCode

public static void bodyContainsIllegalCode(Method method,
                                           Exception additionalInformation)
Thrown when the code contained in the body method is illegal.

Parameters:
method - method to adjust
additionalInformation - additional information relative to the javassist exception

notFoundException

public static void notFoundException(Exception e)
Thrown when javassist don't find classes.

Parameters:
e - exception to handle

wrongParameterNumber

public static void wrongParameterNumber(String methodName,
                                        String className)
Thrown when the parameters number is incorrect.

Parameters:
methodName - method name
className - class name

parametersUsageNotAllowed

public static void parametersUsageNotAllowed(String methodName,
                                             String className)
Thrown when the parameters number is incorrect.

Parameters:
methodName - method name
className - class name

incorrectMethodDefinition

public static void incorrectMethodDefinition(String methodName,
                                             String className)
Thrown when the method don't respects the convetions beloging to the dynamic conversion implementation.

Parameters:
methodName - method name
className - class name

incorrectBodyDefinition

public static void incorrectBodyDefinition(String methodName,
                                           String className)
Thrown when the body method don't respects the convetions beloging to the dynamic conversion implementation.

Parameters:
methodName - method name
className - class name

classInexistent

public static void classInexistent(String aClass)
Thrown if class is present in the xml configuration file but doesn't exist.

Parameters:
aClass - Class analyzed

attributeInexistent

public static void attributeInexistent(String attributeName,
                                       Class<?> aClass)
Thrown if attributes isn't present in the xml file.

Parameters:
attributeName - attribute name
aClass - class analyzed

xmlWrongMethod

public static void xmlWrongMethod(Class<?> aClass)
Thrown when the class has only one attribute.

Parameters:
aClass - class analyzed

xmlAttributeInexistent

public static void xmlAttributeInexistent(String path,
                                          String attributeName,
                                          Class<?> aClass)
Thrown if attribute is present in the xml file.

Parameters:
path - xml path
attributeName - attribute present
aClass - attribute's class

xmlAttributeExistent

public static void xmlAttributeExistent(String path,
                                        Attribute attribute,
                                        Class<?> aClass)
Thrown if attribute is present in the xml file.

Parameters:
path - xml path
attribute - attribute present
aClass - attribute's class

xmlClassInexistent

public static void xmlClassInexistent(String path,
                                      Class<?> aClass)
Thrown if class isn't present in xml file.

Parameters:
path - xml path
aClass - Class analyzed

xmlClassExistent

public static void xmlClassExistent(String path,
                                    Class<?> aClass)
Thrown if class is present in xml file.

Parameters:
aClass - Class analyzed

xmlConversionNameUndefined

public static void xmlConversionNameUndefined(String xmlPath,
                                              String className)
Thrown when the conversion name is undefined.

Parameters:
xmlPath - xml path
className - class name

xmlConversionTypeIncorrect

public static void xmlConversionTypeIncorrect(String conversionName,
                                              String xmlPath,
                                              String className,
                                              String type)
Thrown if conversion type is wrong.

Parameters:
conversionName - conversion name
xmlPath - xml path
className - class name
type - type

improperUseOfTheParameter

public static void improperUseOfTheParameter(String conversionName,
                                             String xmlPath,
                                             String className)
Thrown if the use of the parameters is incorrect.

Parameters:
conversionName - conversion name
xmlPath - xml path
className - class name

unableLoadingFile

public static void unableLoadingFile()
                              throws LoadingFileException
Thrown when the file can't be loaded.

Throws:
LoadingFileException

fileNotFound

public static void fileNotFound()
                         throws FileNotFoundException
Thrown when the file isn't found.

Throws:
FileNotFoundException

fileNotFound

public static void fileNotFound(String path)
                         throws FileNotFoundException
Thrown when the file isn't found.

Throws:
FileNotFoundException

undefinedMapping

public static void undefinedMapping(Field destinationField,
                                    Class<?> destinationClass,
                                    Field sourceField,
                                    Class<?> sourceClass)
Thrown when the instruction isn't defined.

Parameters:
destinationField - destination field
destinationClass - destination class
sourceField - source field
sourceClass - source class

method

public static void method(String methodName,
                          String fieldName,
                          Class<?> clazz)
Thrown when the bean doesn't respect the javabean conventions.

Parameters:
methodName - name of the method doesn't exist
fieldName - name of the field analyze
clazz - class when this method isn't present

mapping

public static void mapping(String mappedFieldName,
                           Class<?> mappedClass,
                           Class<?> targetClass)
Thrown when there is an error in the configuration.

Parameters:
mappedFieldName - name of the mapped field
mappedClass - mapped field's class
targetClass - target field's class

mapping

public static void mapping(String mappedFieldName,
                           String mappedClassName)
Thrown when the length of classes and attribute parameter isn't the same.

Parameters:
mappedFieldName - name of the mapped field
mappedClassName - name of the mapped field's class

mapping

public static void mapping(String mappedFieldName,
                           String mappedClassName,
                           String targetClassName)
Thrown when the target class doesn't exist in classes parameter.

Parameters:
mappedFieldName - name of the mapped field
mappedClassName - name of the mapped field's class
targetClassName - name of the target field's class

mapping

public static void mapping(String mappedFieldName,
                           String mappedClassName,
                           String targetFieldName,
                           String targetClassName)
Thrown when the target field doesn't exist.

Parameters:
mappedFieldName - name of the mapped field
mappedClassName - name of the mapped field's class
targetFieldName - name of the target field
targetClassName - name of the target field's class

attributeAbsent

public static void attributeAbsent(Class<?> aClass,
                                   Attribute aField)
Thrown if the attribute doesn't exist in aClass.

Parameters:
aClass - class that not contains aField
aField - the missing field

configNotPresent

public static void configNotPresent(Class<?> destination,
                                    Class<?> source,
                                    XML xml)
Thrown when the xml configuration doesn't contains the classes configuration.

Parameters:
destination - destination class name
source - source class name
xml - xml path

configNotPresent

public static void configNotPresent(Class<?> clazz,
                                    XML xml)
Thrown when missing the configuration belonging to clazz.

Parameters:
clazz - class without configuration
xml - xml path

classesNotConfigured

public static void classesNotConfigured(Class<?> destination,
                                        Class<?> source)
Thrown when the xml configuration doesn't exist.

Parameters:
destination - destination class name
source - source class name

classNotConfigured

public static void classNotConfigured(Class<?> clazz)
Thrown when the xml configuration of the clazz doesn't exist.

Parameters:
clazz - class to check

classesAbsent

public static void classesAbsent(String fieldName,
                                 Class<?> aClass)
Thrown if the configured field hasn't classes parameter.

Parameters:
fieldName - name of the field
aClass - class's field

classNotMapped

public static void classNotMapped(Class<?> aClass)
Thrown if the class isn't mapped.

Parameters:
aClass - class to analyze

classNotMapped

public static void classNotMapped(Object sourceClass,
                                  Class<?> configuredClass)
Thrown if the sourceClass isn't mapped in configuredClass.

Parameters:
sourceClass - class absent
configuredClass - class that not contains sourceClass

illegalCode

public static void illegalCode(Class<?> destination,
                               Class<?> source,
                               String path,
                               Throwable e)
Thrown when there is an error in mapper generated class.

Parameters:
destination - destination class
source - source class
path - xml path configuration
e - exception captured

illegalCode

public static void illegalCode(Class<?> destination,
                               Class<?> source,
                               Throwable e)
Thrown when there is an error in mapper generated class.

Parameters:
destination - destination class
source - source class
e - exception captured

absentRelationship

public static void absentRelationship(Class<?> configuredClass,
                                      Class<?> targetClass)
Thrown when there isn't correspondence between classes.

Parameters:
configuredClass - configured class
targetClass - target class

nullMappedClass

public static void nullMappedClass(String className)
Thrown if the class is null.

Parameters:
className - name of the class

interfaceClass

public static void interfaceClass(String className)
Thrown if the class is an interface.

Parameters:
className - name of the class

emptyConstructorAbsent

public static void emptyConstructorAbsent(Class<?> aClass)
Thrown if the class haven't an empty constructor.

Parameters:
aClass - class to analyze


Copyright © 2013. All Rights Reserved.