Package org.exolab.javasource

Examples of org.exolab.javasource.JClass


    /**   
     * SetUp sets the NatureExtendable to test.
     */
    protected void setUp() throws Exception {
        _extender = new ClassInfo(new JClass("test"));
    }
View Full Code Here


     * SetUp sets the NatureExtendable to test.
     */
    protected void setUp() throws Exception {
        FieldInfoFactory factory = new FieldInfoFactory();
        _extender = factory.createFieldInfo(
                new XSClass(new JClass("Book")), "isbn");
    }
View Full Code Here

    /**
     * Test get foreign key method.
     */
    public void testGetForeignKeyNothingAdded() {
        FieldInfoFactory factory = new FieldInfoFactory();
        FieldInfo flat = factory.createFieldInfo(new XSClass(new JClass(
                "House")), "flat");
        flat.addNature(JDOOneToManyNature.class.getName());
        JDOOneToManyNature relation = new JDOOneToManyNature(flat);
        assertNull(relation.getForeignKeys());
    }
View Full Code Here

    /**
     * Test add and get foreign key methods.
     */
    public void testAddGetForeignKey() {
        FieldInfoFactory factory = new FieldInfoFactory();
        FieldInfo flat = factory.createFieldInfo(new XSClass(new JClass(
                "House")), "flat");
        flat.addNature(JDOOneToManyNature.class.getName());
        JDOOneToManyNature relation = new JDOOneToManyNature(flat);
        relation.addForeignKey("fk_flat");
        assertEquals("fk_flat", (String) relation.getForeignKeys().get(0));
View Full Code Here

    /**
     * Test add and get foreign key methods with multiple foreign keys.
     */
    public void testAddGetForeignKeys() {
        FieldInfoFactory factory = new FieldInfoFactory();
        FieldInfo flat = factory.createFieldInfo(new XSClass(new JClass(
                "House")), "token");
        flat.addNature(JDOOneToManyNature.class.getName());
        JDOOneToManyNature relation = new JDOOneToManyNature(flat);
        relation.addForeignKey("fk_1");
        relation.addForeignKey("fk_2");
View Full Code Here

     * Tests get and set of read only.
     */
    public void testReadOnly() {
        FieldInfoFactory factory = new FieldInfoFactory();
        FieldInfo flat = factory.createFieldInfo(
                new XSClass(new JClass("House")), "flat");
        flat.addNature(JDOOneToManyNature.class.getName());
        JDOOneToManyNature relation = new JDOOneToManyNature(flat);
        relation.setReadOnly(true);
        assertEquals(true, relation.isReadOnly());
    }
View Full Code Here

     * Tests get and set of dirty.
     */
    public void testDirty() {
        FieldInfoFactory factory = new FieldInfoFactory();
        FieldInfo flat = factory.createFieldInfo(
                new XSClass(new JClass("House")), "flat");
        flat.addNature(JDOOneToManyNature.class.getName());
        JDOOneToManyNature jdo = new JDOOneToManyNature(flat);
        jdo.setDirty(true);
        assertEquals(true, jdo.isDirty());
    }
View Full Code Here

        _bindingComponent.setView(elementDecl);

        //-- already processed --> just return
        ClassInfo cInfo = sInfo.resolve(elementDecl);
        if (cInfo != null && cInfo.getJClass() != null) {
            JClass jClass = cInfo.getJClass();
            if (sInfo.processed(jClass)) {
                return;
            }
            jClass = null;
        }
View Full Code Here

            }

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

        //-- Right now the only time we actually generate source for a simpletype is
        //-- when it's an enumeration
        if (simpleType.hasFacet(Facet.ENUMERATION)) {
            ClassInfo classInfo = sInfo.resolve(simpleType);
            if (classInfo == null) {
                JClass jClass = _sourceFactory.createSourceCode(
                        _bindingComponent.getBinding(), simpleType, sInfo);
                _singleClassGenerator.process(jClass, sInfo);
            } else {
                JClass jClass = classInfo.getJClass();
                _singleClassGenerator.process(jClass, sInfo);
            }
        }
    } //-- processSimpleType
View Full Code Here

TOP

Related Classes of org.exolab.javasource.JClass

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.