jaxx.runtime.decorator
Class DecoratorProvider

java.lang.Object
  extended by jaxx.runtime.decorator.DecoratorProvider

public abstract class DecoratorProvider
extends java.lang.Object

A decorator provider.

Implements the method loadDecorators() to fill the decorators availables.

Then can obtain decorator via the methods getDecorator(...)

User: chemit Date: 28 oct. 2009 Time: 19:40:48


Nested Class Summary
static class DecoratorProvider.DecoratorContext<T>
           
 
Field Summary
protected  java.util.List<DecoratorProvider.DecoratorContext<?>> decorators
          Registred decorators.
 
Constructor Summary
DecoratorProvider()
           
 
Method Summary
 void clear()
           
<O> Decorator<O>
getDecorator(java.lang.Class<O> type)
          Obtain a decorator given a type.
<O> Decorator<O>
getDecorator(java.lang.Class<O> type, java.lang.String name)
          Obtain a decorator given a type and a extra name.
<O> Decorator<O>
getDecorator(O object)
          Obtain a decorator for the given object.
<O> Decorator<O>
getDecorator(O object, java.lang.String name)
          Obtain a decorator given a object and an extra name to qualify the context.
protected
<T> DecoratorProvider.DecoratorContext<T>
getDecoratorContext(java.lang.Class<T> type, java.lang.String context)
           
protected  java.util.List<DecoratorProvider.DecoratorContext<?>> getDecorators()
           
protected abstract  void loadDecorators()
          Load all decorators of the provider
protected  void registerDecorator(Decorator<?> decorator)
           
protected
<T> void
registerDecorator(java.lang.String context, Decorator<T> decorator)
          Register a new decorator in the cache of the provider.
protected  void registerJXPathDecorator(java.lang.Class<?> klass, java.lang.String expression)
           
protected  void registerJXPathDecorator(java.lang.Class<?> klass, java.lang.String name, java.lang.String expression)
           
protected  void registerMultiJXPathDecorator(java.lang.Class<?> klass, java.lang.String expression, java.lang.String separator, java.lang.String separatorReplacement)
           
protected  void registerMultiJXPathDecorator(java.lang.Class<?> klass, java.lang.String name, java.lang.String expression, java.lang.String separator, java.lang.String separatorReplacement)
           
protected  void registerPropertyDecorator(java.lang.Class<?> klass, java.lang.String expression)
           
protected  void registerPropertyDecorator(java.lang.Class<?> klass, java.lang.String name, java.lang.String expression)
           
 void reload()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

decorators

protected java.util.List<DecoratorProvider.DecoratorContext<?>> decorators
Registred decorators.

Constructor Detail

DecoratorProvider

public DecoratorProvider()
Method Detail

loadDecorators

protected abstract void loadDecorators()
Load all decorators of the provider


getDecorator

public <O> Decorator<O> getDecorator(O object)
Obtain a decorator for the given object.

Type Parameters:
O - object of decorated object
Parameters:
object - object of decorated object
Returns:
the decorator or null if not found

getDecorator

public <O> Decorator<O> getDecorator(O object,
                                     java.lang.String name)
Obtain a decorator given a object and an extra name to qualify the context.

Type Parameters:
O - object of decorated object
Parameters:
object - object of decorated object
name - extra name to qualify the decorator to use
Returns:
the decorator or null if not found

getDecorator

public <O> Decorator<O> getDecorator(java.lang.Class<O> type)
Obtain a decorator given a type.

Type Parameters:
O - type of decorated object
Parameters:
type - type of decorated object
Returns:
the decorator or null if not found

getDecorator

public <O> Decorator<O> getDecorator(java.lang.Class<O> type,
                                     java.lang.String name)
Obtain a decorator given a type and a extra name.

Type Parameters:
O - type of decorated object
Parameters:
type - type of decorated object
name - extra name to qualify the decorator to use
Returns:
the decorator or null if not found

reload

public void reload()

clear

public void clear()

registerPropertyDecorator

protected void registerPropertyDecorator(java.lang.Class<?> klass,
                                         java.lang.String expression)

registerJXPathDecorator

protected void registerJXPathDecorator(java.lang.Class<?> klass,
                                       java.lang.String expression)

registerMultiJXPathDecorator

protected void registerMultiJXPathDecorator(java.lang.Class<?> klass,
                                            java.lang.String expression,
                                            java.lang.String separator,
                                            java.lang.String separatorReplacement)

registerPropertyDecorator

protected void registerPropertyDecorator(java.lang.Class<?> klass,
                                         java.lang.String name,
                                         java.lang.String expression)

registerJXPathDecorator

protected void registerJXPathDecorator(java.lang.Class<?> klass,
                                       java.lang.String name,
                                       java.lang.String expression)

registerMultiJXPathDecorator

protected void registerMultiJXPathDecorator(java.lang.Class<?> klass,
                                            java.lang.String name,
                                            java.lang.String expression,
                                            java.lang.String separator,
                                            java.lang.String separatorReplacement)

registerDecorator

protected void registerDecorator(Decorator<?> decorator)

registerDecorator

protected <T> void registerDecorator(java.lang.String context,
                                     Decorator<T> decorator)
Register a new decorator in the cache of the provider.

Type Parameters:
T - type of data decorated
Parameters:
context - the name decorator
decorator - the decorator to register

getDecorators

protected java.util.List<DecoratorProvider.DecoratorContext<?>> getDecorators()

getDecoratorContext

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


Copyright © 2008-2010 CodeLutin. All Rights Reserved.