jaxx.runtime
Class DecoratorUtils

java.lang.Object
  extended by jaxx.runtime.DecoratorUtils

public class DecoratorUtils
extends java.lang.Object

Some usefull methods on Decorator to store and obtain decorators. Use the method registerDecorator(String, Decorator) to register a new decorator. Use the method getDecorator(String) to obtain a registred decorator based on his registred name. Use the method #getDecorator(Class, tring) to obtain a registred decorator based on the type of decorator and the registred name.

Since:
1.3
Author:
tony

Nested Class Summary
static class DecoratorUtils.DecoratorContext<T>
           
 
Field Summary
protected static java.util.List<DecoratorUtils.DecoratorContext<?>> cache
           
 
Constructor Summary
DecoratorUtils()
           
 
Method Summary
static void clear()
           
static
<T> Decorator<T>
getDecorator(java.lang.Class<T> type, java.lang.String context)
           
static
<T> Decorator<T>
getDecorator(java.lang.String context)
           
protected static
<T> DecoratorUtils.DecoratorContext<T>
getDecoratorContext(java.lang.Class<T> type, java.lang.String context)
           
static
<T> void
registerDecorator(java.lang.String context, Decorator<T> decorator)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cache

protected static java.util.List<DecoratorUtils.DecoratorContext<?>> cache
Constructor Detail

DecoratorUtils

public DecoratorUtils()
Method Detail

registerDecorator

public static <T> void registerDecorator(java.lang.String context,
                                         Decorator<T> decorator)

getDecorator

public static <T> Decorator<T> getDecorator(java.lang.String context)

getDecorator

public static <T> Decorator<T> getDecorator(java.lang.Class<T> type,
                                            java.lang.String context)

clear

public static void clear()

getDecoratorContext

protected static <T> DecoratorUtils.DecoratorContext<T> getDecoratorContext(java.lang.Class<T> type,
                                                                            java.lang.String context)


Copyright © 2008-2009 CodeLutin. All Rights Reserved.