本文整理汇总了Java中org.apache.ws.commons.schema.XmlSchemaSequence.getItems方法的典型用法代码示例。如果您正苦于以下问题:Java XmlSchemaSequence.getItems方法的具体用法?Java XmlSchemaSequence.getItems怎么用?Java XmlSchemaSequence.getItems使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.ws.commons.schema.XmlSchemaSequence
的用法示例。
在下文中一共展示了XmlSchemaSequence.getItems方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: walkSequence
import org.apache.ws.commons.schema.XmlSchemaSequence; //导入方法依赖的package包/类
protected void walkSequence(XmlSchema xmlSchema, XmlSchemaSequence obj) {
walkAnnotated(xmlSchema, obj);
XmlSchemaObjectCollection children = obj.getItems();
for (int i = 0; i < children.getCount(); i++) {
XmlSchemaObject child = children.getItem(i);
if (child instanceof XmlSchemaElement) {
walkElement(xmlSchema, (XmlSchemaElement)child);
} else if (child instanceof XmlSchemaGroupRef) {
walkGroupRef(xmlSchema, (XmlSchemaGroupRef)child);
} else if (child instanceof XmlSchemaChoice) {
walkChoice(xmlSchema, (XmlSchemaChoice)child);
} else if (child instanceof XmlSchemaSequence) {
walkSequence(xmlSchema, (XmlSchemaSequence)child);
} else if (child instanceof XmlSchemaAny) {
walkAny(xmlSchema, (XmlSchemaAny)child);
}
}
}
示例2: hasResultRowName
import org.apache.ws.commons.schema.XmlSchemaSequence; //导入方法依赖的package包/类
private static boolean hasResultRowName(XmlSchemaComplexType wrapperSchemaComplexType) {
XmlSchemaParticle wrapperSchemaParticle = wrapperSchemaComplexType.getParticle();
// a single sequence must be there
if (!(wrapperSchemaParticle instanceof XmlSchemaSequence)) {
return false;
}
XmlSchemaSequence wrapperSchemaSequence = (XmlSchemaSequence) wrapperSchemaParticle;
XmlSchemaObjectCollection objects = wrapperSchemaSequence.getItems();
if (objects.getCount() != 1) {
return false;
}
XmlSchemaObject schemaObject = objects.getItem(0);
if (!(schemaObject instanceof XmlSchemaElement)) {
return false;
}
XmlSchemaElement schemaElement = (XmlSchemaElement) schemaObject;
if (!((((XmlSchemaComplexType) schemaElement.getSchemaType())
.getParticle()) instanceof XmlSchemaSequence)) {
return false;
}
// cannot contain any attributes
if (wrapperSchemaComplexType.getAttributes().getCount() > 0) {
return false;
}
return true;
}