本文整理汇总了Java中org.apache.ws.commons.schema.XmlSchemaAttribute.getSchemaType方法的典型用法代码示例。如果您正苦于以下问题:Java XmlSchemaAttribute.getSchemaType方法的具体用法?Java XmlSchemaAttribute.getSchemaType怎么用?Java XmlSchemaAttribute.getSchemaType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.ws.commons.schema.XmlSchemaAttribute
的用法示例。
在下文中一共展示了XmlSchemaAttribute.getSchemaType方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: parseAttribute
import org.apache.ws.commons.schema.XmlSchemaAttribute; //导入方法依赖的package包/类
private static final Attribute parseAttribute(final XmlSchemaAttribute attribute, final XmlSchema schema,
final Xsd2UmlConfig config) {
final String name = config.getPlugin().nameFromSchemaAttributeName(attribute.getQName());
final List<TaggedValue> taggedValues = new LinkedList<TaggedValue>();
taggedValues.addAll(annotations(attribute, config));
final XmlSchemaSimpleType simpleType = attribute.getSchemaType();
final Identifier type;
if (simpleType != null) {
type = config.ensureId(getSimpleTypeName(simpleType));
} else {
type = config.ensureId(attribute.getSchemaTypeName());
}
final Multiplicity multiplicity = multiplicity(range(Occurs.ONE, Occurs.ONE));
return new Attribute(Identifier.random(), name, type, multiplicity, taggedValues);
}
示例2: walkAttribute
import org.apache.ws.commons.schema.XmlSchemaAttribute; //导入方法依赖的package包/类
protected void walkAttribute(XmlSchema xmlSchema, XmlSchemaAttribute obj) {
walkAnnotated(xmlSchema, obj);
QName refName = obj.getRefName();
QName typeName = obj.getSchemaTypeName();
XmlSchemaSimpleType xmlSchemaSimpleType = obj.getSchemaType();
if ((refName != null) && deep) {
walkByAttributeRef(xmlSchema, refName);
} else if (typeName != null) {
walkByTypeName(xmlSchema, typeName);
} else if (xmlSchemaSimpleType != null) {
walkSimpleType(xmlSchema, xmlSchemaSimpleType);
}
}
示例3: parseAttributes
import org.apache.ws.commons.schema.XmlSchemaAttribute; //导入方法依赖的package包/类
private void parseAttributes(XmlSchemaObjectCollection attributes, NeutralSchema complexSchema, XmlSchema schema) {
if (attributes != null) {
for (int i = 0; i < attributes.getCount(); i++) {
XmlSchemaAttribute attribute = (XmlSchemaAttribute) attributes.getItem(i);
QName attributeTypeName = attribute.getSchemaTypeName();
XmlSchemaType attributeSchemaType = attribute.getSchemaType();
if (attribute.getName() != null) {
String attributeName = attribute.getName();
// Derive Attribute Schema
NeutralSchema attributeSchema = null;
if (attributeSchemaType != null) {
attributeSchema = parse(attributeSchemaType, schema);
} else if (attributeTypeName != null) {
attributeSchema = getSchemaFactory().createSchema(attributeTypeName);
}
// Update Neutral Schema Field
if (attributeSchema != null) {
// Optional Attributes
if (attribute.getUse().equals(REQUIRED_USE)) {
AppInfo info = attributeSchema.getAppInfo();
if (info == null) {
info = new AppInfo(null);
}
info.put(REQUIRED_USE.getValue(), "true");
attributeSchema.addAnnotation(info);
}
complexSchema.addField(attributeName, attributeSchema);
}
}
}
}
}