XPathAPI.java revision 905b8e215b24a1b5d547692cef530c0d2ab545c9
/*
* The contents of this file are subject to the terms of the Common Development and
* Distribution License (the License). You may not use this file except in compliance with the
* License.
*
* You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
* specific language governing permission and limitations under the License.
*
* When distributing Covered Software, include this CDDL Header Notice in each file and include
* the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
* Header, with the fields enclosed by brackets [] replaced by your own identifying
* information: "Portions copyright [year] [name of copyright owner]".
*
* Copyright 2015-2016 ForgeRock AS.
*/
/**
* <code>XPathAPI</code> class provides the convenience function for XPath API
* that is a subset of Xalan XPathAPI but uses JAXP internally.
*/
public class XPathAPI {
static private final int CACHE_SIZE =
protected XPathFactory initialValue() {
return XPathFactory.newInstance();
}
};
private XPathAPI() {
}
/**
* Use an XPath string to select a single node.
* Namespace prefix is resolved using the document node.
*
* @param doc The node to start searching from with the embedded context.
* @param str XPath string.
* @return The first node found that matches the XPath, or null.
*
* @throws XPathException
*/
}
/**
* Use an XPath string to select a single node using a provided element namespace.
*
* @param doc The node to start searching from.
* @param str XPath string.
* @param nsNode Node where namespace prefix in XPath is resolved from.
* @return The first node found that matches the XPath, or null.
*
* @throws XPathException
*/
}
/**
* Use an XPath string to select a single node using a passed in namespace context.
*
* @param doc The node to start searching from.
* @param str XPath string.
* @param nsctx Namespace where the prefix in XPath is resolved from.
* @return The first node found that matches the XPath, or null.
*
* @throws XPathException
*/
public static Node selectSingleNode(Node doc, String str, NamespaceContext nsctx) throws XPathException {
return null;
}
}
/**
* Use an XPath string to select a nodelist.
* Namespace prefix is resolved using the document node.
*
* @param doc The node to start searching from.
* @param str XPath string.
* @return a NodeList of the matched result.
*
* @throws XPathException
*/
}
/**
* Use an XPath string to select a nodelist using a node namespace.
*
* @param doc The node to start searching from.
* @param str XPath string.
* @param nsNode Node where namespace prefix in XPath is resolved from.
* @return a NodeList of the matched result.
*
* @throws XPathException
*/
}
/**
* Use an XPath string to select a nodelist
* Namespace prefix is resolved using the the specified context.
*
* @param doc The node to start searching from.
* @param str XPath string.
* @param nsctx Namespace where the prefix in XPath is resolved from.
* @return a NodeList.
*
* @throws XPathException
*/
public static NodeList selectNodeList(Node doc, String str, NamespaceContext nsctx) throws XPathException {
}
/**
* SimpleNamespaceContext implements just enough NamespaceContext functionality
* for XPath.
*/
static class SimpleNamespaceContext implements NamespaceContext {
}
throw new IllegalArgumentException();
}
return "";
}
if (namespaceUri == null) {
throw new IllegalArgumentException();
}
}
}
return null;
}
} else {
}
}
}
}
}
}
}
}
}
}
}
}