Examples of DateProperty


Examples of org.mapstruct.ap.test.builtin.bean.DateProperty

    @Test
    @WithClasses({ DateProperty.class, XmlGregorianCalendarProperty.class, DateToXmlGregCalMapper.class })
    public void shouldApplyBuiltInOnDateToXmlGregCal() throws ParseException, DatatypeConfigurationException {

        DateProperty source = new DateProperty();
        source.setProp( createDate( "31-08-1982 10:20:56" ) );

        XmlGregorianCalendarProperty target = DateToXmlGregCalMapper.INSTANCE.map( source );
        assertThat( target ).isNotNull();
        assertThat( target.getProp() ).isNotNull();
        assertThat( target.getProp().toString() ).isEqualTo( "1982-08-31T10:20:56.000+02:00" );
View Full Code Here

Examples of org.mapstruct.ap.test.builtin.bean.DateProperty

    public void shouldApplyBuiltInOnXmlGregCalToDate() throws ParseException, DatatypeConfigurationException {

        XmlGregorianCalendarProperty source = new XmlGregorianCalendarProperty();
        source.setProp( createXmlCal( 1999, 3, 2, 60 ) );

        DateProperty target = XmlGregCalToDateMapper.INSTANCE.map( source );
        assertThat( target ).isNotNull();
        assertThat( target.getProp() ).isNotNull();
        assertThat( target.getProp().toString() ).isEqualTo( "Tue Mar 02 00:00:00 CET 1999" );

    }
View Full Code Here

Examples of org.mapstruct.ap.test.builtin.bean.DateProperty

    public void shouldApplyBuiltInOnCalendarToDate() throws ParseException, DatatypeConfigurationException {

        CalendarProperty source = new CalendarProperty();
        source.setProp( createCalendar( "02.03.1999" ) );

        DateProperty target = CalendarToDateMapper.INSTANCE.map( source );
        assertThat( target ).isNotNull();
        assertThat( target.getProp() ).isNotNull();
        assertThat( target.getProp()).isEqualTo( createCalendar( "02.03.1999" ).getTime());
    }
View Full Code Here

Examples of org.mapstruct.ap.test.builtin.bean.DateProperty

    @Test
    @WithClasses({ CalendarProperty.class, DateProperty.class, DateToCalendarMapper.class })
    public void shouldApplyBuiltInOnDateToCalendar() throws ParseException, DatatypeConfigurationException {

        DateProperty source = new DateProperty();
        source.setProp( new SimpleDateFormat( "dd.MM.yyyy" ).parse( "02.03.1999" ) );

        CalendarProperty target = DateToCalendarMapper.INSTANCE.map( source );
        assertThat( target ).isNotNull();
        assertThat( target.getProp() ).isNotNull();
        assertThat( target.getProp()).isEqualTo( createCalendar( "02.03.1999" ));
View Full Code Here

Examples of org.metagrid.gatekeeper.node.property.DateProperty

            this.idbuilder = idbuilder;
            //
            // Created date.
            this.init(
                ReadOnlyProperty.wrap(
                    new DateProperty(
                        this,
                        LoggedException.CREATED_PROPERTY_URI
                        ){
                        @Override
                        protected Date getDate()
                            {
                            return LoggedExceptionImpl.this.created();
                            }
                        @Override
                        protected void setDate(final Date value)
                            {
                            throw new IllegalArgumentException(
                                "Attempt to set a readonly property [" + this + "] to [" + value + "]"
                                );
                            }
                        }
                    )
                );
            //
            // Modified date.
            this.init(
                new DateProperty(
                    this,
                    LoggedException.MODIFIED_PROPERTY_URI
                    ){
                    @Override
                    protected Date getDate()
View Full Code Here

Examples of org.metagrid.gatekeeper.node.property.DateProperty

        this.builder = builder;
        //
        // Created date.
        this.init(
            ReadOnlyProperty.wrap(
                new DateProperty(
                    this,
                    FruitNode.CREATED_PROPERTY_URI
                    ){
                    @Override
                    protected Date getDate()
                        {
                        return object().created();
                        }

                    @Override
                    protected void setDate(Date value)
                        {
                        //
                        // This should be trapped by theReadOnlyProperty wrapper, so if it gets this far it is an error.
                        log.error("Attempt to set a readonly property [" + this + "] to [" + value + "]");
                        throw new IllegalArgumentException(
                            "Attempt to set a readonly property [" + this + "] to [" + value + "]"
                            );
                        }
                    }
                )
            );
        //
        // Modified date.
        this.init(
            new DateProperty(
                this,
                FruitNode.MODIFIED_PROPERTY_URI
                ){
                @Override
                protected Date getDate()
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.