當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。