Code example for DatatypeFactory

Methods: newDuration

0
        schema = sf.newSchema( getClass().getResource("/schema/2.0b/oadr_20b.xsd") );
        this.validator = schema.newValidator();
    } 
     
    @Test public void testSerialize() throws Exception {
        final Duration duration = xmlDataTypeFac.newDuration( true, 0, 0, 0, 0, 5, 0 );
         
        OadrSignedObject payload = new OadrSignedObject()
            .withOadrCreateReport( new OadrCreateReport() 
                .withRequestID( "1234" ) 
                .withVenID( "Vtn-1234" ) 
                .withSchemaVersion( "2.0b" ) 
                .withOadrReportRequests( new OadrReportRequest() 
                        .withReportRequestID( "request-1234" ) 
                        .withReportSpecifier( new ReportSpecifier() 
                                .withReportSpecifierID( "1234" ) 
                                .withGranularity( new DurationPropType( new DurationValue( duration.toString() ) ) )
                                .withReportBackDuration( new DurationPropType( new DurationValue( duration.toString() ) ) )
                                .withSpecifierPayloads( new SpecifierPayload() 
                                        .withRID( "report 1234" )