Package org.jibx.schema.codegen.custom

Examples of org.jibx.schema.codegen.custom.SchemasetCustom


     * @param custom schema set customization
     * @return owning schemaset, <code>null</code> if none
     */
    private SchemasetCustom findSchemaset(SchemaElement schema, SchemasetCustom custom) {
        LazyList childs = custom.getChildren();
        SchemasetCustom owner = null;
        String name = schema.getResolver().getName();
        for (int i = 0; i < childs.size(); i++) {
            Object child = childs.get(i);
            if (child instanceof SchemasetCustom) {
                SchemasetCustom schemaset = (SchemasetCustom)child;
                if (schemaset.isInSet(name, schema)) {
                    SchemasetCustom match = findSchemaset(schema, schemaset);
                    if (match != null) {
                        if (owner == null) {
                            owner = match;
                        } else {
                            m_validationContext.addError("schema-set overlap on schema " + name + " (first match "
View Full Code Here


        int count = 0;
        for (Iterator iter = m_validationContext.iterateSchemas(); iter.hasNext();) {
            SchemaElement schema = (SchemaElement)iter.next();
            ISchemaResolver resolver = schema.getResolver();
            s_logger.debug("Assigning customization for schema " + ++count + ": " + resolver.getName());
            SchemasetCustom owner = findSchemaset(schema, m_global);
            SchemaCustom custom = owner.forceCustomization(resolver.getName(), resolver.getId(), schema,
                m_validationContext);
            custom.validate(m_validationContext);
            custom.extend(null, m_validationContext);
        }
       
View Full Code Here

        }
    }
   
    public void testGenerationNoCustomization() throws Exception {
        SchemaElement[] schemas = new SchemaElement[] { loadSchema(CodegenData.RESOLVER1) };
        testGeneration(new SchemasetCustom((SchemasetCustom)null), schemas, DATA1, BINDINGS1);
    }
View Full Code Here

        testGeneration(new SchemasetCustom((SchemasetCustom)null), schemas, DATA1, BINDINGS1);
    }
   
    public void testGenerationSimpleTypeReplacement() throws Exception {
        SchemaElement[] schemas = new SchemaElement[] { loadSchema(CodegenData.RESOLVER3) };
        SchemasetCustom custom = loadCustomization(CodegenData.CUSTOMIZATION3_A);
        testGeneration(custom, schemas, DATA3_A, BINDINGS3_A);
    }
View Full Code Here

        testGeneration(custom, schemas, DATA3_A, BINDINGS3_A);
    }
 
    public void testGenerationOnlyUsed() throws Exception {
        SchemaElement[] schemas = new SchemaElement[] { loadSchema(CodegenData.RESOLVER3) };
        SchemasetCustom custom = loadCustomization(CodegenData.CUSTOMIZATION3_B);
        testGeneration(custom, schemas, DATA3_B, BINDINGS3_B);
    }
View Full Code Here

        testGeneration(custom, schemas, DATA3_B, BINDINGS3_B);
    }
   
    public void testGenerationOnlyUsedPreferInline() throws Exception {
        SchemaElement[] schemas = new SchemaElement[] { loadSchema(CodegenData.RESOLVER3) };
        SchemasetCustom custom = loadCustomization(CodegenData.CUSTOMIZATION3_C);
        testGeneration(custom, schemas, DATA3_C, BINDINGS3_C);
    }
View Full Code Here

        testGeneration(custom, schemas, DATA3_C, BINDINGS3_C);
    }
   
    public void testGenerationSimplifiedOnlyUsedPreferInline() throws Exception {
        SchemaElement[] schemas = new SchemaElement[] { loadSchema(CodegenData.RESOLVER3) };
        SchemasetCustom custom = loadCustomization(CodegenData.CUSTOMIZATION3_D);
        testGeneration(custom, schemas, DATA3_D, BINDINGS3_D);
    }
View Full Code Here

    }
   
    public void testGenerationOTAProfileTypeSimplifiedUnqualified() throws Exception {
        SchemaElement[] schemas = new SchemaElement[] {
            loadSchema(CodegenData.OTA_PROFILETYPE_SIMPLIFIED_UNQUALIFIED_RESOLVER) };
        SchemasetCustom custom = loadCustomization(CodegenData.OTA_PROFILETYPE_SIMPLIFIED_CUSTOMIZATION_A);
        testGeneration(custom, schemas, OTA_PROFILETYPE_SIMPLIFIED_UNQUALIFIED_DATA_A,
            OTA_PROFILETYPE_SIMPLIFIED_UNQUALIFIED_BINDINGS_A);
    }
View Full Code Here

            OTA_PROFILETYPE_SIMPLIFIED_UNQUALIFIED_BINDINGS_A);
    }
   
    public void testGenerationOTAProfileTypeSimplified() throws Exception {
        SchemaElement[] schemas = new SchemaElement[] { loadSchema(CodegenData.OTA_PROFILETYPE_SIMPLIFIED_RESOLVER) };
        SchemasetCustom custom = loadCustomization(CodegenData.OTA_PROFILETYPE_SIMPLIFIED_CUSTOMIZATION_A);
        testGeneration(custom, schemas, OTA_PROFILETYPE_SIMPLIFIED_DATA_A, OTA_PROFILETYPE_SIMPLIFIED_BINDINGS_A);
    }
View Full Code Here

        testGeneration(custom, schemas, OTA_PROFILETYPE_SIMPLIFIED_DATA_A, OTA_PROFILETYPE_SIMPLIFIED_BINDINGS_A);
    }
   
    public void testGenerationOTAProfileTypeSimplifiedNoUnused() throws Exception {
        SchemaElement[] schemas = new SchemaElement[] { loadSchema(CodegenData.OTA_PROFILETYPE_SIMPLIFIED_RESOLVER) };
        SchemasetCustom custom = loadCustomization(CodegenData.OTA_PROFILETYPE_SIMPLIFIED_CUSTOMIZATION_B);
        testGeneration(custom, schemas, OTA_PROFILETYPE_SIMPLIFIED_DATA_B, OTA_PROFILETYPE_SIMPLIFIED_BINDINGS_B);
    }
View Full Code Here

TOP

Related Classes of org.jibx.schema.codegen.custom.SchemasetCustom

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.