public Object getProperty(Map context, Object target, Object name) throws OgnlException { return target instanceof VariableResolver && name instanceof String ? ((VariableResolver)target).resolveVariable((String)name): null; } public void setProperty(Map context, Object target, Object name, Object value)
public Object resolveVariable(String name) { return _resolver != null ? _resolver.resolveVariable(name): null; } }
public Object get(Object key) { return _resolver.resolveVariable((String)key); }
/** * Resolves variable name by name. It can resolve a spring bean, spring * security authentication and spring web flow variables depending upon ZK * Spring libraries in the classpath */ public Object resolveVariable(String name) { Object o = null; for (VariableResolver resolver : _variableResolvers) { o = resolver.resolveVariable(name); if (o != null) { return o; } } return o; }
public Object getValue() { if (_values != null) { final Object o = _values.get(_name); if (o != null || _values.containsKey(_name)) return o; } return _resolver.resolveVariable(_name); } public void setValue(Object value) {
public Object resolveVariable(String name) throws XelException { if (_vars != null) { final Object o = _vars.get(name); if (o != null) return o; } return _parent instanceof VariableResolverX ? ((VariableResolverX)_parent).resolveVariable(null, null, name): _parent != null ? _parent.resolveVariable(name): null; } }
public boolean isResolveable(String name) { return (this.variableResolvers != null && this.variableResolvers.containsKey(name)) || (_values != null && _values.containsKey(name)) || (_resolver != null && _resolver.resolveVariable(name) != null) || (this.nextFactory != null && this.nextFactory.isResolveable(name)); } public boolean isTarget(String name) {
public Object resolveVariable(String name) throws XelException { VariableResolver vr = getVariableResolver(comp); return vr == null ? null : vr.resolveVariable(name); } };
public VariableResolver getVariableResolver(String name) { if (_values != null && _values.containsKey(name) || (_resolver != null && _resolver.resolveVariable(name) != null)) { return this.variableResolvers != null && this.variableResolvers.containsKey(name) ? (VariableResolver)this.variableResolvers.get(name): new VarResolver(name); } return this.nextFactory != null ? this.nextFactory.getVariableResolver(name): null; } public boolean isResolveable(String name) {
public Object getValue(ELContext ctx, Object base, Object property) throws PropertyNotFoundException, ELException { if (ctx == null) throw new IllegalArgumentException(); if (base == null) { ctx.setPropertyResolved(true); if (property != null) return _resolver.resolveVariable(property.toString()); } return ctx.isPropertyResolved() ? null: DEFAULT.getValue(ctx, base, property); } public Class getType(ELContext ctx, Object base, Object property)
public Object getExtraXelVariable(XelContext ctx, Object base, Object name) { //Note this method searches only _resolvers if (_resolvers != null) { for (Iterator it = CollectionsX.comodifiableIterator(_resolvers); it.hasNext();) { final VariableResolver vr = (VariableResolver) it.next(); final Object o = vr instanceof VariableResolverX ? ((VariableResolverX) vr).resolveVariable(ctx, base, name) : base == null && name != null ? vr.resolveVariable(name.toString()) : null; if (o != null) return o; } } return null; }
public Class getType(ELContext ctx, Object base, Object property) throws PropertyNotFoundException, ELException { if (ctx == null) throw new IllegalArgumentException(); if (base == null) { ctx.setPropertyResolved(true); if (property != null) { Object obj = _resolver.resolveVariable(property.toString()); return obj != null ? obj.getClass() : null; } } return ctx.isPropertyResolved() ? null: DEFAULT.getType(ctx, base, property); }
public Object resolve(XelContext ctx, Object base, Object name) { Object o = ctx.getVariableResolver(); return (o instanceof VariableResolverX) ? ((VariableResolverX)o).resolveVariable(ctx, base, name): o != null && base == null && name != null ? ((VariableResolver)o).resolveVariable(name.toString()): null; } };
public Object resolveVariable(String name) { if (custom != null) { final Object o = custom instanceof VariableResolverX ? ((VariableResolverX)custom).resolveVariable(null, null, name): custom.resolveVariable(name); if (o != null) return o; } return getSegmentedLabels().get(name); } }
/** Resolves the variable based on the the specified context and * variable resolver. * @since 5.0.0 */ public static Object resolveVariable(XelContext ctx, VariableResolver resolver, Object base, Object name) { if (resolver instanceof VariableResolverX) { if (ctx == null) ctx = new SimpleXelContext(resolver); return ((VariableResolverX)resolver).resolveVariable(ctx, base, name); } else if (resolver != null && base == null && name != null) return resolver.resolveVariable(name.toString()); return null; } /** Resolves the variable based on the specified context.
private Object getObjectByName(PsdoCompFunctor functor, String name, Class<?> type, List<VariableResolver> resolvers) { Object result = functor.getXelVariable(name); if (isValidValue(result, type)) return result; if (resolvers != null) for (VariableResolver resv : resolvers) { result = resv.resolveVariable(name); if (isValidValue(result, type)) return result; } result = functor.getImplicit(name); return isValidValue(result, type) ? result : null; }
/** Resolves the variable based on the specified context. * If the variable resolver ({@link XelContext#getVariableResolver} * is an instance of {@link VariableResolverX}, then * {@link VariableResolverX#resolveVariable(XelContext,Object,Object)} * will be invoked. * @param ctx the context. If null, null will be returned. * @since 5.0.0 */ public static Object resolveVariable(XelContext ctx, Object base, Object name) { if (ctx != null) { VariableResolver resolver = ctx.getVariableResolver(); if (resolver instanceof VariableResolverX) return ((VariableResolverX)resolver).resolveVariable(ctx, base, name); else if (resolver != null && base == null && name != null) return resolver.resolveVariable(name.toString()); } return null; } /** Resolves the variable based on the specified resolver.
public Object resolveVariable(String name) throws XelException { final RequestContext jc = RequestContexts.getCurrent(); if (jc != null) { final VariableResolver parent = jc.getVariableResolver(); if (parent != null) return parent instanceof VariableResolverX ? ((VariableResolverX) parent).resolveVariable(null, null, name) : parent.resolveVariable(name); } return null; } }
protected Object resolve(ELContext ctx, Object base, Object property) { VariableResolver resolver = _ctx.getVariableResolver(); if (resolver != null) { if (resolver instanceof VariableResolverX) { final Object o = ((VariableResolverX)resolver) .resolveVariable(_ctx, base, property); //in order to call static method, we can't set property as resolved if (o != null) ctx.setPropertyResolved(true); // Bug ZK-3021 if (REFERENCE_BINDING != null && o != null) { if (REFERENCE_BINDING.isAssignableFrom(o.getClass())) { try { return GET_VALUE.invoke(o, new Object[]{null}); } catch (Exception e) { // do nothing. } } } return o; } else if (base == null && property != null) { final Object o = resolver.resolveVariable(property.toString()); //in order to call static method, we can't set property as resolved if (o != null) ctx.setPropertyResolved(true); return o; } } return null; } public Class<?> getType(ELContext ctx, Object base, Object property)