本文整理汇总了Java中com.sun.xml.internal.bind.util.Which类的典型用法代码示例。如果您正苦于以下问题:Java Which类的具体用法?Java Which怎么用?Java Which使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Which类属于com.sun.xml.internal.bind.util包,在下文中一共展示了Which类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: startElement
import com.sun.xml.internal.bind.util.Which; //导入依赖的package包/类
public void startElement(String namespace, String localName, String qName, Attributes attrs) {
Node parent = nodeStack.peek();
// some broken DOM implementation (we confirmed it with SAXON)
// return null from this method.
Element element = document.createElementNS(namespace, qName);
if (element == null) {
// if so, report an user-friendly error message,
// rather than dying mysteriously with NPE.
throw new AssertionError(
Messages.format(Messages.DOM_IMPL_DOESNT_SUPPORT_CREATELEMENTNS,
document.getClass().getName(),
Which.which(document.getClass())));
}
// process namespace bindings
for (int i = 0; i < unprocessedNamespaces.size(); i += 2) {
String prefix = unprocessedNamespaces.get(i);
String uri = unprocessedNamespaces.get(i + 1);
namespace(element, prefix, uri);
}
unprocessedNamespaces.clear();
if (attrs != null) {
int length = attrs.getLength();
for (int i = 0; i < length; i++) {
String namespaceuri = attrs.getURI(i);
String value = attrs.getValue(i);
String qname = attrs.getQName(i);
element.setAttributeNS(namespaceuri, qname, value);
}
}
// append this new node onto current stack node
parent.appendChild(element);
// push this node onto stack
nodeStack.push(element);
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:41,代码来源:SAX2DOMEx.java
示例2: toString
import com.sun.xml.internal.bind.util.Which; //导入依赖的package包/类
@Override
public String toString() {
StringBuilder buf = new StringBuilder(Which.which(getClass()) + " Build-Id: " + getBuildId());
buf.append("\nClasses known to this context:\n");
Set<String> names = new TreeSet<String>(); // sort them so that it's easy to read
for (Class key : beanInfoMap.keySet())
names.add(key.getName());
for(String name: names)
buf.append(" ").append(name).append('\n');
return buf.toString();
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:16,代码来源:JAXBContextImpl.java
示例3: startElement
import com.sun.xml.internal.bind.util.Which; //导入依赖的package包/类
public void startElement(String namespace, String localName, String qName, Attributes attrs) {
Node parent = nodeStack.peek();
// some broken DOM implementatino (we confirmed it with SAXON)
// return null from this method.
Element element = document.createElementNS(namespace, qName);
if (element == null) {
// if so, report an user-friendly error message,
// rather than dying mysteriously with NPE.
throw new AssertionError(
Messages.format(Messages.DOM_IMPL_DOESNT_SUPPORT_CREATELEMENTNS,
document.getClass().getName(),
Which.which(document.getClass())));
}
// process namespace bindings
for (int i = 0; i < unprocessedNamespaces.size(); i += 2) {
String prefix = unprocessedNamespaces.get(i + 0);
String uri = unprocessedNamespaces.get(i + 1);
namespace(element, prefix, uri);
}
unprocessedNamespaces.clear();
if (attrs != null) {
int length = attrs.getLength();
for (int i = 0; i < length; i++) {
String namespaceuri = attrs.getURI(i);
String value = attrs.getValue(i);
String qname = attrs.getQName(i);
element.setAttributeNS(namespaceuri, qname, value);
}
}
// append this new node onto current stack node
parent.appendChild(element);
// push this node onto stack
nodeStack.push(element);
}
开发者ID:alexkasko,项目名称:openjdk-icedtea7,代码行数:41,代码来源:SAX2DOMEx.java
注:本文中的com.sun.xml.internal.bind.util.Which类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论