FileDocCategorySizeDatePackage
DefaultErrorHandler.javaAPI DocGlassfish v2 API5117Fri May 04 22:30:22 BST 2007com.sun.enterprise.deployment.annotation.impl

DefaultErrorHandler

public class DefaultErrorHandler extends Object implements com.sun.enterprise.deployment.annotation.ErrorHandler
Default implementation of the ErrorHandler
author
Jerome Dochez

Fields Summary
Logger
logger
Constructors Summary
public DefaultErrorHandler()
Creates a new ErrorHandler with the default logger

        logger = AnnotationUtils.getLogger();
    
public DefaultErrorHandler(Logger logger)
Creates a new ErrorHandler with the provided looger;

        this.logger = logger;
    
Methods Summary
public voiderror(com.sun.enterprise.deployment.annotation.AnnotationProcessorException ape)
Receive notification of an error

param
ape The error information
throws
amy exception to stop the annotation processing

        
        AnnotationInfo info = ape.getLocator();
        if (info==null){
            logger.severe(ape.getMessage());
        } else{
            logger.severe(AnnotationUtils.getLocalString(
                "enterprise.deployment.annotation.error",
                "{2}\n symbol: {0} location: {1}\n\n",
                new Object[] { info.getElementType(), info.getAnnotatedElement(), ape.getMessage()}));            
        }
    
public voidfine(com.sun.enterprise.deployment.annotation.AnnotationProcessorException ape)
Receive notication of a fine error message

param
ape The warning information
throws
any exception to stop the annotation processing

        
        if (logger.isLoggable(Level.FINE)){
            AnnotationInfo info = ape.getLocator();
            if (info==null){
                logger.fine(ape.getMessage());
            } else{
                logger.fine(AnnotationUtils.getLocalString(
                    "enterprise.deployment.annotation.error",
                    "{2}\n symbol: {0}\n location: {1}\n\n",
                    new Object[] { info.getElementType(), info.getAnnotatedElement(), ape.getMessage()}));            
            }
        }
        
    
public voidwarning(com.sun.enterprise.deployment.annotation.AnnotationProcessorException ape)
Receive notification of a warning

param
ape The warning information
throws
any exception to stop the annotation processing

        
        if (logger.isLoggable(Level.WARNING)){
            AnnotationInfo info = ape.getLocator();
            if (info==null){
                logger.warning(ape.getMessage());
            } else{
                logger.warning(AnnotationUtils.getLocalString(
                    "enterprise.deployment.annotation.error",
                    "{2}\n symbol: {0}\n location: {1}\n\n",
                    new Object[] { info.getElementType(), info.getAnnotatedElement(), ape.getMessage()}));            
            }
        }