Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.puppycrawl.tools.checkstyle.checks.indentation
Class HandlerFactory  view HandlerFactory download HandlerFactory.java

java.lang.Object
  extended bycom.puppycrawl.tools.checkstyle.checks.indentation.HandlerFactory

public class HandlerFactory
extends java.lang.Object

Factory for handlers. Looks up constructor via reflection.


Field Summary
private static org.apache.commons.logging.Log LOG
          Logger for indentation check
private  java.util.Map mCreatedHandlers
          cache for created method call handlers
private  java.util.Map mTypeHandlers
          Registered handlers.
 
Constructor Summary
HandlerFactory()
          Creates a HandlerFactory.
 
Method Summary
(package private)  void clearCreatedHandlers()
          Clears cache of created handlers.
(package private)  ExpressionHandler createMethodCallHandler(IndentationCheck aIndentCheck, com.puppycrawl.tools.checkstyle.api.DetailAST aAst, ExpressionHandler aParent)
          Create new instance of handler for METHOD_CALL.
 int[] getHandledTypes()
          Gets list of registered handler types.
 ExpressionHandler getHandler(IndentationCheck aIndentCheck, com.puppycrawl.tools.checkstyle.api.DetailAST aAst, ExpressionHandler aParent)
          Get the handler for an AST.
 boolean isHandledType(int aType)
          Returns true if this type (form TokenTypes) is handled.
private  void register(int aType, java.lang.Class aHandlerClass)
          registers a handler
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

private static final org.apache.commons.logging.Log LOG
Logger for indentation check


mTypeHandlers

private java.util.Map mTypeHandlers
Registered handlers.


mCreatedHandlers

private java.util.Map mCreatedHandlers
cache for created method call handlers

Constructor Detail

HandlerFactory

public HandlerFactory()
Creates a HandlerFactory.

Method Detail

register

private void register(int aType,
                      java.lang.Class aHandlerClass)
registers a handler


isHandledType

public boolean isHandledType(int aType)
Returns true if this type (form TokenTypes) is handled.


getHandledTypes

public int[] getHandledTypes()
Gets list of registered handler types.


getHandler

public ExpressionHandler getHandler(IndentationCheck aIndentCheck,
                                    com.puppycrawl.tools.checkstyle.api.DetailAST aAst,
                                    ExpressionHandler aParent)
Get the handler for an AST.


createMethodCallHandler

ExpressionHandler createMethodCallHandler(IndentationCheck aIndentCheck,
                                          com.puppycrawl.tools.checkstyle.api.DetailAST aAst,
                                          ExpressionHandler aParent)
Create new instance of handler for METHOD_CALL.


clearCreatedHandlers

void clearCreatedHandlers()
Clears cache of created handlers.