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


Java XmlSchemaComplexType.getName方法代码示例

本文整理汇总了Java中org.apache.ws.commons.schema.XmlSchemaComplexType.getName方法的典型用法代码示例。如果您正苦于以下问题:Java XmlSchemaComplexType.getName方法的具体用法?Java XmlSchemaComplexType.getName怎么用?Java XmlSchemaComplexType.getName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.ws.commons.schema.XmlSchemaComplexType的用法示例。


在下文中一共展示了XmlSchemaComplexType.getName方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: cacheComplexTypes

import org.apache.ws.commons.schema.XmlSchemaComplexType; //导入方法依赖的package包/类
/**
 * extract all complex types from a schema and cache into a map
 */
private void cacheComplexTypes(XmlSchema schema) {
    XmlSchemaObjectCollection schemaItems = schema.getItems();

    int numElements = schemaItems.getCount();

    // Iterate XML Schema items
    for (int i = 0; i < numElements; i++) {
        XmlSchemaObject schemaObject = schemaItems.getItem(i);
        if (schemaObject instanceof XmlSchemaComplexType) {
            XmlSchemaComplexType complexType = (XmlSchemaComplexType) schemaObject;
            String elementTypeName = complexType.getName();
            complexTypes.put(elementTypeName, complexType);
        }
    }
}
 
开发者ID:inbloom,项目名称:secure-data-service,代码行数:19,代码来源:DidSchemaParser.java

示例2: getRefSource

import org.apache.ws.commons.schema.XmlSchemaComplexType; //导入方法依赖的package包/类
/**
 * Get the DidRefSource for a reference schema type
 */
DidRefSource getRefSource(XmlSchemaComplexType refSchema) {
    DidRefSource refSource = null;
    String schemaName = refSchema.getName();
    if (refSourceCache.containsKey(schemaName)) {
        refSource = refSourceCache.get(schemaName);
        // if a cached refSource is found create return new DidRefSource of same type
        if (refSource != null) {
            DidRefSource cachedRefSource = refSource;
            refSource = new DidRefSource();
            refSource.setEntityType(cachedRefSource.getEntityType());
        }
    } else {
        XmlSchemaAnnotation annotation = refSchema.getAnnotation();
        if (annotation == null) {
            LOG.debug("Annotation missing from refSchema: {}", refSchema.getName());
        } else {
            refSource = parseAnnotationForRef(annotation);
            refSourceCache.put(schemaName, refSource);
        }
    }
    return refSource;
}
 
开发者ID:inbloom,项目名称:secure-data-service,代码行数:26,代码来源:DidSchemaParser.java

示例3: processSchema

import org.apache.ws.commons.schema.XmlSchemaComplexType; //导入方法依赖的package包/类
/**
 * Process a schema element which has been refered to by an element
 *
 * @param schemaType
 * @throws SchemaCompilationException
 */
