XPathTypepublic class XPathType extends Object The XML Schema Definition of the XPath element as defined in the
W3C Recommendation for XML-Signature XPath Filter 2.0:
<schema xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:xf="http://www.w3.org/2002/06/xmldsig-filter2"
targetNamespace="http://www.w3.org/2002/06/xmldsig-filter2"
version="0.1" elementFormDefault="qualified">
<element name="XPath"
type="xf:XPathType"/>
<complexType name="XPathType">
<simpleContent>
<extension base="string">
<attribute name="Filter">
<simpleType>
<restriction base="string">
<enumeration value="intersect"/>
<enumeration value="subtract"/>
<enumeration value="union"/>
</restriction>
</simpleType>
</attribute>
</extension>
</simpleContent>
</complexType>
|
Fields Summary |
---|
private final String | expression | private final Filter | filter | private Map | nsMap |
Constructors Summary |
---|
public XPathType(String expression, Filter filter)Creates an XPathType instance with the specified XPath
expression and filter.
if (expression == null) {
throw new NullPointerException("expression cannot be null");
}
if (filter == null) {
throw new NullPointerException("filter cannot be null");
}
this.expression = expression;
this.filter = filter;
this.nsMap = Collections.EMPTY_MAP;
| public XPathType(String expression, Filter filter, Map namespaceMap)Creates an XPathType instance with the specified XPath
expression, filter, and namespace map. The map is copied to protect
against subsequent modification.
this(expression, filter);
if (namespaceMap == null) {
throw new NullPointerException("namespaceMap cannot be null");
}
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.lang.String | getExpression()Returns the XPath expression to be evaluated.
return expression;
| public javax.xml.crypto.dsig.spec.XPathType$Filter | getFilter()Returns the filter operation.
return filter;
| public java.util.Map | getNamespaceMap()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 nsMap;
|
|