final PropertyAccessor ognlPropertyAccessor = OgnlRuntime.getPropertyAccessor(targetClass);
public boolean shouldCreateIfNew(Class parentClass, String property, Object target, String keyProperty, boolean isIndexAccessed) { try { System.out.println("ognl:"+OgnlRuntime.getPropertyAccessor(Map.class)+" this:"+this); } catch (OgnlException e) { // TODO Auto-generated catch block e.printStackTrace(); } return isShouldCreateIfNew(); }
public Object getProperty(Map context, Object target, Object name) throws OgnlException { ObjectProxy proxy = (ObjectProxy) target; setupContext(context, proxy); return OgnlRuntime.getPropertyAccessor(proxy.getValue().getClass()).getProperty(context, target, name); }
public void setProperty(Map context, Object target, Object name, Object value) throws OgnlException { ObjectProxy proxy = (ObjectProxy) target; setupContext(context, proxy); OgnlRuntime.getPropertyAccessor(proxy.getValue().getClass()).setProperty(context, target, name, value); }
public static void setProperty(OgnlContext context, Object target, Object name, Object value) throws OgnlException { PropertyAccessor accessor; if (target == null) { throw new OgnlException("target is null for setProperty(null, \"" + name + "\", " + value + ")"); } if ((accessor = getPropertyAccessor(getTargetClass(target))) == null) { throw new OgnlException("No property accessor for " + getTargetClass(target).getName()); } accessor.setProperty(context, target, name, value); }
public static void setProperty(OgnlContext context, Object target, Object name, Object value) throws OgnlException { PropertyAccessor accessor; if (target == null) { throw new OgnlException("target is null for setProperty(null, \"" + name + "\", " + value + ")"); } if ((accessor = getPropertyAccessor(getTargetClass(target))) == null) { throw new OgnlException("No property accessor for " + getTargetClass(target).getName()); } accessor.setProperty(context, target, name, value); }
public static Object getProperty(OgnlContext context, Object source, Object name) throws OgnlException { PropertyAccessor accessor; if (source == null) { throw new OgnlException("source is null for getProperty(null, \"" + name + "\")"); } if ((accessor = getPropertyAccessor(getTargetClass(source))) == null) { throw new OgnlException("No property accessor for " + getTargetClass(source).getName()); } return accessor.getProperty(context, source, name); }
public static final Object getProperty( OgnlContext context, Object source, Object name ) throws OgnlException { PropertyAccessor accessor; if (source == null) { throw new OgnlException("source is null for getProperty(null, \"" + name + "\")"); } if ((accessor = getPropertyAccessor(getTargetClass(source))) == null) { throw new OgnlException("No property accessor for " + getTargetClass(source).getName()); } return accessor.getProperty( context, source, name ); }
public static final void setProperty( OgnlContext context, Object target, Object name, Object value ) throws OgnlException { PropertyAccessor accessor; if (target == null) { throw new OgnlException("target is null for setProperty(null, \"" + name + "\", " + value + ")"); } if ((accessor = getPropertyAccessor(getTargetClass(target))) == null) { throw new OgnlException("No property accessor for " + getTargetClass(target).getName()); } accessor.setProperty( context, target, name, value ); }
public static Object getProperty(OgnlContext context, Object source, Object name) throws OgnlException { PropertyAccessor accessor; if (source == null) { throw new OgnlException("source is null for getProperty(null, \"" + name + "\")"); } if ((accessor = getPropertyAccessor(getTargetClass(source))) == null) { throw new OgnlException("No property accessor for " + getTargetClass(source).getName()); } return accessor.getProperty(context, source, name); }
PropertyAccessor accessor=OgnlRuntime.getPropertyAccessor(Collection.class); ReflectionContextState.setGettingByKeyProperty(ogContext,true); return accessor.getProperty(ogContext,propVal,objects[0]);
} else PropertyAccessor p = OgnlRuntime.getPropertyAccessor(target.getClass()); PropertyAccessor pa = OgnlRuntime.getPropertyAccessor(context.getCurrentObject().getClass());
} else PropertyAccessor p = OgnlRuntime.getPropertyAccessor(target.getClass()); PropertyAccessor pa = OgnlRuntime.getPropertyAccessor(context.getCurrentObject().getClass());
protected OGNLAttributeEvaluator createOGNLEvaluator() { try { PropertyAccessor objectPropertyAccessor = OgnlRuntime.getPropertyAccessor(Object.class); PropertyAccessor applicationContextPropertyAccessor = new NestedObjectDelegatePropertyAccessor<>( new TilesApplicationContextNestedObjectExtractor(), objectPropertyAccessor); PropertyAccessor anyScopePropertyAccessor = new AnyScopePropertyAccessor(); PropertyAccessor scopePropertyAccessor = new ScopePropertyAccessor(); PropertyAccessorDelegateFactory<Request> factory = new TilesContextPropertyAccessorDelegateFactory( objectPropertyAccessor, applicationContextPropertyAccessor, anyScopePropertyAccessor, scopePropertyAccessor); PropertyAccessor tilesRequestAccessor = new DelegatePropertyAccessor<>(factory); OgnlRuntime.setPropertyAccessor(Request.class, tilesRequestAccessor); return new OGNLAttributeEvaluator(); } catch (OgnlException e) { throw new TilesContainerFactoryException("Cannot initialize OGNL evaluator", e); } }
PropertyAccessor p = OgnlRuntime.getPropertyAccessor(target.getClass()); PropertyAccessor pa = OgnlRuntime.getPropertyAccessor(context.getCurrentObject().getClass());
PropertyAccessor p = OgnlRuntime.getPropertyAccessor(target.getClass()); PropertyAccessor pa = OgnlRuntime.getPropertyAccessor(context.getCurrentObject().getClass());
/** * Creates the OGNL evaluator. * * @return The OGNL evaluator. */ private OGNLAttributeEvaluator createOGNLEvaluator() { try { PropertyAccessor objectPropertyAccessor = OgnlRuntime.getPropertyAccessor(Object.class); PropertyAccessor applicationContextPropertyAccessor = new NestedObjectDelegatePropertyAccessor<Request>( new TilesApplicationContextNestedObjectExtractor(), objectPropertyAccessor); PropertyAccessor anyScopePropertyAccessor = new AnyScopePropertyAccessor(); PropertyAccessor scopePropertyAccessor = new ScopePropertyAccessor(); PropertyAccessorDelegateFactory<Request> factory = new TilesContextPropertyAccessorDelegateFactory( objectPropertyAccessor, applicationContextPropertyAccessor, anyScopePropertyAccessor, scopePropertyAccessor); PropertyAccessor tilesRequestAccessor = new DelegatePropertyAccessor<Request>(factory); OgnlRuntime.setPropertyAccessor(Request.class, tilesRequestAccessor); return new OGNLAttributeEvaluator(); } catch (OgnlException e) { throw new TilesContainerFactoryException("Cannot initialize OGNL evaluator", e); } } }