当前位置: 首页>>代码示例>>Java>>正文


Java XmlSchemaObjectBase类代码示例

本文整理汇总了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
}
 
开发者ID:legsem,项目名称:legstar-core2,代码行数:23,代码来源:Xsd2CobolTypesModelBuilder.java

示例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);
    }
}
 
开发者ID:legsem,项目名称:legstar.avro,代码行数:29,代码来源:Xsd2AvroTranslator.java


注:本文中的org.apache.ws.commons.schema.utils.XmlSchemaObjectBase类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。