private void processSchema(XmlSchemaElement xsElt,
                           XmlSchemaType schemaType,
                           XmlSchema parentSchema,
                           boolean isWriteAnonComplexType) throws SchemaCompilationException {
    if (schemaType instanceof XmlSchemaComplexType) {
        //write classes for complex types
        XmlSchemaComplexType complexType = (XmlSchemaComplexType) schemaType;
        // complex type name may not be null if we have set it
        if (complexType.getName() != null && !this.changedComplexTypeSet.contains(schemaType)) {
            // here complex type may be in another shcema so we have to find the
            // correct parent schema.
            XmlSchema resolvedSchema = getParentSchema(parentSchema,complexType.getQName(),COMPONENT_TYPE);
            if (resolvedSchema == null){
                throw new SchemaCompilationException("can not find the parent schema for the " +
                        "complex type " + complexType.getQName() + " from the parent schema " +
                parentSchema.getTargetNamespace());
            } else {
               processNamedComplexSchemaType(complexType, resolvedSchema);
            }
        } else {
            processAnonymousComplexSchemaType(xsElt, complexType, parentSchema, isWriteAnonComplexType);
        }
    } else if (schemaType instanceof XmlSchemaSimpleType) {
        //process simple type
        processSimpleSchemaType((XmlSchemaSimpleType) schemaType,
                xsElt,
                parentSchema, null);
    }
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:36,代码来源:SchemaCompiler.java

示例4: setComplexTypeName

import org.apache.ws.commons.schema.XmlSchemaComplexType; //导入方法依赖的package包/类
/**
 * set the complext type class name as an message parameter if it exits
 * @param axisMessage
 */
private static void setComplexTypeName(AxisMessage axisMessage) throws AxisFault {

    if (axisMessage.getSchemaElement() != null){

        XmlSchemaElement schemaElement = axisMessage.getSchemaElement();
        XmlSchemaType schemaType = schemaElement.getSchemaType();
        QName schemaTypeQname = schemaElement.getSchemaTypeName();

        if (schemaType == null) {
            if (schemaTypeQname != null) {
                // find the schema type from all the schemas
                // now we need to get the schema of the extension type from the parent schema. For that let's first retrieve
                // the parent schema
                AxisService axisService = axisMessage.getAxisOperation().getAxisService();
                for (XmlSchema schema : axisService.getSchema()) {
                    schemaType = getSchemaType(schema, schemaTypeQname);
                    if (schemaType != null) {
                        break;
                    }
                }
            }
        }

        if (schemaType instanceof XmlSchemaComplexType){
            XmlSchemaComplexType complexType = (XmlSchemaComplexType) schemaType;
            if ((complexType.getName() != null) && (complexType.getQName() != null)) {
                Map metaInfo = complexType.getMetaInfoMap();
                String complexTypeName = (String)
                        metaInfo.get(SchemaConstants.SchemaCompilerInfoHolder.CLASSNAME_KEY);
                if (complexTypeName.endsWith("[]")){
                    complexTypeName = complexTypeName.substring(0,complexTypeName.length() -2);
                }
                // store the complext type name to process later
               axisMessage.addParameter(new Parameter(Constants.COMPLEX_TYPE, complexTypeName));
            }
        }
    }


}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:45,代码来源:ExtensionUtility.java

示例5: parseComplexType

import org.apache.ws.commons.schema.XmlSchemaComplexType; //导入方法依赖的package包/类
@SuppressWarnings("PMD.AvoidReassigningParameters")  // makes code simpler 
private NeutralSchema parseComplexType(XmlSchemaComplexType schemaComplexType, NeutralSchema complexSchema,
        XmlSchema schema) {

    //if(complexSchema != null && complexSchema.getType() != null && complexSchema.getType().equals("application")) {
        //boolean isRequiredSchema = true; //for debugging
    //}

    if ((schemaComplexType.getContentModel() != null) && (schemaComplexType.getContentModel().getContent() != null)) {
        XmlSchemaContent content = schemaComplexType.getContentModel().getContent();
        if (content instanceof XmlSchemaComplexContentExtension) {
            XmlSchemaComplexContentExtension schemaComplexContent = (XmlSchemaComplexContentExtension) content;
            XmlSchemaComplexType complexBaseType = getComplexBaseType(schemaComplexContent, schema);
            if (complexBaseType != null) {
                complexSchema = parseComplexType(complexBaseType, complexSchema, schema);
            }
            this.parseFields(schemaComplexContent, complexSchema, schema);

        } else if (content instanceof XmlSchemaSimpleContentExtension) {
            QName baseTypeName = ((XmlSchemaSimpleContentExtension) content).getBaseTypeName();
            NeutralSchema simpleContentSchema = schemaFactory.createSchema(baseTypeName);
            complexSchema.addField(complexSchema.getType(), simpleContentSchema);

            parseAttributes(((XmlSchemaSimpleContentExtension) content).getAttributes(), complexSchema, schema);
        }
    }

    // Annotations are inherited by ComplexType fields so we need to parse these first.
    parseAnnotations(complexSchema, schemaComplexType);

    this.parseFields(schemaComplexType, complexSchema, schema);

    // Check for ChoiceSchemas. We only support complex types that contain choice if choice is
    // the ONLY element. If we find one, swap out the current ComplexSchema object that contains
    // this single choice schema for the actual choice schema itself.
    for (NeutralSchema ns : complexSchema.getFields().values()) {
        if (ns instanceof ChoiceSchema) {
            if (complexSchema.getFields().size() > 1 && !mergedChoiceSchemas.contains(ns)) {
                throw new RuntimeException(
                        "Choice elements are only supported on complex objects with no other fields: "
                                + schemaComplexType.getName());
            } else if (!mergedChoiceSchemas.contains(ns)) {
                ns.setType(complexSchema.getType());
                complexSchema.getAppInfo();
                mergedChoiceSchemas.add(ns);
                if(ns.getType().equals("serviceDescriptorType")) {
                    ns.addAnnotation(complexSchema.getAppInfo());
                }
                return ns;
            }
        }
    }

    return complexSchema;
}
 
开发者ID:inbloom,项目名称:secure-data-service,代码行数:56,代码来源:XsdToNeutralSchemaRepo.java

示例6: getComplexTypeName

import org.apache.ws.commons.schema.XmlSchemaComplexType; //导入方法依赖的package包/类
/**
 * A complex type name is derived from an XML schema complex type name.
 * 
 * @param xsdComplexType the XSD complex type
 * @return a unique type name for this complex type
 */
private static String getComplexTypeName(XmlSchemaComplexType xsdComplexType) {
    return xsdComplexType.getName();
}
 
开发者ID:legsem,项目名称:legstar-core2,代码行数:10,代码来源:Xsd2CobolTypesModelBuilder.java

示例7: getAvroTypeName

import org.apache.ws.commons.schema.XmlSchemaComplexType; //导入方法依赖的package包/类
/**
 * Get a name for a record type.
 * <p/>
 * TODO XML schema names might not be valid Avro type names
 * 
 * @param xsdType the XML schema complex type.
 * @return an avro type name
 */
public String getAvroTypeName(final XmlSchemaComplexType xsdType) {
    return xsdType.getName();
}
 
开发者ID:legsem,项目名称:legstar.avro,代码行数:12,代码来源:Xsd2AvroTranslator.java


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