本文整理汇总了Java中com.sun.org.apache.xerces.internal.xs.XSAnnotation.W3C_DOM_DOCUMENT属性的典型用法代码示例。如果您正苦于以下问题:Java XSAnnotation.W3C_DOM_DOCUMENT属性的具体用法?Java XSAnnotation.W3C_DOM_DOCUMENT怎么用?Java XSAnnotation.W3C_DOM_DOCUMENT使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.sun.org.apache.xerces.internal.xs.XSAnnotation
的用法示例。
在下文中一共展示了XSAnnotation.W3C_DOM_DOCUMENT属性的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: writeAnnotation
/**
* Write contents of the annotation to the specified DOM object. If the
* specified <code>target</code> object is a DOM in-scope namespace
* declarations for <code>annotation</code> element are added as
* attributes nodes of the serialized <code>annotation</code>, otherwise
* the corresponding events for all in-scope namespace declaration are
* sent via specified document handler.
* @param target A target pointer to the annotation target object, i.e.
* <code>org.w3c.dom.Document</code>,
* <code>org.xml.sax.ContentHandler</code>.
* @param targetType A target type.
* @return If the <code>target</code> is recognized type and supported by
* this implementation return true, otherwise return false.
*/
public boolean writeAnnotation(Object target,
short targetType) {
if(targetType == XSAnnotation.W3C_DOM_ELEMENT || targetType == XSAnnotation.W3C_DOM_DOCUMENT) {
writeToDOM((Node)target, targetType);
return true;
} else if (targetType == SAX_CONTENTHANDLER) {
writeToSAX((ContentHandler)target);
return true;
}
return false;
}