/** * Get paxml entity by name, triggering the parse if needed. * * @param name * the tag name * @return the parsed entity, or null if not found. */ public IEntity getEntity(String name) { return parser.getResourceLocator().getEntity(name, null); }
/** * Get paxml entity by name, triggering the parse if needed. * * @param name * the tag name * @return the parsed entity, or null if not found. */ public IEntity getEntity(String name) { return parser.getResourceLocator().getEntity(name, null); }
/** * {@inheritDoc} */ @Override protected Object doInvoke(Context context) { Object val = getValue(); String entityName = val == null ? null : val.toString().trim(); if (StringUtils.isBlank(entityName)) { val = getEntity().printTree(0); } else { ResourceLocator locator = getResourceLocator(); PaxmlResource res = locator.getResource(entityName); val = getResourceLocator().getEntity(entityName, null); } return val; }
/** * {@inheritDoc} */ @Override protected Object doInvoke(Context context) { Object val = getValue(); String entityName = val == null ? null : val.toString().trim(); if (StringUtils.isBlank(entityName)) { val = getEntity().printTree(0); } else { ResourceLocator locator = getResourceLocator(); PaxmlResource res = locator.getResource(entityName); val = getResourceLocator().getEntity(entityName, null); } return val; }
/** * Inspect a parsed paxml entity. * * @param name * the name of the paxml entity * @return the printed xml tree in string. */ public String inspectEntity(String name) { AbstractTag tag = ((AbstractTag) parser.getResourceLocator().getEntity(name, null)); if (tag == null) { throw new PaxmlRuntimeException("No resource found from locator: " + parser.getResourceLocator().getResourceNames()); } return tag.printTree(0); }
/** * Inspect a parsed paxml entity. * * @param name * the name of the paxml entity * @return the printed xml tree in string. */ public String inspectEntity(String name) { AbstractTag tag = ((AbstractTag) parser.getResourceLocator().getEntity(name, null)); if (tag == null) { throw new PaxmlRuntimeException("No resource found from locator: " + parser.getResourceLocator().getResourceNames()); } return tag.printTree(0); }
/** * {@inheritDoc} */ @Override protected Object invoke(Context subContext) throws Exception { // the target resource should have been parsed during "factory time", // just find it with no parser context IEntity paxml = getResourceLocator().getEntity(targetResource.getName(), null); if (paxml != null) { final Object existingResult = subContext.getInvocationResult(); Object result = paxml.execute(subContext); subContext.setInvocationResult(existingResult); return result; } else { throw new PaxmlRuntimeException("Target resource not found: " + targetResource.getName()); } }
/** * {@inheritDoc} */ @Override protected Object invoke(Context subContext) throws Exception { // the target resource should have been parsed during "factory time", // just find it with no parser context IEntity paxml = getResourceLocator().getEntity(targetResource.getName(), null); if (paxml != null) { final Object existingResult = subContext.getInvocationResult(); Object result = paxml.execute(subContext); subContext.setInvocationResult(existingResult); return result; } else { throw new PaxmlRuntimeException("Target resource not found: " + targetResource.getName()); } }