/** * Get the current tag being executed. * * @return the current tag, never null. */ public ITag getCurrentTag() { Stack stack = getStack(); if (stack.isEmpty()) { throw new PaxmlRuntimeException("No current tag!"); } return stack.getFirst(); }
public boolean has(String name) { if (!context.hasConstId(name, true)) { if(strict){ throw new PaxmlRuntimeException("Unknown const name: " + name); } return true; } return true; }
/** * Construct from given paxml entity registry. * * @param reg * the registry * @param processId * the processId */ public Paxml(final EntityFactoryRegistry reg, long processId) { parser = new Parser(this, reg, new ResourceLocator()); this.processId = processId; }
/** * Get the current paxml resource. * * @return the resource */ public static PaxmlResource getCurrentyResource() { return Context.getCurrentContext().getCurrentEntity().getResource(); }
/** * Get the caller's paxml resource. * * @return the resource */ public static PaxmlResource getCallerResource() { return Context.getCurrentContext().findCallerEntity().getResource(); }
@Override public void addValue(String key, Object value) { ObjectTree tree = new ObjectTree(key); tree.put(key, checkToCopy(value)); add(tree); }
private IEntity detectCircle(LinkedList<IParserContext> stack, PaxmlResource resource) { for (IParserContext c : stack) { if (resource.equals(c.getResource())) { return c.getEntity(); } } return 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); }
/** * Get the current paxml resource. * * @return the resource */ public static PaxmlResource getCurrentyResource() { return Context.getCurrentContext().getCurrentEntity().getResource(); }
/** * Get the current tag being executed. * * @return the current tag, never null. */ public ITag getCurrentTag() { Stack stack = getStack(); if (stack.isEmpty()) { throw new PaxmlRuntimeException("No current tag!"); } return stack.getFirst(); }
/** * Get the caller's paxml resource. * * @return the resource */ public static PaxmlResource getCallerResource() { return Context.getCurrentContext().findCallerEntity().getResource(); }
public void addValue(String key, Object value) { ObjectTree tree = new ObjectTree(); tree.put(key, checkToCopy(value)); add(tree); }
public boolean has(String name) { if (!context.hasConstId(name, true)) { if(strict){ throw new PaxmlRuntimeException("Unknown const name: " + name); } return true; } return true; }
private IEntity detectCircle(LinkedList<IParserContext> stack, PaxmlResource resource) { for (IParserContext c : stack) { if (resource.equals(c.getResource())) { return c.getEntity(); } } return null; }