public ResourceLocator getResourceLocator() { return parser.getResourceLocator(); }
public ResourceLocator getResourceLocator() { return parser.getResourceLocator(); }
/** * 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); }
/** * Remove paxml resources. * * @param resources * the resources * @return this */ public Paxml removeResources(PaxmlResource... resources) { for (PaxmlResource resource : resources) { parser.getResourceLocator().removeResource(resource); } return this; }
/** * Remove paxml resources. * * @param resources * the resources * @return this */ public Paxml removeResources(PaxmlResource... resources) { for (PaxmlResource resource : resources) { parser.getResourceLocator().removeResource(resource); } return this; }
/** * 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); }
/** * Add paxml resources. * * @param resources * the resources. * @return this */ public Paxml addResources(PaxmlResource... resources) { for (PaxmlResource resource : resources) { parser.getResourceLocator().addResource(resource); } return this; }
/** * Add paxml resources. * * @param resources * the resources. * @return this */ public Paxml addResources(PaxmlResource... resources) { for (PaxmlResource resource : resources) { parser.getResourceLocator().addResource(resource); } return this; }
/** * Add paxml resources. * * @param resources * the resources * @return this */ public Paxml addResources(Collection<PaxmlResource> resources) { for (PaxmlResource resource : resources) { parser.getResourceLocator().addResource(resource); } return this; }
/** * Add paxml resources. * * @param resources * the resources * @return this */ public Paxml addResources(Collection<PaxmlResource> resources) { for (PaxmlResource resource : resources) { parser.getResourceLocator().addResource(resource); } return this; }
/** * Remove paxml resources. * * @param resources * the resources * @return this */ public Paxml removeResources(Collection<PaxmlResource> resources) { for (PaxmlResource resource : resources) { parser.getResourceLocator().removeResource(resource); } return this; }
/** * Remove paxml resources. * * @param resources * the resources * @return this */ public Paxml removeResources(Collection<PaxmlResource> resources) { for (PaxmlResource resource : resources) { parser.getResourceLocator().removeResource(resource); } return this; }
/** * 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); }
/** * Parse an xml root element. * * @param root * the root ele * @param resource * the resource containing the root ele * @param context * the parser context * @return the paxml entity, return null if root tag is unknown. */ public IEntity parseXml(OMElement root, PaxmlResource resource, IParserContext context) { if (context == null) { context = AbstractPaxmlEntityFactory.createParserContext(root, resource, getResourceLocator()); } String tagName = root.getQName().getLocalPart(); IEntityFactory factory = registry.lookup(tagName); if (factory == null) { if (log.isWarnEnabled()) { log.warn("Entity factory not found for root tag <" + tagName + "> in resource: " + resource); } return null; } IEntity entity = factory.create(root, context); return entity; }
/** * Parse an xml root element. * * @param root * the root ele * @param resource * the resource containing the root ele * @param context * the parser context * @return the paxml entity, return null if root tag is unknown. */ public IEntity parseXml(OMElement root, PaxmlResource resource, IParserContext context) { if (context == null) { context = AbstractPaxmlEntityFactory.createParserContext(root, resource, getResourceLocator()); } String tagName = root.getQName().getLocalPart(); IEntityFactory factory = registry.lookup(tagName); if (factory == null) { if (log.isWarnEnabled()) { log.warn("Entity factory not found for root tag <" + tagName + "> in resource: " + resource); } return null; } IEntity entity = factory.create(root, context); return entity; }