Search in sources :

Example 1 with BDXR1DocumentTypeIdentifier

use of com.helger.peppolid.bdxr.smp1.doctype.BDXR1DocumentTypeIdentifier in project phoss-smp by phax.

the class SMPServiceInformation method getAsJAXBObjectBDXR1.

@Nullable
public com.helger.xsds.bdxr.smp1.ServiceMetadataType getAsJAXBObjectBDXR1() {
    if (m_aProcesses.isEmpty()) {
        // "ProcessList" is mandatory and MUST contain at least 1 value
        return null;
    }
    final com.helger.xsds.bdxr.smp1.ServiceInformationType aSI = new com.helger.xsds.bdxr.smp1.ServiceInformationType();
    // Explicit constructor call is needed here!
    aSI.setParticipantIdentifier(new BDXR1ParticipantIdentifier(m_aServiceGroup.getParticipantIdentifier()));
    aSI.setDocumentIdentifier(new BDXR1DocumentTypeIdentifier(m_aDocumentTypeIdentifier));
    final com.helger.xsds.bdxr.smp1.ProcessListType aProcesses = new com.helger.xsds.bdxr.smp1.ProcessListType();
    for (final ISMPProcess aProcess : m_aProcesses.values()) {
        final com.helger.xsds.bdxr.smp1.ProcessType aJAXBProcess = aProcess.getAsJAXBObjectBDXR1();
        if (aJAXBProcess != null)
            aProcesses.addProcess(aJAXBProcess);
    }
    if (aProcesses.hasNoProcessEntries()) {
        // "ProcessList" is mandatory and MUST contain at least 1 value
        return null;
    }
    aSI.setProcessList(aProcesses);
    aSI.setExtension(getAsBDXRExtension());
    final com.helger.xsds.bdxr.smp1.ServiceMetadataType ret = new com.helger.xsds.bdxr.smp1.ServiceMetadataType();
    ret.setServiceInformation(aSI);
    return ret;
}
Also used : BDXR1ParticipantIdentifier(com.helger.peppolid.bdxr.smp1.participant.BDXR1ParticipantIdentifier) BDXR1DocumentTypeIdentifier(com.helger.peppolid.bdxr.smp1.doctype.BDXR1DocumentTypeIdentifier) Nullable(javax.annotation.Nullable)

Example 2 with BDXR1DocumentTypeIdentifier

use of com.helger.peppolid.bdxr.smp1.doctype.BDXR1DocumentTypeIdentifier in project peppol-commons by phax.

the class BDXR1IdentifierFactory method createDocumentTypeIdentifier.

@Nullable
public BDXR1DocumentTypeIdentifier createDocumentTypeIdentifier(@Nullable final String sScheme, @Nullable final String sValue) {
    final String sRealScheme = nullNotEmpty(sScheme);
    final String sRealValue = nullNotEmpty(isDocumentTypeIdentifierCaseInsensitive(sRealScheme) ? getUnifiedValue(sValue) : sValue);
    if (isDocumentTypeIdentifierSchemeValid(sRealScheme) && isDocumentTypeIdentifierValueValid(sRealValue))
        return new BDXR1DocumentTypeIdentifier(sRealScheme, sRealValue);
    return null;
}
Also used : BDXR1DocumentTypeIdentifier(com.helger.peppolid.bdxr.smp1.doctype.BDXR1DocumentTypeIdentifier) Nullable(javax.annotation.Nullable)

Aggregations

BDXR1DocumentTypeIdentifier (com.helger.peppolid.bdxr.smp1.doctype.BDXR1DocumentTypeIdentifier)2 Nullable (javax.annotation.Nullable)2 BDXR1ParticipantIdentifier (com.helger.peppolid.bdxr.smp1.participant.BDXR1ParticipantIdentifier)1