Package org.jibx.util

Examples of org.jibx.util.ReferenceCountMap


        /**
         * Constructor.
         */
        public UsageVisitor() {
            m_tracker = new SchemaContextTracker();
            m_usageMap = new ReferenceCountMap();
            m_nonSingletonSet = new HashSet();
        }
View Full Code Here


    public void testComplexReferenced() throws Exception {
        SchemaElement root = runNoErrors(REFERENCE_SCHEMA);
        if (!hasProblem(m_validationContext)) {
            UsageFinder usage = new UsageFinder();
            usage.countSchemaTree(root);
            ReferenceCountMap map = usage.getUsageMap();
            checkTypeUsage("simple1", map, 1);
            checkElementUsage("simple1", map, 1);
            checkTypeUsage("simple2", map, 0);
            checkTypeUsage("simple3", map, 0);
            checkTypeUsage("rating", map, 3);
View Full Code Here

    }

    public void testExpandReferences() {
        GlobalCustom custom = new GlobalCustom();
        BindGen gen = new BindGen(custom);
        ReferenceCountMap refmap = new ReferenceCountMap();
        gen.expandReferences("org.jibx.binding.generator.DataClass2Java5", refmap);
        assertEquals("original class references", 0, refmap.getCount("org.jibx.binding.generator.DataClass2Java5"));
        assertEquals("referenced class references", 2, refmap.getCount("org.jibx.binding.generator.DataClass1"));
    }
View Full Code Here

    }
   
    public void testMultiplePropertiesRefCounts() throws Exception {
        GlobalCustom custom = readCustom(MULTIPLE_PROPERTIES_CLASSES1);
        BindGen gen = new BindGen(custom);
        ReferenceCountMap refmap = new ReferenceCountMap();
        gen.expandReferences("org.jibx.binding.generator.DataClass2Java5", refmap);
        assertEquals("original class references", 0, refmap.getCount("org.jibx.binding.generator.DataClass2"));
        assertEquals("referenced class references", 2, refmap.getCount("org.jibx.binding.generator.DataClass1"));
        gen.expandReferences("org.jibx.binding.generator.DataClass2Java5", refmap);
        assertEquals("original class references", 0, refmap.getCount("org.jibx.binding.generator.DataClass2Java5"));
        assertEquals("referenced class references", 3, refmap.getCount("org.jibx.binding.generator.DataClass1"));
    }
View Full Code Here

     * @param classes class list
     */
    public void generate(Boolean abstr, List classes) {
       
        // start by expanding and counting references from supplied classes
        ReferenceCountMap refmap = new ReferenceCountMap();
        m_directSet.addAll(classes);
        findReferences(classes, refmap);
        flagMultipleReferences(refmap);
       
        // set the classes to be handled with <mapping> definitions
View Full Code Here

     * @param abstrs list of classes to be given abstract mappings
     */
    public void generateSpecified(ArrayList qnames, List concrs, List abstrs) {
       
        // start by expanding and counting references from supplied classes
        ReferenceCountMap refmap = new ReferenceCountMap();
        m_directSet.addAll(concrs);
        m_directSet.addAll(abstrs);
        findReferences(concrs, refmap);
        findReferences(abstrs, refmap);
        flagMultipleReferences(refmap);
View Full Code Here

TOP

Related Classes of org.jibx.util.ReferenceCountMap

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.