public int restore(WriteableBeanLocator target, String tokenid) { int restored = 0; for (Iterator keyit = requestmap.keySet().iterator(); keyit.hasNext();) { String key = (String) keyit.next(); IUPSMapping spec = (IUPSMapping) iupsspecs.get(key); if (spec != null) { String[] value = (String[]) requestmap.get(key); bma.setBeanValue(spec.beanpath, target, value, null, false); if (value != null) { outgoingparams.add(new UIParameter(key, value[0])); ++ restored; } } } return restored; }
public void init() { if (seedpath != null) { seed = bma.getBeanValue(seedpath, seed, null); } }
public boolean remove(String beanname) { if (sebl.removeEL == null) { throw new UnsupportedOperationException("Cannot implement removal from EntityBeanLocator without removeEL being set"); } // TODO: support the case where the fetch method signature accepts an object // rather than its ID Object togo = sebl.bma.invokeBeanMethod(PathUtil.composePath(sebl.removeEL, '\'' + beanname + '\''), beanlocator); delivered.remove(beanname); if (togo == null) return false; if (togo instanceof Boolean) { return ((Boolean)togo).booleanValue(); } return true; }
UIParameter param = (UIParameter) paramlist.get(i); if (param instanceof UIELBinding) { bma.setBeanValue(((UIELBinding) param).valuebinding.value, beanLocator, ((UIELBinding) param).rvalue, null, false); Object beanReturn = null; if (methodBinding != null) { ShellInfo shells = bma.fetchShells(methodBinding, beanLocator, true); beanReturn = bma.invokeBeanMethod(shells, null);
guard = darapplier.getBeanValue(guardEL, rbl, null); if (guard == null) { throw new IllegalArgumentException("null value found for guard EL path " + guardEL); guard = ((ValidatorGetter)guard).get(); Object guarded = darapplier.getBeanValue(match, rbl, null); try { if (guard instanceof RunnableInvoker) { try { if (guardmethod != null) { darapplier.invokeBeanMethod(guardmethod, guard); darapplier.setBeanValue(guardproperty, guard, guarded, errors, false);
public Object invokeAction(String actionbinding, String knownvalue) { if (!addressibleBeanModel.isMatch(actionbinding)) { throw UniversalRuntimeException.accumulate(new SecurityException(), "Action binding " + actionbinding + " is not permissible - make sure to mark this path as request addressible - http://www2.caret.cam.ac.uk/rsfwiki/Wiki.jsp?page=RequestWriteableBean"); } ShellInfo shells = darapplier.fetchShells(actionbinding, rbl, true); int lastshell = shells.shells.length; for (int i = 0; i < lastshell; ++ i) { if (shells.shells[i] instanceof ActionTarget) { lastshell = i + 1; } } Object penultimatebean = shells.shells[lastshell - 1]; String actionname = shells.segments[lastshell - 1]; // The only ActionTarget in the world is FlowActionProxyBean, we are not // planning to keep it up if (penultimatebean instanceof ActionTarget) { Object returnvalue = ((ActionTarget) penultimatebean).invokeAction( actionname, knownvalue); return returnvalue; } else { return darapplier.invokeBeanMethod(shells, addressibleBeanModel); } }
try { Object newflat = darapplier.getFlattenedValue("", sve.newvalue, sve.oldvalue.getClass(), null); Object oldflat = darapplier.getFlattenedValue("", sve.oldvalue, sve.oldvalue.getClass(), null); Object reshapero = null; if (sve.reshaperbinding != null) { reshapero = darapplier.getBeanValue(sve.reshaperbinding, rbl, addressibleBeanModel); ShellInfo shellinfo = darapplier.fetchShells(sve.valuebinding, rbl, false); reshapero = dataConverterRegistry.fetchConverter(shellinfo);
ShellInfo shells = alterer.fetchShells(valuebinding.value, root, false); renderer = alterer.getBeanValue(((ELReference) renderer).value, beanlocator, null); if (bound != null && bound.darreshaper == null) {
if (toprocess.arguments[i] instanceof ELReference) { ELReference elref = (ELReference) toprocess.arguments[i]; String flatvalue = (String) alterer.getFlattenedValue(elref.value, beanlocator, String.class, null); toprocess.arguments[i] = flatvalue; Object flatvalue = null; try { flatvalue = alterer.getFlattenedValue(stripbinding, root, oldvalue .getClass(), resolver); Object flatvalue = alterer.getFlattenedValue(null, oldvalue, oldvalue .getClass(), resolver); if (flatvalue != null) { if (toprocess.markup instanceof ELReference) { ELReference ref = (ELReference) toprocess.markup; toprocess.markup = alterer.getBeanValue(ref.value, beanlocator, null); Object flatvalue = alterer.getFlattenedValue(null, toprocess.markup, toprocess.markup .getClass(), resolver); if (flatvalue != null) {
private void putAttr(Map target, String path, String attrname, ViewParameters torender) { Object attrval = bma.getFlattenedValue(path, torender, null, null); if (attrval instanceof String[]) { target.put(attrname, attrval); } else if (attrval instanceof String) { target.put(attrname, new String[] { (String) attrval }); } }
public void applyAlterations(DARList toapply, Map writeDepends) { try { BeanInvalidationBracketer bib = getBracketer(); darapplier.applyAlterations(rbl, toapply, new DAREnvironment(targettedMessageList, bib, addressibleBeanModel, dataConverterRegistry, writeDepends)); } finally { beanGuardProcessor.processPostGuards(bim, targettedMessageList, rbl); } }
public void interceptActionResult(ARIResult result, ViewParameters incoming, Object actionReturn) { if (!targettedMessageList.isError()) { for (int i = 0; i < pent.size(); ++i) { DataAlterationRequest dar = pent.DARAt(i); try { darapplier.applyAlteration(result, dar, null); } catch (Exception e) { Logger.log.info("Error applying binding to outgoing URL state", e); } } } }
UIParameter param = (UIParameter) paramlist.get(i); if (param instanceof UIELBinding) { bma.setBeanValue(((UIELBinding)param).valuebinding.value, beanLocator, ((UIELBinding)param).rvalue, null, false); Object beanReturn = null; if (methodBinding != null) { ShellInfo shells = bma.fetchShells(methodBinding, beanLocator, true); beanReturn = bma.invokeBeanMethod(shells, null);
public int preserve(BeanLocator source, String tokenid) { int preserved = 0; outgoingparams.clear(); for (Iterator specit = iupsspecs.values().iterator(); specit.hasNext();) { IUPSMapping spec = (IUPSMapping) specit.next(); String converted = (String) bma.getFlattenedValue(spec.beanpath, source, String.class, null); if (converted == null) continue; outgoingparams.add(new UIParameter(spec.urlkey, converted)); ++ preserved; } return preserved; }
bma.applyAlterations(target, toapply, null);
public boolean containsKey(Object key) { Object child = bma.getBeanValue((String) key, seed, null); return child != null; }
TargettedMessageList messages = ThreadErrorState.getErrorState().messages; alterer.setBeanValue(beanname, target, bean, messages, false);
public Object locateBean(String name) { Object togo = delivered.get(name); if (togo == null) { if (name.startsWith(NEW_PREFIX)) { if (sebl.newEL != null) { togo = sebl.bma.invokeBeanMethod(sebl.newEL, beanlocator); } else { togo = sebl.reflectivecache.construct(sebl.entityClazz); } } else { togo = sebl.bma.invokeBeanMethod(PathUtil.composePath(sebl.fetchEL, '\'' + name + '\''), beanlocator); } delivered.put(name, togo); } return togo; }
public RawURLState renderViewParams(ViewParameters torender) { RawURLState togo = new RawURLState(); togo.pathinfo = toPathInfo(torender); togo.params = renderViewParamAttributes(torender); String anchorfield = torender.getAnchorField(); if (anchorfield != null) { String value = (String) bma.getFlattenedValue(anchorfield, torender, String.class, null); togo.anchor = value; } return togo; }
public Object getBean(String beanpath) { return bma.getBeanValue(beanpath, beanlocator, null); }