JavaTM Platform
Standard Ed. 6

javax.xml.crypto.dsig.spec
类 XPathType

java.lang.Object
  继承者 javax.xml.crypto.dsig.spec.XPathType

public class XPathType
     
extends Object

W3C Recommendation for XML-Signature XPath Filter 2.0 中所定义的 XPath 元素的 XML 模式定义:


 <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>
 

从以下版本开始:
1.6
另请参见:
XPathFilter2ParameterSpec

嵌套类摘要
static class XPathType.Filter
          表示过滤器设置操作。
 
构造方法摘要
XPathType(String expression, XPathType.Filter filter)
          创建带有指定 XPath 表达式和过滤器的 XPathType 实例。
XPathType(String expression, XPathType.Filter filter, Map namespaceMap)
          创建带有指定 XPath 表达式、过滤器和名称空间映射表的 XPathType 实例。
 
方法摘要
 String getExpression()
          返回要计算的 XPath 表达式。
 XPathType.Filter getFilter()
          返回过滤操作。
 Map getNamespaceMap()
          返回名称空间前缀的映射表。
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

构造方法详细信息

XPathType

public XPathType(String expression,
                 XPathType.Filter filter)
创建带有指定 XPath 表达式和过滤器的 XPathType 实例。

参数:
expression - 要计算的 XPath 表达式
filter - 过滤操作 ( XPathType.Filter.INTERSECTXPathType.Filter.SUBTRACTXPathType.Filter.UNION)
抛出:
NullPointerException - 如果 expressionfilternull

XPathType

public XPathType(String expression,
                 XPathType.Filter filter,
                 Map namespaceMap)
创建带有指定 XPath 表达式、过滤器和名称空间映射表的 XPathType 实例。复制该映射表,以防止随后被修改。

参数:
expression - 要计算的 XPath 表达式
filter - 过滤操作 ( XPathType.Filter.INTERSECTXPathType.Filter.SUBTRACTXPathType.Filter.UNION)
namespaceMap - 名称空间前缀的映射表。每个密钥都是一个命名空间前缀 String,它将映射到相应的命名空间 URI String
抛出:
NullPointerException - 如果 expressionfilternamespaceMapnull
ClassCastException - 如果任何映射密钥或条目的类型不是 String
方法详细信息

getExpression

public String getExpression()
返回要计算的 XPath 表达式。

返回:
要计算的 XPath 表达式

getFilter

public XPathType.Filter getFilter()
返回过滤操作。

返回:
过滤操作

getNamespaceMap

public Map getNamespaceMap()
返回名称空间前缀的映射表。每个密钥都是一个命名空间前缀 String,它将映射到相应的命名空间 URI String

此实现返回一个不可修改的映射表

返回:
命名空间前缀到名称空间 URI 的 Map(可以为空,但不能为 null

JavaTM Platform
Standard Ed. 6

提交错误或意见
有关更多的 API 参考资料和开发人员文档,请参阅 Java SE 开发人员文档。该文档包含更详细的、面向开发人员的描述,以及总体概述、术语定义、使用技巧和工作代码示例。

版权所有 2007 Sun Microsystems, Inc. 保留所有权利。 请遵守许可证条款。另请参阅文档重新分发政策