本文整理汇总了Java中org.apache.ws.commons.schema.utils.XmlSchemaObjectBase类的典型用法代码示例。如果您正苦于以下问题:Java XmlSchemaObjectBase类的具体用法?Java XmlSchemaObjectBase怎么用?Java XmlSchemaObjectBase使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
XmlSchemaObjectBase类属于org.apache.ws.commons.schema.utils包,在下文中一共展示了XmlSchemaObjectBase类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addField
import org.apache.ws.commons.schema.utils.XmlSchemaObjectBase; //导入依赖的package包/类
/**
* Add a field with associated properties to a complex type.
*
* @param index the order of the field in the parent complex type
* @param xsdSchemaObject the potential field
* @param xsdSchemaObject the potential field
* @param fields the parent complex type's fields collection
* @param compositeTypes the lists of composite types being populated
*/
private void addField(int fieldIndex, XmlSchemaObjectBase xsdSchemaObject,
Map < String, Object > fields, RootCompositeType compositeTypes) {
if (xsdSchemaObject instanceof XmlSchemaElement) {
XmlSchemaElement xsdElement = (XmlSchemaElement) xsdSchemaObject;
fields.put(getFieldName(xsdElement),
getProps(fieldIndex, xsdElement, compositeTypes));
} else if (xsdSchemaObject instanceof XmlSchemaChoice) {
XmlSchemaChoice xsdChoice = (XmlSchemaChoice) xsdSchemaObject;
fields.put(getFieldName(xsdChoice),
getProps(fieldIndex, xsdChoice, compositeTypes));
}
// TODO Add Groups
}
示例2: visit
import org.apache.ws.commons.schema.utils.XmlSchemaObjectBase; //导入依赖的package包/类
/**
* Visit a base XSD element.
* <p/>
* Could be any of:
* <ul>
* <li>A regular element</li>
* <li>A reference to a group</li>
* <li>A choice</li>
* </ul>
*
* @param xmlSchema the input XML schema
* @param element the base element
* @param level the current level in the hierarchy
* @param avroFields an array of avro fields being populated
*/
private void visit(XmlSchema xmlSchema, XmlSchemaObjectBase element,
final int level, final ArrayNode avroFields) {
if (element instanceof XmlSchemaElement) {
visit(xmlSchema, (XmlSchemaElement) element, level, avroFields);
} else if (element instanceof XmlSchemaGroupRef) {
XmlSchemaGroupRef groupRef = (XmlSchemaGroupRef) element;
XmlSchemaGroup group = xmlSchema.getGroups().get(
groupRef.getRefName());
visit(xmlSchema, group.getParticle(), level, avroFields);
} else if (element instanceof XmlSchemaChoice) {
visit(xmlSchema, (XmlSchemaChoice) element, level, avroFields);
}
}