@NotThreadSafe public class PeppolSBDHDocument extends Object
| Constructor and Description |
|---|
PeppolSBDHDocument()
Deprecated.
Use the version with an explicit identifier factory.
|
PeppolSBDHDocument(com.helger.peppol.identifier.factory.IIdentifierFactory aIdentifierFactory)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
areAllFieldsSet() |
static PeppolSBDHDocument |
create(Element aBusinessMessage)
Deprecated.
|
static PeppolSBDHDocument |
create(Element aBusinessMessage,
com.helger.peppol.identifier.factory.IIdentifierFactory aIdentifierFactory)
Create a new
PeppolSBDHDocument object for a business message. |
boolean |
equals(Object o) |
Element |
getBusinessMessage()
Get the contained business message.
|
LocalDateTime |
getCreationDateAndTime()
The date and time for when this envelope was created.
|
com.helger.peppol.identifier.generic.doctype.IDocumentTypeIdentifier |
getDocumentTypeAsIdentifier() |
String |
getDocumentTypeScheme() |
String |
getDocumentTypeValue() |
String |
getInstanceIdentifier()
An informative unique ID created by the issuer of the envelope.
|
com.helger.peppol.identifier.generic.process.IProcessIdentifier |
getProcessAsIdentifier() |
String |
getProcessScheme() |
String |
getProcessValue() |
com.helger.peppol.identifier.generic.participant.IParticipantIdentifier |
getReceiverAsIdentifier() |
String |
getReceiverScheme() |
String |
getReceiverValue() |
com.helger.peppol.identifier.generic.participant.IParticipantIdentifier |
getSenderAsIdentifier() |
String |
getSenderScheme() |
String |
getSenderValue() |
String |
getStandard()
The standard of the enveloped business message, normally described by use
of the XML namespace of the business message root element (such as
urn:oasis:names:specification:ubl:schema:xsd:Order-2).
|
String |
getType()
Message type - mandatory in SBDH.
|
String |
getTypeVersion()
The version number of the enveloped business message (such as the value
"2.1" for OASIS UBL 2.1 or "2.0" for OASIS UBL 2.0).
|
boolean |
hasBusinessMessage()
Check if a business message is present without having the need to
explicitly call
getBusinessMessage() which returns a cloned node
and is therefore an expensive operation. |
int |
hashCode() |
PeppolSBDHDocument |
setBusinessMessage(Element aBusinessMessage)
Set the main business message that should be transmitted together with the
SBDH.
|
PeppolSBDHDocument |
setDocumentIdentification(String sStandard,
String sTypeVersion,
String sType,
String sInstanceIdentifier,
LocalDateTime aCreationDateAndTime)
Set the content of the fields that are mapped to
StandardBusinessDocumentHeader/DocumentIdentification. |
PeppolSBDHDocument |
setDocumentType(String sScheme,
String sValue)
Set the document type identifier.
|
PeppolSBDHDocument |
setDocumentTypeWithDefaultScheme(String sValue)
Set the document type identifier using the default identifier
scheme/authority
PeppolIdentifierHelper.DEFAULT_DOCUMENT_TYPE_SCHEME . |
PeppolSBDHDocument |
setProcess(String sScheme,
String sValue)
Set the process identifier.
|
PeppolSBDHDocument |
setProcessWithDefaultScheme(String sValue)
Set the document type identifier using the default identifier
scheme/authority
PeppolIdentifierHelper.DEFAULT_PROCESS_SCHEME. |
PeppolSBDHDocument |
setReceiver(String sScheme,
String sValue)
Set the receiver identifier.
|
PeppolSBDHDocument |
setReceiverWithDefaultScheme(String sValue)
Set the receiver identifier value using the default identifier
scheme/authority
PeppolIdentifierHelper.DEFAULT_PARTICIPANT_SCHEME. |
PeppolSBDHDocument |
setSender(String sScheme,
String sValue)
Set the sender identifier.
|
PeppolSBDHDocument |
setSenderWithDefaultScheme(String sValue)
Set the sender identifier value using the default identifier
scheme/authority
PeppolIdentifierHelper.DEFAULT_PARTICIPANT_SCHEME. |
String |
toString() |
@Deprecated public PeppolSBDHDocument()
public PeppolSBDHDocument(@Nonnull com.helger.peppol.identifier.factory.IIdentifierFactory aIdentifierFactory)
aIdentifierFactory - Identifier factory to be used. May not be null.@Nonnull public PeppolSBDHDocument setSender(@Nonnull @Nonempty String sScheme, @Nonnull @Nonempty String sValue)
sScheme - The PEPPOL identifier scheme. This is usually always
PeppolIdentifierHelper.DEFAULT_PARTICIPANT_SCHEME. May
neither be null nor empty. This field is mapped to
StandardBusinessDocumentHeader/Sender/Identifier/@Authority
.sValue - The sender identifier value. May neither be null nor
empty. This field is mapped to
StandardBusinessDocumentHeader/Sender/Identifier/.@Nonnull public PeppolSBDHDocument setSenderWithDefaultScheme(@Nonnull @Nonempty String sValue)
PeppolIdentifierHelper.DEFAULT_PARTICIPANT_SCHEME.sValue - The sender identifier value. May neither be null nor
empty. This field is mapped to
StandardBusinessDocumentHeader/Sender/Identifier/.@Nullable public String getSenderScheme()
null if not
initialized. This field is mapped to
StandardBusinessDocumentHeader/Sender/Identifier/@Authority
.@Nullable public String getSenderValue()
null if not
initialized. This field is mapped to
StandardBusinessDocumentHeader/Sender/Identifier/.@Nullable public com.helger.peppol.identifier.generic.participant.IParticipantIdentifier getSenderAsIdentifier()
null if certain information are missing or are
invalid.@Nonnull public PeppolSBDHDocument setReceiver(@Nonnull @Nonempty String sScheme, @Nonnull @Nonempty String sValue)
sScheme - The PEPPOL identifier scheme. This is usually always
PeppolIdentifierHelper.DEFAULT_PARTICIPANT_SCHEME . May
neither be null nor empty. This field is mapped to
StandardBusinessDocumentHeader/Receiver/Identifier/@Authority
.sValue - The receiver identifier value. May neither be null nor
empty. This field is mapped to
StandardBusinessDocumentHeader/Receiver/Identifier/.@Nonnull public PeppolSBDHDocument setReceiverWithDefaultScheme(@Nonnull @Nonempty String sValue)
PeppolIdentifierHelper.DEFAULT_PARTICIPANT_SCHEME.sValue - The sender identifier value. May neither be null nor
empty. This field is mapped to
StandardBusinessDocumentHeader/Receiver/Identifier/.@Nullable public String getReceiverScheme()
null if not
initialized. This field is mapped to
StandardBusinessDocumentHeader/Receiver/Identifier/@Authority
.@Nullable public String getReceiverValue()
null if not
initialized. This field is mapped to
StandardBusinessDocumentHeader/Receiver/Identifier/.@Nullable public com.helger.peppol.identifier.generic.participant.IParticipantIdentifier getReceiverAsIdentifier()
null if certain information are missing or are
invalid.@Nonnull public PeppolSBDHDocument setDocumentType(@Nonnull @Nonempty String sScheme, @Nonnull @Nonempty String sValue)
sScheme - The document type identifier scheme. May neither be
null nor empty.sValue - The document type identifier value. May neither be null
nor empty. This field is mapped to
StandardBusinessDocumentHeader/BusinessScope/Scope[Type/text()="DOCUMENTID"]/InstanceIdentifier
.@Nonnull public PeppolSBDHDocument setDocumentTypeWithDefaultScheme(@Nonnull @Nonempty String sValue)
PeppolIdentifierHelper.DEFAULT_DOCUMENT_TYPE_SCHEME .sValue - The document type identifier value. May neither be null
nor empty. This field is mapped to
StandardBusinessDocumentHeader/BusinessScope/Scope[Type/text()="DOCUMENTID"]/InstanceIdentifier
.@Nullable public String getDocumentTypeScheme()
null if
not initialized yet. This field is currently not mapped.@Nullable public String getDocumentTypeValue()
null if not
initialized yet. This field is mapped to
StandardBusinessDocumentHeader/BusinessScope/Scope[Type/text()="DOCUMENTID"]/InstanceIdentifier
.@Nullable public com.helger.peppol.identifier.generic.doctype.IDocumentTypeIdentifier getDocumentTypeAsIdentifier()
null if
certain information are missing or are invalid.@Nonnull public PeppolSBDHDocument setProcess(@Nonnull @Nonempty String sScheme, @Nonnull @Nonempty String sValue)
sScheme - The process identifier scheme. May neither be null nor
empty.sValue - The process identifier. May neither be null nor empty.
This field is mapped to
StandardBusinessDocumentHeader/BusinessScope/Scope[Type/text()="PROCESSID"]/InstanceIdentifier
.@Nonnull public PeppolSBDHDocument setProcessWithDefaultScheme(@Nonnull @Nonempty String sValue)
PeppolIdentifierHelper.DEFAULT_PROCESS_SCHEME.sValue - The process identifier. May neither be null nor empty.
This field is mapped to
StandardBusinessDocumentHeader/BusinessScope/Scope[Type/text()="PROCESSID"]/InstanceIdentifier
.@Nullable public String getProcessScheme()
null if not
initialized yet. This field is currently not mapped.@Nullable public String getProcessValue()
null if not
initialized yet. This field is mapped to
StandardBusinessDocumentHeader/BusinessScope/Scope[Type/text()="PROCESSID"]/InstanceIdentifier
.@Nullable public com.helger.peppol.identifier.generic.process.IProcessIdentifier getProcessAsIdentifier()
null if certain
information are missing or are invalid.@Nonnull public PeppolSBDHDocument setDocumentIdentification(@Nonnull String sStandard, @Nonnull String sTypeVersion, @Nonnull String sType, @Nonnull String sInstanceIdentifier, @Nonnull LocalDateTime aCreationDateAndTime)
StandardBusinessDocumentHeader/DocumentIdentification.sStandard - The standard of the enveloped business message, normally described
by use of the XML namespace of the business message root element
(such as urn:oasis:names:specification: ubl:schema:xsd:Order-2). May
not be null. This field is mapped to
StandardBusinessDocumentHeader/DocumentIdentification/Standard
.sTypeVersion - The version number of the enveloped business message (such as the
value "2.1" for OASIS UBL 2.1 or "2.0" for OASIS UBL 2.0). May not
be null. This field is mapped to
StandardBusinessDocumentHeader/DocumentIdentification/TypeVersion
.sType - Message type - mandatory in SBDH. XML local element name of the
root-element in the business message. May not be null.
This field is mapped to
StandardBusinessDocumentHeader/DocumentIdentification/Type
.sInstanceIdentifier - An informative unique ID created by the issuer of the envelope. The
InstanceIdentifier MUST be unique for each Business Message Envelope
being created. This ID is not the same as the ID of the business
message (such as the Invoice Number). It is not the same as a
transmission Message ID generated by the application sending the
message (as defined in AS2 or START).null. This field is mapped to
StandardBusinessDocumentHeader/DocumentIdentification/InstanceIdentifier
.aCreationDateAndTime - The date and time for when this envelope was created. It is NOT
necessarily the same as the issue date of the business document
(such as the invoice) being enveloped. It is NOT necessarily the
date time for transmission.null. This field is mapped to
StandardBusinessDocumentHeader/DocumentIdentification/CreationDateAndTime
.@Nullable public String getStandard()
StandardBusinessDocumentHeader/DocumentIdentification/Standard
.null.@Nullable public String getTypeVersion()
StandardBusinessDocumentHeader/DocumentIdentification/TypeVersion
.null.@Nullable public String getType()
StandardBusinessDocumentHeader/DocumentIdentification/Type.null.@Nullable public String getInstanceIdentifier()
StandardBusinessDocumentHeader/DocumentIdentification/InstanceIdentifier
.null.@Nullable public LocalDateTime getCreationDateAndTime()
StandardBusinessDocumentHeader/DocumentIdentification/CreationDateAndTime
.null.@Nonnull public PeppolSBDHDocument setBusinessMessage(@Nonnull Element aBusinessMessage)
aBusinessMessage - The business message to be set. May not be null.
Internally the passed element is cloned, so that further
modifications outside of this method have no impact on the business
message inside this object.public boolean hasBusinessMessage()
getBusinessMessage() which returns a cloned node
and is therefore an expensive operation.true if a business message is present,
false otherwise.@Nullable @ReturnsMutableCopy public Element getBusinessMessage()
null if no business message is present. A clone (deep
copy) of the business message otherwise.public boolean areAllFieldsSet()
true if all mandatory fields required for creating an
SBDH are present, false if at least one field is not
set.@Nonnull @Deprecated public static PeppolSBDHDocument create(@Nonnull Element aBusinessMessage)
PeppolSBDHDocument object for a business message. The
resulting object has all required fields set, except for:
aBusinessMessage - The XML business message. May not be null.PeppolSBDHDocument object with some
information still missing.setSender(String, String),
setReceiver(String, String),
setDocumentType(String, String),
setProcess(String, String)@Nonnull public static PeppolSBDHDocument create(@Nonnull Element aBusinessMessage, @Nonnull com.helger.peppol.identifier.factory.IIdentifierFactory aIdentifierFactory)
PeppolSBDHDocument object for a business message. The
resulting object has all required fields set, except for:
aBusinessMessage - The XML business message. May not be null.aIdentifierFactory - Identifier factory to be used. May not be null.PeppolSBDHDocument object with some
information still missing.setSender(String, String),
setReceiver(String, String),
setDocumentType(String, String),
setProcess(String, String)Copyright © 2014–2018 Philip Helger. All rights reserved.