FileDocCategorySizeDatePackage
XPathFilterParameterSpec.javaAPI DocJava SE 6 API3386Tue Jun 10 00:27:06 BST 2008javax.xml.crypto.dsig.spec

XPathFilterParameterSpec

public final class XPathFilterParameterSpec extends Object implements TransformParameterSpec
Parameters for the XPath Filtering Transform Algorithm. The parameters include the XPath expression and an optional Map of additional namespace prefix mappings. The XML Schema Definition of the XPath Filtering transform parameters is defined as:

<element name="XPath" type="string"/>
author
Sean Mullan
author
JSR 105 Expert Group
since
1.6
see
Transform

Fields Summary
private String
xPath
private Map
nsMap
Constructors Summary
public XPathFilterParameterSpec(String xPath)
Creates an XPathFilterParameterSpec with the specified XPath expression.

param
xPath the XPath expression to be evaluated
throws
NullPointerException if xPath is null

	if (xPath == null) {
	    throw new NullPointerException();
	}
	this.xPath = xPath;
	this.nsMap = Collections.EMPTY_MAP;
    
public XPathFilterParameterSpec(String xPath, Map namespaceMap)
Creates an XPathFilterParameterSpec with the specified XPath expression and namespace map. The map is copied to protect against subsequent modification.

param
xPath the XPath expression to be evaluated
param
namespaceMap the map of namespace prefixes. Each key is a namespace prefix String that maps to a corresponding namespace URI String.
throws
NullPointerException if xPath or namespaceMap are null
throws
ClassCastException if any of the map's keys or entries are not of type String

        if (xPath == null || namespaceMap == null) {
            throw new NullPointerException();
        }
        this.xPath = xPath;
	nsMap = new HashMap(namespaceMap);
	Iterator entries = nsMap.entrySet().iterator();
	while (entries.hasNext()) {
	    Map.Entry me = (Map.Entry) entries.next();
	    if (!(me.getKey() instanceof String) || 
		!(me.getValue() instanceof String)) {
		throw new ClassCastException("not a String");
	    }
	}
	nsMap = Collections.unmodifiableMap(nsMap);
    
Methods Summary
public java.util.MapgetNamespaceMap()
Returns a map of namespace prefixes. Each key is a namespace prefix String that maps to a corresponding namespace URI String.

This implementation returns an {@link Collections#unmodifiableMap unmodifiable map}.

return
a Map of namespace prefixes to namespace URIs (may be empty, but never null)

	return nsMap;
    
public java.lang.StringgetXPath()
Returns the XPath expression to be evaluated.

return
the XPath expression to be evaluated

	return xPath;