本文整理汇总了Java中org.apache.ws.commons.schema.XmlSchemaAnnotated类的典型用法代码示例。如果您正苦于以下问题:Java XmlSchemaAnnotated类的具体用法?Java XmlSchemaAnnotated怎么用?Java XmlSchemaAnnotated使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
XmlSchemaAnnotated类属于org.apache.ws.commons.schema包,在下文中一共展示了XmlSchemaAnnotated类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addSchemaCommentAnnotation
import org.apache.ws.commons.schema.XmlSchemaAnnotated; //导入依赖的package包/类
protected XmlSchemaAnnotation addSchemaCommentAnnotation(XmlSchemaAnnotated annoted, String comment, String description) {
XmlSchemaAnnotation annotation = new XmlSchemaAnnotation();
if ((comment != null) && (comment.length() > 0)) {
XmlSchemaDocumentation documentation = new XmlSchemaDocumentation();
documentation.setMarkup(XMLUtils.asNodeList(new String[]{XMLUtils.getCDataXml(comment)}));
annotation.getItems().add(documentation);
}
if ((description != null) && (description.length() > 0)) {
XmlSchemaAppInfo appInfo = new XmlSchemaAppInfo();
appInfo.setMarkup(XMLUtils.asNodeList(new String[]{description}));
annotation.getItems().add(appInfo);
}
annoted.setAnnotation(annotation);
return annotation;
}
示例2: addXmlSchemaAnnotation
import org.apache.ws.commons.schema.XmlSchemaAnnotated; //导入依赖的package包/类
protected void addXmlSchemaAnnotation(XmlSchemaAnnotated annoted) {
String comment = getComment();
if (comment != null && comment.length() > 0) {
XmlSchemaAnnotation annotation = XmlSchemaUtils.makeDynamic(this, new XmlSchemaAnnotation());
annoted.setAnnotation(annotation);
XmlSchemaDocumentation documentation = XmlSchemaUtils.makeDynamic(this, new XmlSchemaDocumentation());
annotation.getItems().add(documentation);
documentation.setMarkup(XMLUtils.asNodeList(comment));
}
}
示例3: annotations
import org.apache.ws.commons.schema.XmlSchemaAnnotated; //导入依赖的package包/类
/**
* The xs:annotation is parsed into {@link TaggedValue} with one entry per
* xs:documentation or xs:appinfo.
*/
private static final List<TaggedValue> annotations(final XmlSchemaAnnotated schemaType, final Xsd2UmlConfig config) {
if (schemaType == null) {
return EMPTY_TAGGED_VALUES;
}
final XmlSchemaAnnotation annotation = schemaType.getAnnotation();
if (annotation == null) {
return EMPTY_TAGGED_VALUES;
} else {
final List<TaggedValue> taggedValues = new LinkedList<TaggedValue>();
final XmlSchemaObjectCollection children = annotation.getItems();
for (int childIdx = 0; childIdx < children.getCount(); ++childIdx) {
final XmlSchemaObject child = children.getItem(childIdx);
if (child instanceof XmlSchemaDocumentation) {
final XmlSchemaDocumentation documentation = (XmlSchemaDocumentation) child;
taggedValues.add(documentation(documentation, config));
} else if (child instanceof XmlSchemaAppInfo) {
final XmlSchemaAppInfo appInfo = (XmlSchemaAppInfo) child;
taggedValues.addAll(config.getPlugin().tagsFromAppInfo(appInfo, config));
} else {
throw new AssertionError(child);
}
}
return taggedValues;
}
}
示例4: walkAnnotated
import org.apache.ws.commons.schema.XmlSchemaAnnotated; //导入依赖的package包/类
protected void walkAnnotated(XmlSchema xmlSchema, XmlSchemaAnnotated obj) {
XmlSchemaAnnotation annotation = obj.getAnnotation();
if (annotation != null) {
walkAnnotation(xmlSchema, annotation);
}
}