it.haefelinger.flaka.el
Class Resolver

java.lang.Object
  extended by javax.el.ELResolver
      extended by it.haefelinger.flaka.el.Resolver

public class Resolver
extends ELResolver

The main resolver. This resolver handles top-level entities (like the implicit object project). If the base is not null however, then resolution will be delegated to an underlying composite resolver. A special resolver exists which handles the resolution on properties on a object of Ant related entities like Project, Task, Target etc. See .

Author:
geronimo

Nested Class Summary
static class Resolver.Have
           
static class Resolver.ProjectWrapper
           
static interface Resolver.Wrapper
           
 
Field Summary
protected  boolean debug
           
protected  ELResolver delegate
           
protected  Project project
           
 
Fields inherited from class javax.el.ELResolver
RESOLVABLE_AT_DESIGN_TIME, TYPE
 
Constructor Summary
Resolver(Project project)
           
 
Method Summary
 Class<?> getCommonPropertyType(ELContext context, Object base)
           
 boolean getDebug()
           
 Iterator<FeatureDescriptor> getFeatureDescriptors(ELContext context, Object base)
           
 Class<?> getType(ELContext context, Object base, Object property)
           
 Object getValue(ELContext context, Object base, Object property)
          Resolve property on base as 'rvalue'.
 boolean isReadOnly(ELContext context, Object base, Object property)
           
protected  Map<String,Object> makemap()
           
static ELResolver makeResolver(Project project)
           
 Resolver setDebug(boolean b)
           
 void setValue(ELContext context, Object base, Object property, Object value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

delegate

protected final ELResolver delegate

project

protected Project project

debug

protected boolean debug
Constructor Detail

Resolver

public Resolver(Project project)
Method Detail

makeResolver

public static ELResolver makeResolver(Project project)

setDebug

public Resolver setDebug(boolean b)

getDebug

public boolean getDebug()

makemap

protected Map<String,Object> makemap()

getCommonPropertyType

public Class<?> getCommonPropertyType(ELContext context,
                                      Object base)
Specified by:
getCommonPropertyType in class ELResolver

getFeatureDescriptors

public Iterator<FeatureDescriptor> getFeatureDescriptors(ELContext context,
                                                         Object base)
Specified by:
getFeatureDescriptors in class ELResolver

getType

public Class<?> getType(ELContext context,
                        Object base,
                        Object property)
                 throws NullPointerException,
                        PropertyNotFoundException,
                        ELException
Specified by:
getType in class ELResolver
Throws:
NullPointerException
PropertyNotFoundException
ELException

getValue

public Object getValue(ELContext context,
                       Object base,
                       Object property)
                throws NullPointerException,
                       PropertyNotFoundException,
                       ELException
Resolve property on base as 'rvalue'. It is from extreme importance that no exception is thrown here. Rather null shall be reported back (and a additional log message might be created). Otherwise if a exception is thrown here, evaluation of a larger context will be aborted. Take for example a context where three references like
 My name is #{..} is one of the #{..} recognizable opening #{..} in American
 
Clearly, we want to have as much references as possible evaluated. If one reference fails, we rather accept that there is something missing than giving up on all. Giving up on all references is exactly what will happen if a exception will be thrown by this method. Therefore make sure that everything is wrapped by a well defined exception handler.

Specified by:
getValue in class ELResolver
Throws:
NullPointerException
PropertyNotFoundException
ELException

isReadOnly

public boolean isReadOnly(ELContext context,
                          Object base,
                          Object property)
                   throws NullPointerException,
                          PropertyNotFoundException,
                          ELException
Specified by:
isReadOnly in class ELResolver
Throws:
NullPointerException
PropertyNotFoundException
ELException

setValue

public void setValue(ELContext context,
                     Object base,
                     Object property,
                     Object value)
              throws NullPointerException,
                     PropertyNotFoundException,
                     PropertyNotWritableException,
                     ELException
Specified by:
setValue in class ELResolver
Throws:
NullPointerException
PropertyNotFoundException
PropertyNotWritableException
ELException