本文整理汇总了Java中javax.xml.crypto.dsig.spec.ExcC14NParameterSpec.getPrefixList方法的典型用法代码示例。如果您正苦于以下问题:Java ExcC14NParameterSpec.getPrefixList方法的具体用法?Java ExcC14NParameterSpec.getPrefixList怎么用?Java ExcC14NParameterSpec.getPrefixList使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.xml.crypto.dsig.spec.ExcC14NParameterSpec
的用法示例。
在下文中一共展示了ExcC14NParameterSpec.getPrefixList方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: marshalParams
import javax.xml.crypto.dsig.spec.ExcC14NParameterSpec; //导入方法依赖的package包/类
public void marshalParams(XMLStructure parent, XMLCryptoContext context)
throws MarshalException
{
super.marshalParams(parent, context);
AlgorithmParameterSpec spec = getParameterSpec();
if (spec == null) {
return;
}
String prefix = DOMUtils.getNSPrefix(context,
CanonicalizationMethod.EXCLUSIVE);
Element eElem = DOMUtils.createElement(ownerDoc,
"InclusiveNamespaces",
CanonicalizationMethod.EXCLUSIVE,
prefix);
if (prefix == null || prefix.length() == 0) {
eElem.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns",
CanonicalizationMethod.EXCLUSIVE);
} else {
eElem.setAttributeNS("http://www.w3.org/2000/xmlns/",
"xmlns:" + prefix,
CanonicalizationMethod.EXCLUSIVE);
}
ExcC14NParameterSpec params = (ExcC14NParameterSpec)spec;
StringBuffer prefixListAttr = new StringBuffer("");
@SuppressWarnings("unchecked")
List<String> prefixList = params.getPrefixList();
for (int i = 0, size = prefixList.size(); i < size; i++) {
prefixListAttr.append(prefixList.get(i));
if (i < size - 1) {
prefixListAttr.append(" ");
}
}
DOMUtils.setAttribute(eElem, "PrefixList", prefixListAttr.toString());
this.inclusiveNamespaces = prefixListAttr.toString();
transformElem.appendChild(eElem);
}
示例2: marshalParams
import javax.xml.crypto.dsig.spec.ExcC14NParameterSpec; //导入方法依赖的package包/类
public void marshalParams(XMLStructure parent, XMLCryptoContext context)
throws MarshalException
{
super.marshalParams(parent, context);
AlgorithmParameterSpec spec = getParameterSpec();
if (spec == null) {
return;
}
String prefix = DOMUtils.getNSPrefix(context,
CanonicalizationMethod.EXCLUSIVE);
Element eElem = DOMUtils.createElement(ownerDoc,
"InclusiveNamespaces",
CanonicalizationMethod.EXCLUSIVE,
prefix);
if (prefix == null || prefix.length() == 0) {
eElem.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns",
CanonicalizationMethod.EXCLUSIVE);
} else {
eElem.setAttributeNS("http://www.w3.org/2000/xmlns/",
"xmlns:" + prefix,
CanonicalizationMethod.EXCLUSIVE);
}
ExcC14NParameterSpec params = (ExcC14NParameterSpec)spec;
StringBuilder prefixListAttr = new StringBuilder("");
List<String> prefixList = params.getPrefixList();
for (int i = 0, size = prefixList.size(); i < size; i++) {
prefixListAttr.append(prefixList.get(i));
if (i < size - 1) {
prefixListAttr.append(" ");
}
}
DOMUtils.setAttribute(eElem, "PrefixList", prefixListAttr.toString());
this.inclusiveNamespaces = prefixListAttr.toString();
transformElem.appendChild(eElem);
}
示例3: marshalParams
import javax.xml.crypto.dsig.spec.ExcC14NParameterSpec; //导入方法依赖的package包/类
public void marshalParams(XMLStructure parent, XMLCryptoContext context)
throws MarshalException {
super.marshalParams(parent, context);
AlgorithmParameterSpec spec = getParameterSpec();
if (spec == null) {
return;
}
String prefix =
DOMUtils.getNSPrefix(context, CanonicalizationMethod.EXCLUSIVE);
Element excElem = DOMUtils.createElement
(ownerDoc, "InclusiveNamespaces",
CanonicalizationMethod.EXCLUSIVE, prefix);
if (prefix == null || prefix.length() == 0) {
excElem.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns",
CanonicalizationMethod.EXCLUSIVE);
} else {
excElem.setAttributeNS("http://www.w3.org/2000/xmlns/",
"xmlns:" + prefix, CanonicalizationMethod.EXCLUSIVE);
}
ExcC14NParameterSpec params = (ExcC14NParameterSpec) spec;
StringBuffer prefixListAttr = new StringBuffer("");
List prefixList = params.getPrefixList();
for (int i = 0, size = prefixList.size(); i < size; i++) {
prefixListAttr.append((String) prefixList.get(i));
if (i < size - 1) {
prefixListAttr.append(" ");
}
}
DOMUtils.setAttribute(excElem, "PrefixList", prefixListAttr.toString());
this.inclusiveNamespaces = prefixListAttr.toString();
transformElem.appendChild(excElem);
}
示例4: getParameterSpecPrefixList
import javax.xml.crypto.dsig.spec.ExcC14NParameterSpec; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
public List<String> getParameterSpecPrefixList(ExcC14NParameterSpec paramSpec) {
return paramSpec.getPrefixList();
}