javax.el_2.2.0.v201108011116

16:37:06.730 INFO  jd.cli.Main - Decompiling javax.el_2.2.0.v201108011116.jar
package javax.el;

import java.beans.FeatureDescriptor;
import java.lang.reflect.Array;
import java.util.Iterator;

public class ArrayELResolver
  extends ELResolver
{
  private boolean isReadOnly;
  
  public ArrayELResolver()
  {
    isReadOnly = false;
  }
  
  public ArrayELResolver(boolean isReadOnly)
  {
    this.isReadOnly = isReadOnly;
  }
  
  public Class<?> getType(ELContext context, Object base, Object property)
  {
    if (context == null) {
      throw new NullPointerException();
    }
    if ((base != null) && (base.getClass().isArray()))
    {
      context.setPropertyResolved(true);
      int index = toInteger(property);
      if ((index < 0) || (index >= Array.getLength(base))) {
        throw new PropertyNotFoundException();
      }
      return base.getClass().getComponentType();
    }
    return null;
  }
  
  public Object getValue(ELContext context, Object base, Object property)
  {
    if (context == null) {
      throw new NullPointerException();
    }
    if ((base != null) && (base.getClass().isArray()))
    {
      context.setPropertyResolved(true);
      int index = toInteger(property);
      if ((index >= 0) && (index < Array.getLength(base))) {
        return Array.get(base, index);
      }
    }
    return null;
  }
  
  public void setValue(ELContext context, Object base, Object property, Object val)
  {
    if (context == null) {
      throw new NullPointerException();
    }
    if ((base != null) && (base.getClass().isArray()))
    {
      context.setPropertyResolved(true);
      if (isReadOnly) {
        throw new PropertyNotWritableException();
      }
      Class<?> type = base.getClass().getComponentType();
      if ((val != null) && (!type.isAssignableFrom(val.getClass()))) {
        throw new ClassCastException();
      }
      int index = toInteger(property);
      if ((index < 0) || (index >= Array.getLength(base))) {
        throw new PropertyNotFoundException();
      }
      Array.set(base, index, val);
    }
  }
  
  public boolean isReadOnly(ELContext context, Object base, Object property)
  {
    if (context == null) {
      throw new NullPointerException();
    }
    if ((base != null) && (base.getClass().isArray()))
    {
      context.setPropertyResolved(true);
      int index = toInteger(property);
      if ((index < 0) || (index >= Array.getLength(base))) {
        throw new PropertyNotFoundException();
      }
    }
    return isReadOnly;
  }
  
  public Iterator<FeatureDescriptor> getFeatureDescriptors(ELContext context, Object base)
  {
    return null;
  }
  
  public Class<?> getCommonPropertyType(ELContext context, Object base)
  {
    if ((base != null) && (base.getClass().isArray())) {
      return Integer.class;
    }
    return null;
  }
  
  private int toInteger(Object p)
  {
    if ((p instanceof Integer)) {
      return ((Integer)p).intValue();
    }
    if ((p instanceof Character)) {
      return ((Character)p).charValue();
    }
    if ((p instanceof Boolean)) {
      return ((Boolean)p).booleanValue() ? 1 : 0;
    }
    if ((p instanceof Number)) {
      return ((Number)p).intValue();
    }
    if ((p instanceof String)) {
      return Integer.parseInt((String)p);
    }
    throw new IllegalArgumentException();
  }
}

