/** * Create a new object instance for a given XPath, relative to the parentObject. * * @param <T> * The return type of this method corresponds to the returnType parameter. * @param parentObject * The XPath will be executed relative to this object. * @param xPath * The XPath statement. * @param namespaceResolver * A NamespaceResolver containing the prefix/URI pairings from the XPath statement. * @param returnType * The return type. * * @return * An instance of the Java class mapped to the supplied XML type, or null * if no result was found. */ public <T> T createByXPath(Object parentObject, String xPath, NamespaceResolver namespaceResolver, Class<T> returnType) { return getXMLContext().createByXPath(parentObject, xPath, namespaceResolver, returnType); }
/** * Create a new object instance for a given XPath, relative to the parentObject. * * @param <T> * The return type of this method corresponds to the returnType parameter. * @param parentObject * The XPath will be executed relative to this object. * @param xPath * The XPath statement. * @param namespaceResolver * A NamespaceResolver containing the prefix/URI pairings from the XPath statement. * @param returnType * The return type. * * @return * An instance of the Java class mapped to the supplied XML type, or null * if no result was found. */ public <T> T createByXPath(Object parentObject, String xPath, NamespaceResolver namespaceResolver, Class<T> returnType) { return getXMLContext().createByXPath(parentObject, xPath, namespaceResolver, returnType); }