Package com.sun.codemodel

Examples of com.sun.codemodel.JCodeModel.ref()


       
        JCodeModel model = generator.getCodeModel();
        JDefinedClass echo = model._getClass("jsr181.echo.wrapped.EchoPortType");
        assertNotNull(echo);
       
        JMethod method = echo.getMethod("echo", new JType[] { model.ref(String.class) });
        assertNotNull(method);
        assertEquals( model.ref(String.class), method.type() );
       
        assertNotNull(model._getClass("jsr181.echo.wrapped.EchoClient"));
        assertNotNull(model._getClass("jsr181.echo.wrapped.EchoImpl"));
View Full Code Here


        JDefinedClass echo = model._getClass("jsr181.echo.wrapped.EchoPortType");
        assertNotNull(echo);
       
        JMethod method = echo.getMethod("echo", new JType[] { model.ref(String.class) });
        assertNotNull(method);
        assertEquals( model.ref(String.class), method.type() );
       
        assertNotNull(model._getClass("jsr181.echo.wrapped.EchoClient"));
        assertNotNull(model._getClass("jsr181.echo.wrapped.EchoImpl"));
    }
   
View Full Code Here

    private void toTemporal( final FieldOutline f, final Basic basic )
    {
        final String typeName = f.getRawType().binaryName();
        final JCodeModel cm = f.parent().parent().getCodeModel();

        if ( typeName.equals( cm.ref( java.util.Date.class ).binaryName() )
             || typeName.equals( cm.ref( java.sql.Date.class ).binaryName() )
             || typeName.equals( cm.ref( Calendar.class ).binaryName() ) )
        {
            basic.setTemporal( TemporalType.DATE );
        }
View Full Code Here

    {
        final String typeName = f.getRawType().binaryName();
        final JCodeModel cm = f.parent().parent().getCodeModel();

        if ( typeName.equals( cm.ref( java.util.Date.class ).binaryName() )
             || typeName.equals( cm.ref( java.sql.Date.class ).binaryName() )
             || typeName.equals( cm.ref( Calendar.class ).binaryName() ) )
        {
            basic.setTemporal( TemporalType.DATE );
        }
        else if ( typeName.equals( cm.ref( java.sql.Time.class ).binaryName() ) )
View Full Code Here

        final String typeName = f.getRawType().binaryName();
        final JCodeModel cm = f.parent().parent().getCodeModel();

        if ( typeName.equals( cm.ref( java.util.Date.class ).binaryName() )
             || typeName.equals( cm.ref( java.sql.Date.class ).binaryName() )
             || typeName.equals( cm.ref( Calendar.class ).binaryName() ) )
        {
            basic.setTemporal( TemporalType.DATE );
        }
        else if ( typeName.equals( cm.ref( java.sql.Time.class ).binaryName() ) )
        {
View Full Code Here

             || typeName.equals( cm.ref( java.sql.Date.class ).binaryName() )
             || typeName.equals( cm.ref( Calendar.class ).binaryName() ) )
        {
            basic.setTemporal( TemporalType.DATE );
        }
        else if ( typeName.equals( cm.ref( java.sql.Time.class ).binaryName() ) )
        {
            basic.setTemporal( TemporalType.TIME );
        }
        else if ( typeName.equals( cm.ref( java.sql.Timestamp.class ).binaryName() ) )
        {
View Full Code Here

        }
        else if ( typeName.equals( cm.ref( java.sql.Time.class ).binaryName() ) )
        {
            basic.setTemporal( TemporalType.TIME );
        }
        else if ( typeName.equals( cm.ref( java.sql.Timestamp.class ).binaryName() ) )
        {
            basic.setTemporal( TemporalType.TIMESTAMP );
        }
    }
View Full Code Here

    private void annotateMappedSuperclass( final Outline outline, final MappedSuperclass ms )
    {
        final JCodeModel cm = outline.getCodeModel();
        final ClassOutline c = this.getClassOutline( outline, ms.getClazz() );
        c.implClass.annotate( cm.ref( javax.persistence.MappedSuperclass.class ) );

        if ( ms.getAttributes() != null )
        {
            this.annotate( cm, c, ms.getAttributes() );
        }
View Full Code Here

            this.annotate( c, ms.getIdClass() );
        }
        if ( ms.getPostLoad() != null )
        {
            final JMethod m = this.getMethod( c, ms.getPostLoad().getMethodName() );
            m.annotate( cm.ref( javax.persistence.PostLoad.class ) );
        }
        if ( ms.getPostPersist() != null )
        {
            final JMethod m = this.getMethod( c, ms.getPostPersist().getMethodName() );
            m.annotate( cm.ref( javax.persistence.PostPersist.class ) );
View Full Code Here

            m.annotate( cm.ref( javax.persistence.PostLoad.class ) );
        }
        if ( ms.getPostPersist() != null )
        {
            final JMethod m = this.getMethod( c, ms.getPostPersist().getMethodName() );
            m.annotate( cm.ref( javax.persistence.PostPersist.class ) );
        }
        if ( ms.getPostRemove() != null )
        {
            final JMethod m = this.getMethod( c, ms.getPostRemove().getMethodName() );
            m.annotate( cm.ref( javax.persistence.PostRemove.class ) );
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.