Examples of FieldInfoFactory


Examples of org.exolab.castor.builder.FieldInfoFactory

    private void config() throws BuildException {
        // Create Source Generator with appropriate type factory
        if (types != null) {
            try {
                FieldInfoFactory factory = new FieldInfoFactory(types);
                sgen = new CastorSourceGenerator(factory);
            } catch (Exception e) {
                try {
                    sgen = new CastorSourceGenerator((FieldInfoFactory) Class.forName(types).newInstance());
                } catch (Exception e2) {
View Full Code Here

Examples of org.exolab.castor.builder.factory.FieldInfoFactory

            ALL_OPTIONS.printUsage(new PrintWriter(System.out));
            return;
        }

        // Instantiate our SourceGenerator
        FieldInfoFactory factory = getTypeFactory(options);
        SourceGenerator sgen = (factory == null) ? new SourceGenerator()
                                                 : new SourceGenerator(factory);

        // Everything below here sets options on our SourceGenerator
View Full Code Here

Examples of org.exolab.castor.builder.factory.FieldInfoFactory

        // If no command-line arguments, then we have nothing to do
        if (typeFactory == null) {
            return null;
        }

        FieldInfoFactory factory = null;
        try {
            factory = new FieldInfoFactory(typeFactory);
        } catch (IllegalArgumentException e) {
            try {
                // Allow someone to provide their own FieldInfoFactory implementation
                ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
                factory = (FieldInfoFactory) classLoader.loadClass(typeFactory).newInstance();
View Full Code Here

Examples of org.exolab.castor.builder.factory.FieldInfoFactory

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

Examples of org.exolab.castor.builder.factory.FieldInfoFactory

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

Examples of org.exolab.castor.builder.factory.FieldInfoFactory

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

Examples of org.exolab.castor.builder.factory.FieldInfoFactory

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

Examples of org.exolab.castor.builder.factory.FieldInfoFactory

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

Examples of org.exolab.castor.builder.factory.FieldInfoFactory

   
    /**
     * Constructor initializes the XMLNature.
     */
    public XMLNatureFieldInfoTest() {
        FieldInfoFactory factory = new FieldInfoFactory();
        _holder = factory.createFieldInfo(
                new XSClass(new JClass("Book")), "isbn");
        _xml = new XMLInfoNature(_holder);
    }
View Full Code Here

Examples of org.exolab.castor.builder.factory.FieldInfoFactory

    /**
     * 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
TOP
Copyright © 2018 www.massapi.com. 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.