Package com.helger.peppol.xhe
Class DBNAlliancePayload
java.lang.Object
com.helger.peppol.xhe.DBNAlliancePayload
This class contains all the DBNAlliance data per Payload instance, such as a
single invoice in a syntax neutral way. This class maps to the requirements
of the Exchange Header Envelope (XHE) Version 1.0 specification.
- Author:
- Robinson Garcia, Philip Helger
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDBNAlliancePayload(com.helger.peppolid.factory.IIdentifierFactory aIdentifierFactory) Constructor -
Method Summary
Modifier and TypeMethodDescriptionbooleancom.helger.peppolid.IDocumentTypeIdentifierDescription - An OPTIONAL human readable description of the payload.The method or algorithm used for encrypting payload content.Get the contained payload content.Get the contained payload content without cloning it.com.helger.peppolid.IProcessIdentifierbooleanbooleanbooleanbooleanbooleanbooleanbooleanCheck if a payload content is present without having the need to explicitly callgetPayloadContent()which returns a cloned node and is therefore an expensive operation.booleanbooleanbooleanInstanceEncryptionIndicator - Indicator to state whether the payload instance is encrypted or not.setContentTypeCode(com.helger.commons.mime.IMimeType a) Set the content type code.Set the content type code.setContentTypeCode(String sCodeListID, String sValue) Set the content type code list ID.Set the content type code toapplication/xmlsetCustomizationID(com.helger.peppolid.IDocumentTypeIdentifier a) Set the customization identifier.Set the customization identifier.setCustomizationID(String sSchemeID, String sValue) Set the customization identifier scheme ID.Set the content of the fields that are mapped toXHE/Payloads/Payload/Description.setInstanceEncryptionIndicator(boolean b) Set the content of the fields that are mapped toXHE/Payloads/Payload/InstanceEncryptionIndicator.Set the method or algorithm used for encrypting payload content.setPayloadContent(Element aPayloadContent) Set the main payload content that should be transmitted together with the XHE.setPayloadContentNoClone(Element aPayloadContent) Set the main payload content that should be transmitted together with the XHE.setProfileID(com.helger.peppolid.IProcessIdentifier aProfileID) Set the profile identifier.Set the profile identifier.setProfileID(String sSchemeID, String sValue) Set the profile identifier scheme ID.toString()
-
Field Details
-
DEFAULT_CONTENT_TYPE_CODE_LIST_ID
- See Also:
-
DEFAULT_INSTANCE_ENCRYPTION_INDICATOR
public static final boolean DEFAULT_INSTANCE_ENCRYPTION_INDICATOR- See Also:
-
-
Constructor Details
-
DBNAlliancePayload
public DBNAlliancePayload(@Nonnull com.helger.peppolid.factory.IIdentifierFactory aIdentifierFactory) Constructor- Parameters:
aIdentifierFactory- Identifier factory to be used. May not benull.
-
-
Method Details
-
getDescription
Description - An OPTIONAL human readable description of the payload. This field is mapped toXHE/Payloads/Payload/Description.- Returns:
- Description value. May be
null.
-
hasDescription
public boolean hasDescription()- Returns:
trueif a description is present,falseif not.
-
setDescription
Set the content of the fields that are mapped toXHE/Payloads/Payload/Description.- Parameters:
s- Description - An OPTIONAL human readable description of the payload. This field is mapped toXHE/Payloads/Payload/Description.- Returns:
- this for chaining
-
getContentTypeCodeListID
- Returns:
- The content type code list id. May be
nullif not initialized. This field is mapped toXHE/Payloads/Payload/ContentTypeCode/@listID.
-
hasContentTypeCodeListID
public boolean hasContentTypeCodeListID()- Returns:
trueif a Content-Type Code list ID is present,falseif not.
-
setContentTypeCodeListID
Set the content type code list ID.- Parameters:
s- An OPTIONAL aIribute specifying that the ContentTypeCode value is a MIME Type. When set, this aIribute MUST be set to:MIME.- Returns:
- this for chaining
-
getContentTypeCode
- Returns:
- The content type code value. May be
nullif not initialized. This field is mapped toXHE/Payloads/Payload/ContentTypeCode/.
-
hasContentTypeCode
public boolean hasContentTypeCode()- Returns:
trueif a Content-Type Code value is present,falseif not.
-
setContentTypeCode
Set the content type code. The MIME Type of the payload content. For XML payload content the ContentTypeCode MUST be set to:application/xml- Parameters:
s- The Content-Type code to use. This field is mapped toXHE/Payloads/Payload/ContentTypeCode/.- Returns:
- this for chaining
-
setContentTypeCode
-
setContentTypeCode
Set the content type code. The MIME Type of the payload content. For XML payload content the ContentTypeCode MUST be set to:application/xml- Parameters:
a- The Content-Type code to use. May neither benullnor empty. This field is mapped toXHE/Payloads/Payload/ContentTypeCode/.- Returns:
- this for chaining
-
setContentTypeCodeXML
Set the content type code toapplication/xml- Returns:
- this for chaining
-
getCustomizationIDSchemeID
- Returns:
- The identifier of the scheme used for the CustomizationID if one is
defined. May be
nullif not initialized. This field is mapped toXHE/Payloads/Payload/CustomizationID/@schemeID.
-
hasCustomizationIDSchemeID
public boolean hasCustomizationIDSchemeID() -
setCustomizationIDSchemeID
Set the customization identifier scheme ID.- Parameters:
s- The identifier of the scheme used for the CustomizationID if one is defined. May benullif not initialized. This field is mapped toXHE/Payloads/Payload/CustomizationID/@schemeID.- Returns:
- this for chaining
-
getCustomizationID
- Returns:
- If defined in the business document profile or specification of the
payload, this MUST be set to the Customization ID as specified
therein. May be
nullif not initialized. This field is mapped toXHE/Payloads/Payload/CustomizationID/.
-
hasCustomizationID
public boolean hasCustomizationID() -
setCustomizationID
Set the customization identifier.- Parameters:
s- If defined in the business document profile or specification of the payload, this MUST be set to the Customization ID as specified therein. Otherwise, MUST NOT be used. May benullif not initialized. This field is mapped toXHE/Payloads/Payload/CustomizationID/.- Returns:
- this for chaining
-
getCustomizationIDAsIdentifier
- Returns:
- The customization identifier as a document type identifier or
nullif certain information are missing or are invalid.
-
setCustomizationID
@Nonnull public DBNAlliancePayload setCustomizationID(@Nullable com.helger.peppolid.IDocumentTypeIdentifier a) Set the customization identifier.- Parameters:
a- The document type identifier to use. May benull.- Returns:
- this for chaining
- See Also:
-
setCustomizationID
-
getProfileIDSchemeID
- Returns:
- The identifier of the scheme used for the ProfileID if one is
defined. May be
nullif not initialized. This field is mapped toXHE/Payloads/Payload/ProfileID/@schemeID.
-
hasProfileIDSchemeID
public boolean hasProfileIDSchemeID() -
setProfileIDSchemeID
Set the profile identifier scheme ID.- Parameters:
s- The identifier of the scheme used for the ProfileID if one is defined. May benullif not initialized. This field is mapped toXHE/Payloads/Payload/ProfileID/@schemeID.- Returns:
- this for chaining
-
getProfileID
- Returns:
- If defined in the business document profile or specification of the
payload, this MUST be set to the Profile ID as specified therein.
Otherwise, MUST NOT be used. May be
nullif not initialized. This field is mapped toXHE/Payloads/Payload/ProfileID/.
-
hasProfileID
public boolean hasProfileID() -
setProfileID
Set the profile identifier.- Parameters:
s- If defined in the business document profile or specification of the payload, this MUST be set to the Profile ID as specified therein. Otherwise, MUST NOT be used. May benullif not initialized. This field is mapped toXHE/Payloads/Payload/ProfileID/.- Returns:
- this
-
getProfileIDAsIdentifier
- Returns:
- The profile identifier or
nullif certain information are missing or are invalid.
-
setProfileID
@Nonnull public DBNAlliancePayload setProfileID(@Nullable com.helger.peppolid.IProcessIdentifier aProfileID) Set the profile identifier.- Parameters:
aProfileID- The process identifier to use. May benull.- Returns:
- this
- See Also:
-
setProfileID
-
isInstanceEncryptionIndicator
public boolean isInstanceEncryptionIndicator()InstanceEncryptionIndicator - Indicator to state whether the payload instance is encrypted or not. This field is mapped toXHE/Payloads/Payload/InstanceEncryptionIndicator.- Returns:
- InstanceEncryptionIndicator value. Default value is false.
-
setInstanceEncryptionIndicator
Set the content of the fields that are mapped toXHE/Payloads/Payload/InstanceEncryptionIndicator.- Parameters:
b- Indicator to state whether the payload instance is encrypted or not. This field is mapped toXHE/Payloads/Payload/InstanceEncryptionIndicator.- Returns:
- this
-
getInstanceEncryptionMethod
The method or algorithm used for encrypting payload content. When encryption is used, payloads MUST be encrypted using one of the supported encryption methods and algorithms as specified in section 7.3 and the value of this element MUST be set to the corresponding identifier. This field is mapped toXHE/Payloads/Payload/InstanceEncryptionMethod.- Returns:
- InstanceEncryptionMethod value. Default value is
false.
-
hasInstanceEncryptionMethod
public boolean hasInstanceEncryptionMethod()- Returns:
trueif a InstanceEncryptionMethod is present,falseif not.
-
setInstanceEncryptionMethod
Set the method or algorithm used for encrypting payload content. When encryption is used, payloads MUST be encrypted using one of the supported encryption methods and algorithms as specified in section 7.3 and the value of this element MUST be set to the corresponding identifier. The content of the fields that are mapped toXHE/Payloads/Payload/InstanceEncryptionMethod.- Parameters:
s- Method used to encrypt the payload instance. This field is mapped toXHE/Payloads/Payload/InstanceEncryptionMethod.- Returns:
- this for chaining
-
getPayloadContent
Get the contained payload content.- Returns:
nullif no payload content is present. A clone (deep copy) of the payload content otherwise.- See Also:
-
getPayloadContentNoClone
Get the contained payload content without cloning it.- Returns:
nullif no payload content is present.- See Also:
-
hasPayloadContent
public boolean hasPayloadContent()Check if a payload content is present without having the need to explicitly callgetPayloadContent()which returns a cloned node and is therefore an expensive operation.- Returns:
trueif a payload content is present,falseotherwise.
-
setPayloadContent
Set the main payload content that should be transmitted together with the XHE. The DOM element is cloned internally to avoid outside modification- Parameters:
aPayloadContent- The payload content to be set. May not benull. Internally the passed element is cloned, so that further modifications outside of this method have no impact on the XHE inside this object.- Returns:
- this
- See Also:
-
setPayloadContentNoClone
Set the main payload content that should be transmitted together with the XHE. The DOM element is not cloned / copied internally.- Parameters:
aPayloadContent- The payload content to be set. May not benull. Internally the passed element is cloned, so that further modifications outside of this method have no impact on the XHE inside this object.- Returns:
- this
- See Also:
-
areAllMandatoryFieldsSet
public boolean areAllMandatoryFieldsSet() -
toString
-