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;
}
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;
}
Aggregations