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

ProcessingContextImpl

public class ProcessingContextImpl extends Object implements ProcessingContext
Minimal implementation of the ProcessingContext interface
author
Jerome ochez

Fields Summary
protected AnnotationProcessor
processor
protected Stack
handlers
protected Scanner
scanner
private ErrorHandler
errorHandler
Constructors Summary
ProcessingContextImpl(AnnotationProcessor processor)
Creates a new instance of ProcessingContextHelper

    
           
      
        this.processor = processor;
    
Methods Summary
public ErrorHandlergetErrorHandler()

return
the error handler for this processing context.

        return errorHandler;
    
public AnnotatedElementHandlergetHandler()

        if (handlers.isEmpty()) 
            return null;
        
        return handlers.peek();
    
public UgetHandler(java.lang.Class contextType)

return
the previously set ClientContext casted to the requestd type if possible or throw an exception otherwise.

        
        if (handlers.isEmpty()) 
            return null;
        if (AnnotationUtils.shouldLog("handler")) {
            AnnotationUtils.getLogger().finer("Top handler is " + handlers.peek());
        }
        return contextType.cast(handlers.peek());
    
public ScannergetProcessingInput()

        return scanner;
    
public AnnotationProcessorgetProcessor()

        return processor;
    
public AnnotatedElementHandlerpopHandler()

        if (handlers.isEmpty()) 
            return null;
        
        return handlers.pop();
    
public voidpushHandler(AnnotatedElementHandler handler)

        if (handler instanceof AnnotationContext) {
            ((AnnotationContext) handler).setProcessingContext(this);
        }
        handlers.push(handler);
    
public voidsetErrorHandler(ErrorHandler errorHandler)
Sets the error handler for this processing context.

    
                  
        
        this.errorHandler = errorHandler;
    
public voidsetProcessingInput(Scanner scanner)

        this.scanner = scanner;