Package org.exolab.javasource

Examples of org.exolab.javasource.JClass$JInnerClass


     * @param classes the JClass[] to bind
     */
    public void bindSourceCode(final Annotated annotated, final JClass[] classes) {
        _sourcesByComponent.put(annotated, classes);
        for (int i = 0; i < classes.length; i++) {
            JClass jClass = classes[i];
            if (jClass != null) {
                _sourcesByName.put(jClass.getName(), jClass);
            }
        }
    } //-- bindSourceCode
View Full Code Here


     *            the JClass name to check against
     * @return the JClass with the given name
     */
    JClass getProcessed(final String className) {
        for (int i = 0; i < _processed.size(); i++) {
            JClass jClass = _processed.elementAt(i);
            if (jClass.getName().equals(className)) {
                return jClass;
            }
        }
        return null;
    } //-- getProcessed
View Full Code Here

     * @param className the JClass name to check against
     * @return true if a JClass with the given name has been marked as processed
     */
    boolean processed(final String className) {
        for (int i = 0; i < _processed.size(); i++) {
            JClass jClass = _processed.elementAt(i);
            if (jClass.getName().equals(className)) {
                return true;
            }
        }
        return false;
    } //-- processed
View Full Code Here

     * @param useJava50 Whether Java 5.0 is the target JVM.
     * @return {@link JCollectionType} instance representing a {@link Hashtable}
     */
    public static final JType createHashtable(final boolean useJava50) {
        if (useJava50) {
            return new JClass("java.util.Hashtable<Object,Object>");
        }
        return new JClass("java.util.Hashtable");
    }
View Full Code Here

     *
     * @param classInfo the XML Schema element declaration
     * @return the ClassMapping representing the ClassInfo
     */
    public ClassMapping createMapping(final ClassInfo classInfo) {
        JClass jClass    = classInfo.getJClass();
        String className = jClass.getName();

        ClassMapping classMapping = new ClassMapping();
        classMapping.setName(className);

        //-- Set namespace prefix
        MapTo mapTo = new MapTo();
        classMapping.setMapTo(mapTo);

        XMLInfoNature xmlNature = new XMLInfoNature(classInfo);

        String nsPrefix = xmlNature.getNamespacePrefix();
        if ((nsPrefix != null) && (nsPrefix.length() > 0)) {
            mapTo.setNsPrefix(nsPrefix);
        }

        //-- Set namespace URI
        String nsURI = xmlNature.getNamespaceURI();
        if ((nsURI != null) && (nsURI.length() > 0)) {
            mapTo.setNsUri(nsURI);
        }

        //-- set XML Name
        mapTo.setXml(xmlNature.getNodeName());

        //-- set Element Definition flag
        mapTo.setElementDefinition(xmlNature.isElementDefinition());

        //-- set grouping compositor
        if (xmlNature.isChoice()) {
            // TODO need a way to specify choice in Mapping file
        }

        boolean isAbstract = classInfo.isAbstract();
        if (!isAbstract) {
            isAbstract = jClass.getModifiers().isAbstract();
        }
        classInfo.setAbstract(isAbstract);

        //-- To prevent compiler warnings...make sure
        //-- we don't declare temp variables if field count is 0;
View Full Code Here

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

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

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

     * 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

     * 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

TOP

Related Classes of org.exolab.javasource.JClass$JInnerClass

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.