Esempio n. 1
0
    private void processSimpleType(SimpleType simpleType, SGStateInfo sInfo) {

        if (simpleType == null) return;

        String packageName = sInfo.packageName;

        //-- Right now the only time we actually
        //-- generate source for a simpletype is
        //-- when it's an enumeration
        //if (! (simpleType instanceof BuiltInType) ) {
        if (simpleType.hasFacet(Facet.ENUMERATION)) {

            ClassInfo classInfo = sInfo.resolve(simpleType);

            if (classInfo == null) {

                JClass jClass
                    = sourceFactory.createSourceCode(simpleType, sInfo);

                processJClass(jClass, sInfo);
            }
            else {
                JClass jClass = classInfo.getJClass();
                if (!sInfo.processed(jClass)) {
                    processJClass(jClass, sInfo);
                }
            }
        }
    } //-- processSimpleType
Esempio n. 2
0
    /**
     * Processes the given ComplexType and creates all necessary class
     * to support it
     * @param complexType the ComplexType to process
    **/
    private void processComplexType(ComplexType complexType, SGStateInfo sInfo) {

        if (complexType == null) return;

        ClassInfo classInfo = sInfo.resolve(complexType);

        if (classInfo == null) {

            //-- handle top-leve complextypes
            if (complexType.isTopLevel()) {

                JClass[] classes
                    = sourceFactory.createSourceCode(complexType, sInfo);

                for (int i = 0; i < classes.length; i++)
                    processJClass(classes[i], sInfo);
            }

            //-- process base complextype if necessary
            XMLType baseType= complexType.getBaseType();
            if (baseType != null &&
				baseType.getSchema() == complexType.getSchema()) {

				if (baseType.isComplexType())
                    processComplexType((ComplexType)baseType, sInfo);
            }

            //-- process AttributeDecl
            processAttributes(complexType, sInfo);

            //-- process ContentModel
            processContentModel(complexType, sInfo);

        }
        else {
            JClass jClass = classInfo.getJClass();
            if (!sInfo.processed(jClass)) {
                //-- process AttributeDecl
                processAttributes(complexType, sInfo);
                //-- process ContentModel
                processContentModel(complexType, sInfo);
                processJClass(jClass, sInfo);
            }
        }
    } //-- processComplexType