private BeanProperty getBeanProperty(ELContext context, Object base, Object prop) { String property = prop.toString(); Class baseClass = base.getClass(); BeanProperties bps = properties.get(baseClass); if (bps == null) { bps = new BeanProperties(baseClass); properties.put(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 BeanProperty getBeanProperty(ELContext context, Object base, Object prop) { String property = prop.toString(); Class baseClass = base.getClass(); BeanProperties bps = 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; }
/** * Lookup BeanProperty for the given (base, property) pair. * * @param base * The bean to analyze. * @param property * The name of the property to analyze. Will be coerced to a String. * @return The BeanProperty representing (base, property). * @throws PropertyNotFoundException * if no BeanProperty can be found. */ private final BeanProperty toBeanProperty(Object base, Object property) { BeanProperties beanProperties = cache.get(base.getClass()); if (beanProperties == null) { BeanProperties newBeanProperties = new BeanProperties(base.getClass()); beanProperties = cache.putIfAbsent(base.getClass(), newBeanProperties); if (beanProperties == null) { // put succeeded, use new value beanProperties = newBeanProperties; } } BeanProperty beanProperty = property == null ? null : beanProperties.getBeanProperty(property.toString()); if (beanProperty == null) { throw new PropertyNotFoundException("Could not find property " + property + " in " + base.getClass()); } return beanProperty; }
private BeanProperties getProp(ELContext context, Object base, Object property) { if (base == null || ! (property instanceof String)) return null; String fieldName = (String) property; if (fieldName.length() == 0) return null; Class<?> cl = base.getClass(); BeanProperties props = getProps(cl); if (props == null) { if (cl.isArray() || Collection.class.isAssignableFrom(cl) || Map.class.isAssignableFrom(cl)) { return null; } props = new BeanProperties(cl); setProps(cl, props); } return props; }
private BeanProperty getBeanProperty(ELContext context, Object base, Object prop) { String property = prop.toString(); Class baseClass = base.getClass(); BeanProperties bps = properties.get(baseClass); if (bps == null) { bps = new BeanProperties(baseClass); properties.put(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 BeanProperty getBeanProperty(ELContext context, Object base, Object prop) { String property = prop.toString(); Class baseClass = base.getClass(); BeanProperties bps = 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 BeanProperty getBeanProperty(ELContext context, Object base, Object prop) { String property = prop.toString(); Class baseClass = base.getClass(); BeanProperties bps = properties.get(baseClass); if (bps == null) { bps = new BeanProperties(baseClass); properties.put(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 BeanProperty getBeanProperty(ELContext context, Object base, Object prop) { String property = prop.toString(); Class baseClass = base.getClass(); BeanProperties bps = 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 BeanProperty getBeanProperty(ELContext context, Object base, Object prop) { String property = prop.toString(); Class baseClass = base.getClass(); BeanProperties bps = properties.get(baseClass); if (bps == null) { bps = new BeanProperties(baseClass); properties.put(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 BeanProperty getBeanProperty(ELContext context, Object base, Object prop) { String property = prop.toString(); Class baseClass = base.getClass(); BeanProperties bps = properties.get(baseClass); if (bps == null) { bps = new BeanProperties(baseClass); properties.put(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 BeanProperty getBeanProperty(ELContext context, Object base, Object prop) { String property = prop.toString(); Class baseClass = base.getClass(); BeanProperties bps = properties.get(baseClass); if (bps == null) { bps = new BeanProperties(baseClass); properties.put(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 BeanProperty getBeanProperty(ELContext context, Object base, Object prop) { String property = prop.toString(); Class baseClass = base.getClass(); BeanProperties bps = properties.get(baseClass); if (bps == null) { bps = new BeanProperties(baseClass); properties.put(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 final BeanProperty property(ELContext ctx, Object base, Object property) { Class<?> type = base.getClass(); String prop = property.toString(); BeanProperties props = this.cache.get(type.getName()); if (props == null || type != props.getType()) { props = new BeanProperties(type); this.cache.put(type.getName(), props); } return props.get(ctx, prop); }
private final BeanProperty property(ELContext ctx, Object base, Object property) { Class<?> type = base.getClass(); String prop = property.toString(); BeanProperties props = this.cache.get(type.getName()); if (props == null || type != props.getType()) { props = new BeanProperties(type); this.cache.put(type.getName(), props); } return props.get(ctx, prop); }
private final BeanProperty property(ELContext ctx, Object base, Object property) { Class<?> type = base.getClass(); String prop = property.toString(); BeanProperties props = this.cache.get(type.getName()); if (props == null || type != props.getType()) { props = new BeanProperties(type); this.cache.put(type.getName(), props); } return props.get(ctx, prop); }
private BeanProperty property(ELContext ctx, Object base, Object property) { Class<?> type = base.getClass(); String prop = property.toString(); BeanProperties props = this.cache.get(type.getName()); if (props == null || type != props.getType()) { props = new BeanProperties(type); this.cache.put(type.getName(), props); } return props.get(ctx, prop); }
private final BeanProperty property(ELContext ctx, Object base, Object property) { Class<?> type = base.getClass(); String prop = property.toString(); BeanProperties props = this.cache.get(type.getName()); if (props == null || type != props.getType()) { props = new BeanProperties(type); this.cache.put(type.getName(), props); } return props.get(ctx, prop); }
private BeanProperty property(ELContext ctx, Object base, Object property) { Class<?> type = base.getClass(); String prop = property.toString(); BeanProperties props = this.cache.get(type.getName()); if (props == null || type != props.getType()) { props = new BeanProperties(type); this.cache.put(type.getName(), props); } return props.get(ctx, prop); }
private final BeanProperty property(ELContext ctx, Object base, Object property) { Class<?> type = base.getClass(); String prop = property.toString(); BeanProperties props = this.cache.get(type.getName()); if (props == null || type != props.getType()) { props = new BeanProperties(type); this.cache.put(type.getName(), props); } return props.get(ctx, prop); }
private BeanProperty property(ELContext ctx, Object base, Object property) { Class<?> type = base.getClass(); String prop = property.toString(); BeanProperties props = this.cache.get(type.getName()); if (props == null || type != props.getType()) { props = new BeanProperties(type); this.cache.put(type.getName(), props); } return props.get(ctx, prop); }