Examples of FieldInfoFactory


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

    /**
     * Tests if getFields returns a list of {@link JDOFieldInfoNature}s.
     */
    public void testGetElementFields() {
        ClassInfo classInfo = new ClassInfo(new JClass("test"));
        FieldInfoFactory factory = new FieldInfoFactory();
        FieldInfo field = factory.createFieldInfo(new XSClass(
                new JClass("Book")), "isbn");
        field.addNature(JDOFieldInfoNature.class.getName());
        JDOFieldInfoNature jdoField = new JDOFieldInfoNature(field);
        jdoField.setColumnName("isbn");
        jdoField.setColumnType("integer");
View Full Code Here

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

    /**
     * Tests if getFields returns a list of {@link JDOFieldInfoNature}s.
     */
    public void testGetElementFieldsWithMoreThanOneField() {
        ClassInfo classInfo = new ClassInfo(new JClass("test"));
        FieldInfoFactory factory = new FieldInfoFactory();
        FieldInfo isbn = factory.createFieldInfo(new XSClass(
                new JClass("Book")), "isbn");
        FieldInfo title = factory.createFieldInfo(new XSClass(
                new JClass("Book")), "title");
        isbn.addNature(JDOFieldInfoNature.class.getName());
        title.addNature(JDOFieldInfoNature.class.getName());
        JDOFieldInfoNature jdoIsbn = new JDOFieldInfoNature(isbn);
        JDOFieldInfoNature jdoTitle = new JDOFieldInfoNature(title);
View Full Code Here

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

     * Test getFields with a ClassInfo having a FieldInfo but without
     * JDOFieldInfoNature.
     */
    public void testGetElementFieldsWithoutNatures() {
        ClassInfo classInfo = new ClassInfo(new JClass("test"));
        FieldInfoFactory factory = new FieldInfoFactory();
        FieldInfo field = factory.createFieldInfo(new XSClass(
                new JClass("Book")), "isbn");
        classInfo.addFieldInfo(field);
        classInfo.addNature(JDOClassInfoNature.class.getName());
        JDOClassInfoNature jdo = new JDOClassInfoNature(classInfo);

View Full Code Here

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

    /**
     * Tests if getFields returns a list of {@link JDOFieldInfoNature}s.
     */
    public void testGetElementFieldsOnlyOneHasNature() {
        ClassInfo classInfo = new ClassInfo(new JClass("test"));
        FieldInfoFactory factory = new FieldInfoFactory();
        FieldInfo field = factory.createFieldInfo(new XSClass(
                new JClass("Book")), "isbn");
        FieldInfo field2 = factory.createFieldInfo(new XSClass(
                new JClass("Book")), "abc");
        field.addNature(JDOFieldInfoNature.class.getName());
        JDOFieldInfoNature jdoField = new JDOFieldInfoNature(field);
        jdoField.setColumnName("isbn");
        jdoField.setColumnType("integer");
View Full Code Here

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

    /**
     * Tests if getFields returns a list of {@link JDOFieldInfoNature}s.
     */
    public void testGetAttributeTextElementFields() {
        ClassInfo classInfo = new ClassInfo(new JClass("test"));
        FieldInfoFactory factory = new FieldInfoFactory();
       
        FieldInfo elementField = factory.createFieldInfo(new XSClass(
                new JClass("Book")), "isbn");
        // Set node type
        elementField.addNature(XMLInfoNature.class.getName());
        new XMLInfoNature(elementField).setNodeType(NodeType.ELEMENT);
        // Set column name
        elementField.addNature(JDOFieldInfoNature.class.getName());
        JDOFieldInfoNature jdoField = new JDOFieldInfoNature(elementField);
        jdoField.setColumnName("isbn");
        classInfo.addFieldInfo(elementField);
       
        FieldInfo attributeField = factory.createFieldInfo(new XSClass(
                new JClass("Book")), "title");
        // Set node type
        attributeField.addNature(XMLInfoNature.class.getName());
        new XMLInfoNature(attributeField).setNodeType(NodeType.ATTRIBUTE);
        // Set column name
        attributeField.addNature(JDOFieldInfoNature.class.getName());
        jdoField = new JDOFieldInfoNature(attributeField);
        jdoField.setColumnName("title");
        classInfo.addFieldInfo(attributeField);
       
        FieldInfo textField = factory.createFieldInfo(new XSClass(
                new JClass("Book")), "price");
        // Set node type
        textField.addNature(XMLInfoNature.class.getName());
        new XMLInfoNature(textField).setNodeType(NodeType.TEXT);
        // Set column name
View Full Code Here

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

    /**   
     * 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

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

     * Ant task a BuildException will be thrown.
     */
    private void config() {
        // Create Source Generator with appropriate type factory
        if (_types != null) {
            FieldInfoFactory factory;
            try {
                factory = new FieldInfoFactory(_types);
                _sgen = new CastorSourceGeneratorWrapper(factory);
            } catch (Exception e) {
                try {
                    factory = (FieldInfoFactory) Class.forName(_types).newInstance();
                    _sgen = new CastorSourceGeneratorWrapper(factory);
View Full Code Here

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

        _internalContext = new BackwardCompatibilityContext();

        setJavaNaming(_internalContext.getJavaNaming());
        _dialog = new ConsoleDialog();
        _infoFactory = (infoFactory == null) ? new FieldInfoFactory() : infoFactory;

        super.load();

        _groupNaming = new GroupNaming(getJavaNaming());
View Full Code Here

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

     * Ant task a BuildException will be thrown.
     */
    private void config() {
        // Create Source Generator with appropriate type factory
        if (_types != null) {
            FieldInfoFactory factory;
            try {
                factory = new FieldInfoFactory(_types);
                _sgen = new CastorSourceGeneratorWrapper(factory);
            } catch (Exception e) {
                try {
                    factory = (FieldInfoFactory) Class.forName(_types).newInstance();
                    _sgen = new CastorSourceGeneratorWrapper(factory);
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.