本文整理汇总了Java中javax.xml.crypto.NodeSetData类的典型用法代码示例。如果您正苦于以下问题:Java NodeSetData类的具体用法?Java NodeSetData怎么用?Java NodeSetData使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
NodeSetData类属于javax.xml.crypto包,在下文中一共展示了NodeSetData类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: dereference
import javax.xml.crypto.NodeSetData; //导入依赖的package包/类
public Data dereference(URIReference ref, XMLCryptoContext ctxt) {
return new NodeSetData() {
public Iterator<Node> iterator() {
return Collections.singletonList(data).iterator();
}
};
}
示例2: dereference
import javax.xml.crypto.NodeSetData; //导入依赖的package包/类
@Override
public Data dereference(XMLCryptoContext context)
throws URIReferenceException
{
if (context == null) {
throw new NullPointerException("context cannot be null");
}
/*
* If URIDereferencer is specified in context; use it, otherwise use
* built-in.
*/
URIDereferencer deref = context.getURIDereferencer();
if (deref == null) {
deref = DOMURIDereferencer.INSTANCE;
}
Data data = deref.dereference(this, context);
// pass dereferenced data through Transforms
try {
for (Transform transform : transforms) {
data = transform.transform(data, context);
}
} catch (Exception e) {
throw new URIReferenceException(e);
}
// guard against RetrievalMethod loops
if (data instanceof NodeSetData && Utils.secureValidation(context)) {
NodeSetData nsd = (NodeSetData)data;
Iterator<?> i = nsd.iterator();
if (i.hasNext()) {
Node root = (Node)i.next();
if ("RetrievalMethod".equals(root.getLocalName())) {
throw new URIReferenceException(
"It is forbidden to have one RetrievalMethod point " +
"to another when secure validation is enabled");
}
}
}
return data;
}