/* Location:
 * Qualified Name:     javax.el.ArrayELResolver
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package javax.el;

import java.beans.BeanInfo;
import java.beans.IntrospectionException;
import java.beans.Introspector;
import java.beans.PropertyDescriptor;
import java.util.HashMap;
import java.util.Map;

public final class BeanELResolver$BeanProperties
{
  private final Map<String, BeanELResolver.BeanProperty> propertyMap = new HashMap();
  
  public BeanELResolver$BeanProperties(Class<?> baseClass)
  {
    PropertyDescriptor[] descriptors;
    try
    {
      BeanInfo info = Introspector.getBeanInfo(baseClass);
      descriptors = info.getPropertyDescriptors();
    }
    catch (IntrospectionException ie)
    {
      throw new ELException(ie);
    }
    for (PropertyDescriptor pd : descriptors) {
      propertyMap.put(pd.getName(), new BeanELResolver.BeanProperty(baseClass, pd));
    }
  }
  
  public BeanELResolver.BeanProperty getBeanProperty(String property)
  {
    return (BeanELResolver.BeanProperty)propertyMap.get(property);
  }
}

/* Location:
 * Qualified Name:     javax.el.BeanELResolver.BeanProperties
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package javax.el;

import java.beans.PropertyDescriptor;
import java.lang.reflect.Method;

public final class BeanELResolver$BeanProperty
{
  private Method readMethod;
  private Method writeMethod;
  private PropertyDescriptor descriptor;
  
  public BeanELResolver$BeanProperty(Class<?> baseClass, PropertyDescriptor descriptor)
  {
    this.descriptor = descriptor;
    readMethod = BeanELResolver.access$000(baseClass, descriptor.getReadMethod());
    writeMethod = BeanELResolver.access$000(baseClass, descriptor.getWriteMethod());
  }
  
  public Class getPropertyType()
  {
    return descriptor.getPropertyType();
  }
  
  public boolean isReadOnly()
  {
    return getWriteMethod() == null;
  }
  
  public Method getReadMethod()
  {
    return readMethod;
  }
  
  public Method getWriteMethod()
  {
    return writeMethod;
  }
}

/* Location:
 * Qualified Name:     javax.el.BeanELResolver.BeanProperty
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package javax.el;

import java.beans.BeanInfo;
import java.beans.FeatureDescriptor;
import java.beans.IntrospectionException;
import java.beans.Introspector;
import java.beans.PropertyDescriptor;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;

public class BeanELResolver
  extends ELResolver
{
  private boolean isReadOnly;
  private static final int CACHE_SIZE = 1024;
  private static final ConcurrentHashMap<Class, BeanProperties> properties = new ConcurrentHashMap(1024);
  
  protected static final class BeanProperty
  {
    private Method readMethod;
    private Method writeMethod;
    private PropertyDescriptor descriptor;
    
    public BeanProperty(Class<?> baseClass, PropertyDescriptor descriptor)
    {
      this.descriptor = descriptor;
      readMethod = BeanELResolver.getMethod(baseClass, descriptor.getReadMethod());
      writeMethod = BeanELResolver.getMethod(baseClass, descriptor.getWriteMethod());
    }
    
    public Class getPropertyType()
    {
      return descriptor.getPropertyType();
    }
    
    public boolean isReadOnly()
    {
      return getWriteMethod() == null;
    }
    
    public Method getReadMethod()
    {
      return readMethod;
    }
    
    public Method getWriteMethod()
    {
      return writeMethod;
    }
  }
  
  protected static final class BeanProperties
  {
    private final Map<String, BeanELResolver.BeanProperty> propertyMap = new HashMap();
    
    public BeanProperties(Class<?> baseClass)
    {
      PropertyDescriptor[] descriptors;
      try
      {
        BeanInfo info = Introspector.getBeanInfo(baseClass);
        descriptors = info.getPropertyDescriptors();
      }
      catch (IntrospectionException ie)
      {
        throw new ELException(ie);
      }
      for (PropertyDescriptor pd : descriptors) {
        propertyMap.put(pd.getName(), new BeanELResolver.BeanProperty(baseClass, pd));
      }
    }
    
    public BeanELResolver.BeanProperty getBeanProperty(String property)
    {
      return (BeanELResolver.BeanProperty)propertyMap.get(property);
    }
  }
  
  public BeanELResolver()
  {
    isReadOnly = false;
  }
  
  public BeanELResolver(boolean isReadOnly)
  {
    this.isReadOnly = isReadOnly;
  }
  
  public Class<?> getType(ELContext context, Object base, Object property)
  {
    if (context == null) {
      throw new NullPointerException();
    }
    if ((base == null) || (property == null)) {
      return null;
    }
    BeanProperty bp = getBeanProperty(context, base, property);
    context.setPropertyResolved(true);
    return bp.getPropertyType();
  }
  
  public Object getValue(ELContext context, Object base, Object property)
  {
    if (context == null) {
      throw new NullPointerException();
    }
    if ((base == null) || (property == null)) {
      return null;
    }
    BeanProperty bp = getBeanProperty(context, base, property);
    Method method = bp.getReadMethod();
    if (method == null) {
      throw new PropertyNotFoundException(ELUtil.getExceptionMessageString(context, "propertyNotReadable", new Object[] { base.getClass().getName(), property.toString() }));
    }
    Object value;
    try
    {
      value = method.invoke(base, new Object[0]);
      context.setPropertyResolved(true);
    }
    catch (ELException ex)
    {
      throw ex;
    }
    catch (InvocationTargetException ite)
    {
      throw new ELException(ite.getCause());
    }
    catch (Exception ex)
    {
      throw new ELException(ex);
    }
    return value;
  }
  
  public void setValue(ELContext context, Object base, Object property, Object val)
  {
    if (context == null) {
      throw new NullPointerException();
    }
    if ((base == null) || (property == null)) {
      return;
    }
    if (isReadOnly) {
      throw new PropertyNotWritableException(ELUtil.getExceptionMessageString(context, "resolverNotwritable", new Object[] { base.getClass().getName() }));
    }
    BeanProperty bp = getBeanProperty(context, base, property);
    Method method = bp.getWriteMethod();
    if (method == null) {
      throw new PropertyNotWritableException(ELUtil.getExceptionMessageString(context, "propertyNotWritable", new Object[] { base.getClass().getName(), property.toString() }));
    }
    try
    {
      method.invoke(base, new Object[] { val });
      context.setPropertyResolved(true);
    }
    catch (ELException ex)
    {
      throw ex;
    }
    catch (InvocationTargetException ite)
    {
      throw new ELException(ite.getCause());
    }
    catch (Exception ex)
    {
      if (null == val) {
        val = "null";
      }
      String message = ELUtil.getExceptionMessageString(context, "setPropertyFailed", new Object[] { property.toString(), base.getClass().getName(), val });
      
      throw new ELException(message, ex);
    }
  }
  
  public Object invoke(ELContext context, Object base, Object method, Class<?>[] paramTypes, Object[] params)
  {
    if ((base == null) || (method == null)) {
      return null;
    }
    Method m = findMethod(base, method.toString(), paramTypes, params);
    Object ret = invokeMethod(m, base, params);
    context.setPropertyResolved(true);
    return ret;
  }
  
  public boolean isReadOnly(ELContext context, Object base, Object property)
  {
    if (context == null) {
      throw new NullPointerException();
    }
    if ((base == null) || (property == null)) {
      return false;
    }
    context.setPropertyResolved(true);
    if (isReadOnly) {
      return true;
    }
    BeanProperty bp = getBeanProperty(context, base, property);
    return bp.isReadOnly();
  }
  
  public Iterator<FeatureDescriptor> getFeatureDescriptors(ELContext context, Object base)
  {
    if (base == null) {
      return null;
    }
    BeanInfo info = null;
    try
    {
      info = Introspector.getBeanInfo(base.getClass());
    }
    catch (Exception ex) {}
    if (info == null) {
      return null;
    }
    ArrayList<FeatureDescriptor> list = new ArrayList(info.getPropertyDescriptors().length);
    for (PropertyDescriptor pd : info.getPropertyDescriptors())
    {
      pd.setValue("type", pd.getPropertyType());
      pd.setValue("resolvableAtDesignTime", Boolean.TRUE);
      list.add(pd);
    }
    return list.iterator();
  }
  
  public Class<?> getCommonPropertyType(ELContext context, Object base)
  {
    if (base == null) {
      return null;
    }
    return Object.class;
  }
  
  private static Method getMethod(Class cl, Method method)
  {
    if (method == null) {
      return null;
    }
    if (Modifier.isPublic(cl.getModifiers())) {
      return method;
    }
    Class[] interfaces = cl.getInterfaces();
    for (int i = 0; i < interfaces.length; i++)
    {
      Class c = interfaces[i];
      Method m = null;
      try
      {
        m = c.getMethod(method.getName(), method.getParameterTypes());
        c = m.getDeclaringClass();
        if ((m = getMethod(c, m)) != null) {
          return m;
        }
      }
      catch (NoSuchMethodException ex) {}
    }
    Class c = cl.getSuperclass();
    if (c != null)
    {
      Method m = null;
      try
      {
        m = c.getMethod(method.getName(), method.getParameterTypes());
        c = m.getDeclaringClass();
        if ((m = getMethod(c, m)) != null) {
          return m;
        }
      }
      catch (NoSuchMethodException ex) {}
    }
    return null;
  }
  
  private BeanProperty getBeanProperty(ELContext context, Object base, Object prop)
  {
    String property = prop.toString();
    Class baseClass = base.getClass();
    BeanProperties bps = (BeanProperties)properties.get(baseClass);
    if (bps == null)
    {
      bps = new BeanProperties(baseClass);
      properties.putIfAbsent(baseClass, bps);
    }
    BeanProperty bp = bps.getBeanProperty(property);
    if (bp == null) {
      throw new PropertyNotFoundException(ELUtil.getExceptionMessageString(context, "propertyNotFound", new Object[] { baseClass.getName(), property }));
    }
    return bp;
  }
  
  private void removeFromMap(Map<Class, BeanProperties> map, ClassLoader classloader)
  {
    Iterator<Class> iter = map.keySet().iterator();
    while (iter.hasNext())
    {
      Class mbeanClass = (Class)iter.next();
      if (classloader.equals(mbeanClass.getClassLoader())) {
        iter.remove();
      }
    }
  }
  
  private void purgeBeanClasses(ClassLoader classloader)
  {
    removeFromMap(properties, classloader);
  }
  
  private Method findMethod(Object base, String method, Class<?>[] paramTypes, Object[] params)
  {
    Class<?> beanClass = base.getClass();
    if (paramTypes != null) {
      try
      {
        return beanClass.getMethod(method, paramTypes);
      }
      catch (NoSuchMethodException ex)
      {
        throw new MethodNotFoundException(ex);
      }
    }
    int paramCount = params == null ? 0 : params.length;
    for (Method m : base.getClass().getMethods()) {
      if ((m.getName().equals(method)) && ((m.isVarArgs()) || (m.getParameterTypes().length == paramCount))) {
        return m;
      }
    }
    throw new MethodNotFoundException("Method " + method + " not found");
  }
  
  private Object invokeMethod(Method m, Object base, Object[] params)
  {
    Class[] parameterTypes = m.getParameterTypes();
    Object[] parameters = null;
    if (parameterTypes.length > 0)
    {
      ExpressionFactory exprFactory = ExpressionFactory.newInstance();
      if (!m.isVarArgs())
      {
        parameters = new Object[parameterTypes.length];
        for (int i = 0; i < parameterTypes.length; i++) {
          parameters[i] = exprFactory.coerceToType(params[i], parameterTypes[i]);
        }
      }
    }
    try
    {
      return m.invoke(base, parameters);
    }
    catch (IllegalAccessException iae)
    {
      throw new ELException(iae);
    }
    catch (InvocationTargetException ite)
    {
      throw new ELException(ite.getCause());
    }
  }
}

/* Location:
 * Qualified Name:     javax.el.BeanELResolver
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package javax.el;

import java.beans.FeatureDescriptor;
import java.util.Iterator;

class CompositeELResolver$CompositeIterator
  implements Iterator<FeatureDescriptor>
{
  ELResolver[] resolvers;
  int size;
  int index = 0;
  Iterator<FeatureDescriptor> propertyIter = null;
  ELContext context;
  Object base;
  
  CompositeELResolver$CompositeIterator(ELResolver[] resolvers, int size, ELContext context, Object base)
  {
    this.resolvers = resolvers;
    this.size = size;
    this.context = context;
    this.base = base;
  }
  
  public boolean hasNext()
  {
    if ((propertyIter == null) || (!propertyIter.hasNext()))
    {
      while (index < size)
      {
        ELResolver elResolver = resolvers[(index++)];
        propertyIter = elResolver.getFeatureDescriptors(context, base);
        if (propertyIter != null) {
          return propertyIter.hasNext();
        }
      }
      return false;
    }
    return propertyIter.hasNext();
  }
  
  public FeatureDescriptor next()
  {
    if ((propertyIter == null) || (!propertyIter.hasNext()))
    {
      while (index < size)
      {
        ELResolver elResolver = resolvers[(index++)];
        propertyIter = elResolver.getFeatureDescriptors(context, base);
        if (propertyIter != null) {
          return (FeatureDescriptor)propertyIter.next();
        }
      }
      return null;
    }
    return (FeatureDescriptor)propertyIter.next();
  }
  
  public void remove()
  {
    throw new UnsupportedOperationException();
  }
}

/* Location:
 * Qualified Name:     javax.el.CompositeELResolver.CompositeIterator
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package javax.el;

import java.beans.FeatureDescriptor;
import java.util.Iterator;

public class CompositeELResolver
  extends ELResolver
{
  private ELResolver[] elResolvers;
  private int size;
  
  public CompositeELResolver()
  {
    size = 0;
    elResolvers = new ELResolver[16];
  }
  
  public void add(ELResolver elResolver)
  {
    if (elResolver == null) {
      throw new NullPointerException();
    }
    if (size >= elResolvers.length)
    {
      ELResolver[] newResolvers = new ELResolver[size * 2];
      System.arraycopy(elResolvers, 0, newResolvers, 0, size);
      elResolvers = newResolvers;
    }
    elResolvers[(size++)] = elResolver;
  }
  
  public Object getValue(ELContext context, Object base, Object property)
  {
    context.setPropertyResolved(false);
    
    Object value = null;
    for (int i = 0; i < size; i++)
    {
      value = elResolvers[i].getValue(context, base, property);
      if (context.isPropertyResolved()) {
        return value;
      }
    }
    return null;
  }
  
  public Object invoke(ELContext context, Object base, Object method, Class<?>[] paramTypes, Object[] params)
  {
    context.setPropertyResolved(false);
    for (int i = 0; i < size; i++)
    {
      Object value = elResolvers[i].invoke(context, base, method, paramTypes, params);
      if (context.isPropertyResolved()) {
        return value;
      }
    }
    return null;
  }
  
  public Class<?> getType(ELContext context, Object base, Object property)
  {
    context.setPropertyResolved(false);
    for (int i = 0; i < size; i++)
    {
      Class<?> type = elResolvers[i].getType(context, base, property);
      if (context.isPropertyResolved()) {
        return type;
      }
    }
    return null;
  }
  
  public void setValue(ELContext context, Object base, Object property, Object val)
  {
    context.setPropertyResolved(false);
    for (int i = 0; i < size; i++)
    {
      elResolvers[i].setValue(context, base, property, val);
      if (context.isPropertyResolved()) {
        return;
      }
    }
  }
  
  public boolean isReadOnly(ELContext context, Object base, Object property)
  {
    context.setPropertyResolved(false);
    for (int i = 0; i < size; i++)
    {
      boolean readOnly = elResolvers[i].isReadOnly(context, base, property);
      if (context.isPropertyResolved()) {
        return readOnly;
      }
    }
    return false;
  }
  
  public Iterator<FeatureDescriptor> getFeatureDescriptors(ELContext context, Object base)
  {
    return new CompositeIterator(elResolvers, size, context, base);
  }
  
  public Class<?> getCommonPropertyType(ELContext context, Object base)
  {
    Class<?> commonPropertyType = null;
    for (int i = 0; i < size; i++)
    {
      Class<?> type = elResolvers[i].getCommonPropertyType(context, base);
      if (type != null) {
        if (commonPropertyType == null) {
          commonPropertyType = type;
        } else if (!commonPropertyType.isAssignableFrom(type)) {
          if (type.isAssignableFrom(commonPropertyType)) {
            commonPropertyType = type;
          } else {
            return null;
          }
        }
      }
    }
    return commonPropertyType;
  }
  
  private static class CompositeIterator
    implements Iterator<FeatureDescriptor>
  {
    ELResolver[] resolvers;
    int size;
    int index = 0;
    Iterator<FeatureDescriptor> propertyIter = null;
    ELContext context;
    Object base;
    
    CompositeIterator(ELResolver[] resolvers, int size, ELContext context, Object base)
    {
      this.resolvers = resolvers;
      this.size = size;
      this.context = context;
      this.base = base;
    }
    
    public boolean hasNext()
    {
      if ((propertyIter == null) || (!propertyIter.hasNext()))
      {
        while (index < size)
        {
          ELResolver elResolver = resolvers[(index++)];
          propertyIter = elResolver.getFeatureDescriptors(context, base);
          if (propertyIter != null) {
            return propertyIter.hasNext();
          }
        }
        return false;
      }
      return propertyIter.hasNext();
    }
    
    public FeatureDescriptor next()
    {
      if ((propertyIter == null) || (!propertyIter.hasNext()))
      {
        while (index < size)
        {
          ELResolver elResolver = resolvers[(index++)];
          propertyIter = elResolver.getFeatureDescriptors(context, base);
          if (propertyIter != null) {
            return (FeatureDescriptor)propertyIter.next();
          }
        }
        return null;
      }
      return (FeatureDescriptor)propertyIter.next();
    }
    
    public void remove()
    {
      throw new UnsupportedOperationException();
    }
  }
}

/* Location:
 * Qualified Name:     javax.el.CompositeELResolver
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package javax.el;

import java.util.HashMap;
import java.util.Locale;

public abstract class ELContext
{
  private Locale locale;
  private boolean resolved;
  
  public void setPropertyResolved(boolean resolved)
  {
    this.resolved = resolved;
  }
  
  public boolean isPropertyResolved()
  {
    return resolved;
  }
  
  public void putContext(Class key, Object contextObject)
  {
    if ((key == null) || (contextObject == null)) {
      throw new NullPointerException();
    }
    map.put(key, contextObject);
  }
  
  public Object getContext(Class key)
  {
    if (key == null) {
      throw new NullPointerException();
    }
    return map.get(key);
  }
  
  public abstract ELResolver getELResolver();
  
  public abstract FunctionMapper getFunctionMapper();
  
  public Locale getLocale()
  {
    return locale;
  }
  
  public void setLocale(Locale locale)
  {
    this.locale = locale;
  }
  
  private HashMap map = new HashMap();
  
  public abstract VariableMapper getVariableMapper();
}

/* Location:
 * Qualified Name:     javax.el.ELContext
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package javax.el;

import java.util.EventObject;

public class ELContextEvent
  extends EventObject
{
  public ELContextEvent(ELContext source)
  {
    super(source);
  }
  
  public ELContext getELContext()
  {
    return (ELContext)getSource();
  }
}

/* Location:
 * Qualified Name:     javax.el.ELContextEvent
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package javax.el;

import java.util.EventListener;

public abstract interface ELContextListener
  extends EventListener
{
  public abstract void contextCreated(ELContextEvent paramELContextEvent);
}

/* Location:
 * Qualified Name:     javax.el.ELContextListener
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package javax.el;

public class ELException
  extends RuntimeException
{
  public ELException() {}
  
  public ELException(String pMessage)
  {
    super(pMessage);
  }
  
  public ELException(Throwable pRootCause)
  {
    super(pRootCause);
  }
  
  public ELException(String pMessage, Throwable pRootCause)
  {
    super(pMessage, pRootCause);
  }
}

/* Location:
 * Qualified Name:     javax.el.ELException
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package javax.el;

import java.beans.FeatureDescriptor;
import java.util.Iterator;

public abstract class ELResolver
{
  public static final String TYPE = "type";
  public static final String RESOLVABLE_AT_DESIGN_TIME = "resolvableAtDesignTime";
  
  public abstract Object getValue(ELContext paramELContext, Object paramObject1, Object paramObject2);
  
  public Object invoke(ELContext context, Object base, Object method, Class<?>[] paramTypes, Object[] params)
  {
    return null;
  }
  
  public abstract Class<?> getType(ELContext paramELContext, Object paramObject1, Object paramObject2);
  
  public abstract void setValue(ELContext paramELContext, Object paramObject1, Object paramObject2, Object paramObject3);
  
  public abstract boolean isReadOnly(ELContext paramELContext, Object paramObject1, Object paramObject2);
  
  public abstract Iterator<FeatureDescriptor> getFeatureDescriptors(ELContext paramELContext, Object paramObject);
  
  public abstract Class<?> getCommonPropertyType(ELContext paramELContext, Object paramObject);
}

/* Location:
 * Qualified Name:     javax.el.ELResolver
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package javax.el;

final class ELUtil$1
  extends ThreadLocal
{
  protected Object initialValue()
  {
    return null;
  }
}

/* Location:
 * Qualified Name:     javax.el.ELUtil.1
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package javax.el;

import java.text.MessageFormat;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import java.util.MissingResourceException;
import java.util.ResourceBundle;

class ELUtil
{
  private static ThreadLocal instance = new ThreadLocal()
  {
    protected Object initialValue()
    {
      return null;
    }
  };
  
  private static Map getCurrentInstance()
  {
    Map result = (Map)instance.get();
    if (null == result)
    {
      result = new HashMap();
      setCurrentInstance(result);
    }
    return result;
  }
  
  private static void setCurrentInstance(Map context)
  {
    instance.set(context);
  }
  
  public static String getExceptionMessageString(ELContext context, String messageId)
  {
    return getExceptionMessageString(context, messageId, null);
  }
  
  public static String getExceptionMessageString(ELContext context, String messageId, Object[] params)
  {
    String result = "";
    Locale locale = null;
    if ((null == context) || (null == messageId)) {
      return result;
    }
    if (null == (locale = context.getLocale())) {
      locale = Locale.getDefault();
    }
    if (null != locale)
    {
      Map threadMap = getCurrentInstance();
      ResourceBundle rb = null;
      if (null == (rb = (ResourceBundle)threadMap.get(locale.toString())))
      {
        rb = ResourceBundle.getBundle("javax.el.PrivateMessages", locale);
        
        threadMap.put(locale.toString(), rb);
      }
      if (null != rb) {
        try
        {
          result = rb.getString(messageId);
          if (null != params) {
            result = MessageFormat.format(result, params);
          }
        }
        catch (IllegalArgumentException iae)
        {
          result = "Can't get localized message: parameters to message appear to be incorrect.  Message to format: " + messageId;
        }
        catch (MissingResourceException mre)
        {
          result = "Missing Resource in EL implementation: ???" + messageId + "???";
        }
        catch (Exception e)
        {
          result = "Exception resolving message in EL implementation: ???" + messageId + "???";
        }
      }
    }
    return result;
  }
}

/* Location:
 * Qualified Name:     javax.el.ELUtil
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package javax.el;

import java.io.Serializable;

public abstract class Expression
  implements Serializable
{
  public abstract String getExpressionString();
  
  public abstract boolean equals(Object paramObject);
  
  public abstract int hashCode();
  
  public abstract boolean isLiteralText();
}

/* Location:
 * Qualified Name:     javax.el.Expression
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package javax.el;

import java.util.Properties;

public abstract class ExpressionFactory
{
  public static ExpressionFactory newInstance()
  {
    return newInstance(null);
  }
  
  public static ExpressionFactory newInstance(Properties properties)
  {
    return (ExpressionFactory)FactoryFinder.find("javax.el.ExpressionFactory", "com.sun.el.ExpressionFactoryImpl", properties);
  }
  
  public abstract ValueExpression createValueExpression(ELContext paramELContext, String paramString, Class<?> paramClass);
  
  public abstract ValueExpression createValueExpression(Object paramObject, Class<?> paramClass);
  
  public abstract MethodExpression createMethodExpression(ELContext paramELContext, String paramString, Class<?> paramClass, Class<?>[] paramArrayOfClass);
  
  public abstract Object coerceToType(Object paramObject, Class<?> paramClass);
}

/* Location:
 * Qualified Name:     javax.el.ExpressionFactory
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package javax.el;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.lang.reflect.Constructor;
import java.util.Properties;

class FactoryFinder
{
  private static Object newInstance(String className, ClassLoader classLoader, Properties properties)
  {
    try
    {
      Class spiClass;
      Class spiClass;
      if (classLoader == null) {
        spiClass = Class.forName(className);
      } else {
        spiClass = classLoader.loadClass(className);
      }
      if (properties != null)
      {
        Constructor constr = null;
        try
        {
          constr = spiClass.getConstructor(new Class[] { Properties.class });
        }
        catch (Exception ex) {}
        if (constr != null) {
          return constr.newInstance(new Object[] { properties });
        }
      }
      return spiClass.newInstance();
    }
    catch (ClassNotFoundException x)
    {
      throw new ELException("Provider " + className + " not found", x);
    }
    catch (Exception x)
    {
      throw new ELException("Provider " + className + " could not be instantiated: " + x, x);
    }
  }
  
  static Object find(String factoryId, String fallbackClassName, Properties properties)
  {
    ClassLoader classLoader;
    try
    {
      classLoader = Thread.currentThread().getContextClassLoader();
    }
    catch (Exception x)
    {
      throw new ELException(x.toString(), x);
    }
    String serviceId = "META-INF/services/" + factoryId;
    try
    {
      InputStream is = null;
      if (classLoader == null) {
        is = ClassLoader.getSystemResourceAsStream(serviceId);
      } else {
        is = classLoader.getResourceAsStream(serviceId);
      }
      if (is != null)
      {
        BufferedReader rd = new BufferedReader(new InputStreamReader(is, "UTF-8"));
        
        String factoryClassName = rd.readLine();
        rd.close();
        if ((factoryClassName != null) && (!"".equals(factoryClassName))) {
          return newInstance(factoryClassName, classLoader, properties);
        }
      }
    }
    catch (Exception ex) {}
    try
    {
      String javah = System.getProperty("java.home");
      String configFile = javah + File.separator + "lib" + File.separator + "el.properties";
      
      File f = new File(configFile);
      if (f.exists())
      {
        Properties props = new Properties();
        props.load(new FileInputStream(f));
        String factoryClassName = props.getProperty(factoryId);
        return newInstance(factoryClassName, classLoader, properties);
      }
    }
    catch (Exception ex) {}
    try
    {
      String systemProp = System.getProperty(factoryId);
      if (systemProp != null) {
        return newInstance(systemProp, classLoader, properties);
      }
    }
    catch (SecurityException se) {}
    if (fallbackClassName == null) {
      throw new ELException("Provider for " + factoryId + " cannot be found", null);
    }
    return newInstance(fallbackClassName, classLoader, properties);
  }
}

/* Location:
 * Qualified Name:     javax.el.FactoryFinder
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package javax.el;

import java.lang.reflect.Method;

public abstract class FunctionMapper
{
  public abstract Method resolveFunction(String paramString1, String paramString2);
}

/* Location:
 * Qualified Name:     javax.el.FunctionMapper
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package javax.el;

import java.beans.FeatureDescriptor;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;

public class ListELResolver
  extends ELResolver
{
  public ListELResolver()
  {
    isReadOnly = false;
  }
  
  public ListELResolver(boolean isReadOnly)
  {
    this.isReadOnly = isReadOnly;
  }
  
  public Class<?> getType(ELContext context, Object base, Object property)
  {
    if (context == null) {
      throw new NullPointerException();
    }
    if ((base != null) && ((base instanceof List)))
    {
      context.setPropertyResolved(true);
      List list = (List)base;
      int index = toInteger(property);
      if ((index < 0) || (index >= list.size())) {
        throw new PropertyNotFoundException();
      }
      return Object.class;
    }
    return null;
  }
  
  public Object getValue(ELContext context, Object base, Object property)
  {
    if (context == null) {
      throw new NullPointerException();
    }
    if ((base != null) && ((base instanceof List)))
    {
      context.setPropertyResolved(true);
      List list = (List)base;
      int index = toInteger(property);
      if ((index < 0) || (index >= list.size())) {
        return null;
      }
      return list.get(index);
    }
    return null;
  }
  
  public void setValue(ELContext context, Object base, Object property, Object val)
  {
    if (context == null) {
      throw new NullPointerException();
    }
    if ((base != null) && ((base instanceof List)))
    {
      context.setPropertyResolved(true);
      List list = (List)base;
      int index = toInteger(property);
      if (isReadOnly) {
        throw new PropertyNotWritableException();
      }
      try
      {
        list.set(index, val);
      }
      catch (UnsupportedOperationException ex)
      {
        throw new PropertyNotWritableException();
      }
      catch (IndexOutOfBoundsException ex)
      {
        throw new PropertyNotFoundException();
      }
      catch (ClassCastException ex)
      {
        throw ex;
      }
      catch (NullPointerException ex)
      {
        throw ex;
      }
      catch (IllegalArgumentException ex)
      {
        throw ex;
      }
    }
  }
  
  private static Class<?> theUnmodifiableListClass = Collections.unmodifiableList(new ArrayList()).getClass();
  private boolean isReadOnly;
  
  public boolean isReadOnly(ELContext context, Object base, Object property)
  {
    if (context == null) {
      throw new NullPointerException();
    }
    if ((base != null) && ((base instanceof List)))
    {
      context.setPropertyResolved(true);
      List list = (List)base;
      int index = toInteger(property);
      if ((index < 0) || (index >= list.size())) {
        throw new PropertyNotFoundException();
      }
      return (list.getClass() == theUnmodifiableListClass) || (isReadOnly);
    }
    return false;
  }
  
  public Iterator<FeatureDescriptor> getFeatureDescriptors(ELContext context, Object base)
  {
    return null;
  }
  
  public Class<?> getCommonPropertyType(ELContext context, Object base)
  {
    if ((base != null) && ((base instanceof List))) {
      return Integer.class;
    }
    return null;
  }
  
  private int toInteger(Object p)
  {
    if ((p instanceof Integer)) {
      return ((Integer)p).intValue();
    }
    if ((p instanceof Character)) {
      return ((Character)p).charValue();
    }
    if ((p instanceof Number)) {
      return ((Number)p).intValue();
    }
    if ((p instanceof String)) {
      return Integer.parseInt((String)p);
    }
    throw new IllegalArgumentException();
  }
}

/* Location:
 * Qualified Name:     javax.el.ListELResolver
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package javax.el;

import java.beans.FeatureDescriptor;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;

public class MapELResolver
  extends ELResolver
{
  public MapELResolver()
  {
    isReadOnly = false;
  }
  
  public MapELResolver(boolean isReadOnly)
  {
    this.isReadOnly = isReadOnly;
  }
  
  public Class<?> getType(ELContext context, Object base, Object property)
  {
    if (context == null) {
      throw new NullPointerException();
    }
    if ((base != null) && ((base instanceof Map)))
    {
      context.setPropertyResolved(true);
      return Object.class;
    }
    return null;
  }
  
  public Object getValue(ELContext context, Object base, Object property)
  {
    if (context == null) {
      throw new NullPointerException();
    }
    if ((base != null) && ((base instanceof Map)))
    {
      context.setPropertyResolved(true);
      Map map = (Map)base;
      return map.get(property);
    }
    return null;
  }
  
  private static Class<?> theUnmodifiableMapClass = Collections.unmodifiableMap(new HashMap()).getClass();
  private boolean isReadOnly;
  
  public void setValue(ELContext context, Object base, Object property, Object val)
  {
    if (context == null) {
      throw new NullPointerException();
    }
    if ((base != null) && ((base instanceof Map)))
    {
      context.setPropertyResolved(true);
      Map map = (Map)base;
      if ((isReadOnly) || (map.getClass() == theUnmodifiableMapClass)) {
        throw new PropertyNotWritableException();
      }
      try
      {
        map.put(property, val);
      }
      catch (UnsupportedOperationException ex)
      {
        throw new PropertyNotWritableException();
      }
    }
  }
  
  public boolean isReadOnly(ELContext context, Object base, Object property)
  {
    if (context == null) {
      throw new NullPointerException();
    }
    if ((base != null) && ((base instanceof Map)))
    {
      context.setPropertyResolved(true);
      Map map = (Map)base;
      return (isReadOnly) || (map.getClass() == theUnmodifiableMapClass);
    }
    return false;
  }
  
  public Iterator<FeatureDescriptor> getFeatureDescriptors(ELContext context, Object base)
  {
    if ((base != null) && ((base instanceof Map)))
    {
      Map map = (Map)base;
      Iterator iter = map.keySet().iterator();
      List<FeatureDescriptor> list = new ArrayList();
      while (iter.hasNext())
      {
        Object key = iter.next();
        FeatureDescriptor descriptor = new FeatureDescriptor();
        String name = key == null ? null : key.toString();
        descriptor.setName(name);
        descriptor.setDisplayName(name);
        descriptor.setShortDescription("");
        descriptor.setExpert(false);
        descriptor.setHidden(false);
        descriptor.setPreferred(true);
        descriptor.setValue("type", key == null ? null : key.getClass());
        descriptor.setValue("resolvableAtDesignTime", Boolean.TRUE);
      
1 2

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2017. Infinite Loop Ltd