public class IDocUtil extends Util
Modifier and Type | Class and Description |
---|---|
static class |
IDocUtil.IDocID
IDoc ID - Validates IDoc package URL and identifies the name, namespace
prefix and namespace uri of package.
|
Modifier and Type | Field and Description |
---|---|
static SimpleDateFormat |
DATE_FORMATTER
Formatter for ABAP Date strings.
|
static String |
GenNS_DOCUMENTATION_KEY |
static String |
GenNS_URI |
static String |
IDocNS_APPLICATION_RELEASE_KEY
Details key for a segment annotation providing the application release of
the segment.
|
static String |
IDocNS_CHECK_TABLE_NAME_KEY
Details key for a segment field annotation providing the check table name
of the field.
|
static String |
IDocNS_CLASS_NAME_OF_FIELD_KEY
Details key for a segment field annotation providing the fully-qualified
Java classname of the field.
|
static String |
IDocNS_COMPOUND_TYPE_KEY
Details key for a root segment annotation providing the compound type of
the document.
|
static String |
IDocNS_DATA_ELEMENT_NAME_KEY
Details key for a segment field annotation providing the data element
name of the field.
|
static String |
IDocNS_DATA_TYPE_KEY
Details key for a segment field annotation providing the data type of the
field.
|
static String |
IDocNS_DATA_TYPE_NAME_KEY
Details key for a segment field annotation providing the data type name
of the field.
|
static String |
IDocNS_DEFINITION_KEY
Details key for a segment annotation providing the definition of the
segment.
|
static String |
IDocNS_DESCRIPTION_KEY
Details key for a segment field annotation providing the description of
the field.
|
static String |
IDocNS_DOMAIN_NAME_KEY
Details key for a segment field annotation providing the domain name of
the field.
|
static String |
IDocNS_HIERARCHY_LEVEL_KEY
Details key for a segment annotation providing the hierarchy level of the
segment.
|
static String |
IDocNS_IDOC_TYPE_EXTENSION_KEY
Details key for a segment annotation providing the IDoc type extension of
the segment.
|
static String |
IDocNS_IDOC_TYPE_KEY
Details key for a segment annotation providing the IDoc type of the
segment.
|
static String |
IDocNS_INTERNAL_LENGTH_KEY
Details key for a segment field annotation providing the internal lenght
of the field.
|
static String |
IDocNS_IS_ISO_CODE_KEY
Details key for a segment field annotation providing the is ISO code of
the field.
|
static String |
IDocNS_IS_LOCKED_KEY
Details key for a segment annotation providing the locked state of the
segment.
|
static String |
IDocNS_IS_MANDATORY_KEY
Details key for a segment annotation providing the mandatory state of the
segment.
|
static String |
IDocNS_IS_QUALIFIED_KEY
Details key for a segment annotation providing the qualified state of the
segment.
|
static String |
IDocNS_KEY_KEY
Details key for a segment annotation providing the key of the segment.
|
static String |
IDocNS_LENGTH_KEY
Details key for a segment field annotation providing the length of the
field.
|
static String |
IDocNS_MAX_OCCURRENCE_KEY
Details key for a segment annotation providing the max number of
occurrences of the segment.
|
static String |
IDocNS_MIN_OCCURRENCE_KEY
Details key for a segment annotation providing the min number of
occurrences of the segment.
|
static String |
IDocNS_NAME_KEY
Details key for a segment annotation providing the name of the segment.
|
static String |
IDocNS_NUM_FIELDS_KEY
Details key for a segment annotation providing the number of fields in
the segment.
|
static String |
IDocNS_OFFSET_KEY
Details key for a segment field annotation providing the offset of the
field.
|
static String |
IDocNS_OUTPUT_LENGTH_KEY
Details key for a segment field annotation providing the output length of
the field.
|
static String |
IDocNS_POSITION_KEY
Details key for a segment field annotation providing the position of the
field.
|
static String |
IDocNS_RECORD_LENGTH_KEY
Details key for a segment annotation providing the record length of the
segment.
|
static String |
IDocNS_RECORD_TYPE_KEY
Details key for a segment field annotation providing the type of the
field.
|
static String |
IDocNS_SYSTEM_RELEASE_KEY
Details key for a segment annotation providing the system release of the
segment.
|
static String |
IDocNS_TYPE_AS_STRING_KEY
Details key for a segment field annotation providing the type as string
of the field.
|
static String |
IDocNS_TYPE_KEY
Details key for a segment annotation providing the type of the segment.
|
static String |
IDocNS_VALUE_DESCRIPTIONS_KEY
Details key for a segment field annotation providing the value
descriptions of the field.
|
static String |
IDocNS_VALUE_RANGES_KEY
Details key for a segment field annotation providing the value ranges of
the field.
|
static String |
IDocNS_VALUES_KEY
Details key for a segment field annotation providing the values of the
field.
|
static SimpleDateFormat |
TIME_FORMATTER
Formatter for ABAP Time strings.
|
Constructor and Description |
---|
IDocUtil() |
Modifier and Type | Method and Description |
---|---|
static void |
addSegmentMetaData(org.eclipse.emf.ecore.EClass eClass,
IDocSegmentMetaData idocSegmentMetaData)
Populates
eClass with meta-data from
idocSegmentMetaData . |
static String |
bytesToHex(byte[] bytes) |
static org.fusesource.camel.component.sap.model.idoc.Document |
createDocument(org.eclipse.emf.ecore.EClass rootSegmentClass)
Creates a Document containing root segment of given class type.
|
static org.fusesource.camel.component.sap.model.idoc.Document |
createDocument(IDocRepository repository,
String iDocType,
String iDocTypeExtension,
String systemRelease,
String applicationRelease)
Creates Document of given IDoc type.
|
static org.fusesource.camel.component.sap.model.idoc.DocumentList |
createDocumentList(IDocRepository repository,
String iDocType,
String iDocTypeExtension,
String systemRelease,
String applicationRelease)
Creates Document List to contain Documents of given IDoc type.
|
static void |
extractIDocDocumentIntoDocument(IDocDocument idocDocument,
org.fusesource.camel.component.sap.model.idoc.Document document)
Extract values from
idocDocument to document . |
static void |
extractIDocDocumentListIntoDocumentList(IDocDocumentList idocDocumentList,
org.fusesource.camel.component.sap.model.idoc.DocumentList documentList)
Extracts the values from IDoc documents in
idocDocumentList to documents added to documentList with docum. |
static void |
extractIDocSegmentIntoSegment(IDocSegment idocSegment,
org.fusesource.camel.component.sap.model.idoc.Segment segment)
Extract values from
idocSegment to segment . |
static void |
fillIDocDocumentFromDocument(org.fusesource.camel.component.sap.model.idoc.Document document,
IDocDocument idocDocument)
Fill
idocDocument with values from document . |
static void |
fillIDocDocumentListFromDocumentList(org.fusesource.camel.component.sap.model.idoc.DocumentList documentList,
IDocDocumentList idocDocumentList)
Fill
idocDocument with values from document . |
static void |
fillIDocSegmentFromSegment(org.fusesource.camel.component.sap.model.idoc.Segment segment,
IDocSegment idocSegment)
Fill
idocSegment with values from segmentt . |
static String |
getClassName(int segmentFieldType)
Return the the fully-qualified name of Java class corresponding to the
given IDoc Segment Field Type.
|
static org.eclipse.emf.ecore.EClassifier |
getEDataTypeForField(int idocDatatypeOrdinal)
Return the
EClassifier corresponding to the given IDoc Data Type. |
static org.eclipse.emf.ecore.EPackage |
getEPackage(IDocRepository repository,
String nsURI)
Returns (and creates if necessary) the
EPackage instance
containing the root and child Segment definitions of an
IDocDocument designated by nsURI and described in
the given repository . |
static org.eclipse.emf.ecore.EClass |
getSegmentChildrenClass(org.eclipse.emf.ecore.EPackage ePackage,
IDocSegmentMetaData iDocSegmentMetaData)
Gets and creates if necessary the class that represents the children of
iDocSegmentMetaData IDoc segment type. |
static org.eclipse.emf.ecore.EClass |
getSegmentClass(org.eclipse.emf.ecore.EPackage ePackage,
IDocSegmentMetaData idocSegmentMetaData)
Gets and creates if necessary the class that represents the
iDocSegmentMetaData IDoc segment type. |
static byte[] |
hexToBytes(String hexString) |
static void |
readReferences(org.eclipse.emf.ecore.EObject eobject,
Set<org.eclipse.emf.ecore.EObject> preventCycles,
List<org.eclipse.emf.ecore.EObject> rootList)
Recursively read all objects which are referenced from the passed
eobject . |
static String |
segmentIdentifierString(org.fusesource.camel.component.sap.model.idoc.Segment segment) |
static int |
segmentOccurrences(long longValue) |
static void |
sendDocument(JCoDestination destination,
org.fusesource.camel.component.sap.model.idoc.Document document,
String tid)
Send
document to destination . |
static void |
sendDocument(JCoDestination destination,
org.fusesource.camel.component.sap.model.idoc.Document document,
String tid,
String queueName)
Send
document to destination . |
static void |
sendDocumentList(JCoDestination destination,
org.fusesource.camel.component.sap.model.idoc.DocumentList documentList,
String tid)
Send
documentList to destination . |
static void |
sendDocumentList(JCoDestination destination,
org.fusesource.camel.component.sap.model.idoc.DocumentList documentList,
String tid,
String queueName)
Send
documentList to destination . |
static void |
setIdocFieldValue(String fieldName,
org.fusesource.camel.component.sap.model.idoc.Segment segment,
IDocSegment idocSegment) |
static void |
setSegmentFieldValue(String fieldName,
org.fusesource.camel.component.sap.model.idoc.Segment segment,
IDocSegment idocSegment) |
addAnnotation, addNameSpaceDeclarations, beginTransaction, commitTransaction, convertSapDateStringToDate, convertSAPNamespaceToXMLName, convertSAPNamespaceToXMLPrefix, convertSapTimeStringToDate, convertXMLNameToSAPNamespace, createXMIResource, createXMIResource, createXMIResource, createXMLResource, createXMLResource, createXMLResource, ensureBasePackages, fromInputStream, getAnnotation, getValue, getValue, load, loadRegistry, marshal, marshalXml, print, reattachStaticPackageSuperTypes, rollbackTransaction, save, saveRegistry, serializeOptions, setValue, setValue, toInputStream, toOutputStream, unmarshal, unmarshalXml, unserializeOptions
public static final String GenNS_URI
public static final String GenNS_DOCUMENTATION_KEY
public static final String IDocNS_COMPOUND_TYPE_KEY
public static final String IDocNS_NAME_KEY
public static final String IDocNS_DEFINITION_KEY
public static final String IDocNS_HIERARCHY_LEVEL_KEY
public static final String IDocNS_IDOC_TYPE_KEY
public static final String IDocNS_IDOC_TYPE_EXTENSION_KEY
public static final String IDocNS_KEY_KEY
public static final String IDocNS_SYSTEM_RELEASE_KEY
public static final String IDocNS_APPLICATION_RELEASE_KEY
public static final String IDocNS_TYPE_KEY
public static final String IDocNS_MAX_OCCURRENCE_KEY
public static final String IDocNS_MIN_OCCURRENCE_KEY
public static final String IDocNS_IS_MANDATORY_KEY
public static final String IDocNS_IS_QUALIFIED_KEY
public static final String IDocNS_NUM_FIELDS_KEY
public static final String IDocNS_IS_LOCKED_KEY
public static final String IDocNS_RECORD_LENGTH_KEY
public static final String IDocNS_DESCRIPTION_KEY
public static final String IDocNS_CLASS_NAME_OF_FIELD_KEY
public static final String IDocNS_CHECK_TABLE_NAME_KEY
public static final String IDocNS_DATA_ELEMENT_NAME_KEY
public static final String IDocNS_DATA_TYPE_KEY
public static final String IDocNS_DATA_TYPE_NAME_KEY
public static final String IDocNS_DOMAIN_NAME_KEY
public static final String IDocNS_INTERNAL_LENGTH_KEY
public static final String IDocNS_LENGTH_KEY
public static final String IDocNS_OFFSET_KEY
public static final String IDocNS_OUTPUT_LENGTH_KEY
public static final String IDocNS_RECORD_TYPE_KEY
public static final String IDocNS_TYPE_AS_STRING_KEY
public static final String IDocNS_VALUE_DESCRIPTIONS_KEY
public static final String IDocNS_VALUE_RANGES_KEY
public static final String IDocNS_VALUES_KEY
public static final String IDocNS_IS_ISO_CODE_KEY
public static final String IDocNS_POSITION_KEY
public static final SimpleDateFormat DATE_FORMATTER
public static final SimpleDateFormat TIME_FORMATTER
public static void sendDocument(JCoDestination destination, org.fusesource.camel.component.sap.model.idoc.Document document, String tid) throws JCoException, IDocMetaDataUnavailableException
document
to destination
.destination
- - the destination to send to.document
- - the document to send.tid
- - the transaction ID to use.JCoException
IDocMetaDataUnavailableException
public static void sendDocument(JCoDestination destination, org.fusesource.camel.component.sap.model.idoc.Document document, String tid, String queueName) throws JCoException, IDocMetaDataUnavailableException
document
to destination
.destination
- - the destination to send to.document
- - the document to send.tid
- - the transaction ID to use.queueName
- - the namw of the queue document sent to.JCoException
IDocMetaDataUnavailableException
public static void sendDocumentList(JCoDestination destination, org.fusesource.camel.component.sap.model.idoc.DocumentList documentList, String tid) throws Exception
documentList
to destination
.destination
- - the destination to send to.documentList
- - the document list to send.tid
- - the transaction ID to use.Exception
public static void sendDocumentList(JCoDestination destination, org.fusesource.camel.component.sap.model.idoc.DocumentList documentList, String tid, String queueName) throws Exception
documentList
to destination
.destination
- - the destination to send to.documentList
- - the document list to send.tid
- - the transaction ID to use.queueName
- - the namw of the queue document list sent to.Exception
public static void fillIDocDocumentListFromDocumentList(org.fusesource.camel.component.sap.model.idoc.DocumentList documentList, IDocDocumentList idocDocumentList) throws Exception
idocDocument
with values from document
.documentList
- - the document containing the values.idocDocumentList
- - the IDoc document to fill.Exception
public static void fillIDocDocumentFromDocument(org.fusesource.camel.component.sap.model.idoc.Document document, IDocDocument idocDocument)
idocDocument
with values from document
.document
- - the document containing the values.idocDocument
- - the IDoc document to fill.public static void fillIDocSegmentFromSegment(org.fusesource.camel.component.sap.model.idoc.Segment segment, IDocSegment idocSegment)
idocSegment
with values from segmentt
.segment
- - the segment containing the values.idocSegment
- - the IDoc segment to fill.public static void extractIDocDocumentListIntoDocumentList(IDocDocumentList idocDocumentList, org.fusesource.camel.component.sap.model.idoc.DocumentList documentList)
idocDocumentList
to documents added to documentList
with docum.idocDocumentList
- - the IDoc document list containing the IDoc documentsdocumentList
- - the document list containing newly filled documents.public static void extractIDocDocumentIntoDocument(IDocDocument idocDocument, org.fusesource.camel.component.sap.model.idoc.Document document)
idocDocument
to document
.idocDocument
- - the IDoc document containing the values.document
- - the document to fill.public static void extractIDocSegmentIntoSegment(IDocSegment idocSegment, org.fusesource.camel.component.sap.model.idoc.Segment segment)
idocSegment
to segment
.idocSegment
- - the IDoc segment containing the values.segment
- - the segment to fill.public static org.fusesource.camel.component.sap.model.idoc.DocumentList createDocumentList(IDocRepository repository, String iDocType, String iDocTypeExtension, String systemRelease, String applicationRelease)
repository
- - the repository containing IDoc's meta-data.iDocType
- - the IDoc's type.iDocTypeExtension
- - the IDoc's type extension.systemRelease
- - the IDoc's system release.applicationRelease
- - the IDoc's application release.public static org.fusesource.camel.component.sap.model.idoc.Document createDocument(IDocRepository repository, String iDocType, String iDocTypeExtension, String systemRelease, String applicationRelease)
repository
- - the repository containing IDoc's meta-data.iDocType
- - the IDoc's type.iDocTypeExtension
- - the IDoc's type extension.systemRelease
- - the IDoc's system release.applicationRelease
- - the IDoc's application release.public static org.fusesource.camel.component.sap.model.idoc.Document createDocument(org.eclipse.emf.ecore.EClass rootSegmentClass)
rootSegmentClass
- - the type of root segmentpublic static org.eclipse.emf.ecore.EPackage getEPackage(IDocRepository repository, String nsURI)
EPackage
instance
containing the root and child Segment
definitions of an
IDocDocument
designated by nsURI
and described in
the given repository
.repository
- - the IDocRepository
containing the meta data
describing the designated IDocDocument
type.nsURI
- - the URI designating the type of IDocDocument
. The
URI format is of the form:
http://sap.fusesource.org/idoc/{repository
-name}/{idoc-type}/{idoc
-type-extension}/{system-release}/{application-release}.
Note: Only {repository-name} and {idoc-type} are required; other components can be empty. NB: All '/' however are required.
EPackage
instance.public static void addSegmentMetaData(org.eclipse.emf.ecore.EClass eClass, IDocSegmentMetaData idocSegmentMetaData)
eClass
with meta-data from
idocSegmentMetaData
.eClass
- - the class to populate.idocSegmentMetaData
- - the meta-data to populate.public static org.eclipse.emf.ecore.EClass getSegmentChildrenClass(org.eclipse.emf.ecore.EPackage ePackage, IDocSegmentMetaData iDocSegmentMetaData)
iDocSegmentMetaData
IDoc segment type.ePackage
- - the package containing class.iDocSegmentMetaData
- - the type of IDoc segment.public static org.eclipse.emf.ecore.EClass getSegmentClass(org.eclipse.emf.ecore.EPackage ePackage, IDocSegmentMetaData idocSegmentMetaData)
iDocSegmentMetaData
IDoc segment type.ePackage
- - the package containing class.idocSegmentMetaData
- - the type of IDoc segment.public static org.eclipse.emf.ecore.EClassifier getEDataTypeForField(int idocDatatypeOrdinal)
EClassifier
corresponding to the given IDoc Data Type.idocDatatypeOrdinal
- - the ordinal of the IDoc Data Type.EClassifier
corresponding to the given IDoc Data
Type.public static void setSegmentFieldValue(String fieldName, org.fusesource.camel.component.sap.model.idoc.Segment segment, IDocSegment idocSegment)
public static void setIdocFieldValue(String fieldName, org.fusesource.camel.component.sap.model.idoc.Segment segment, IDocSegment idocSegment)
public static String getClassName(int segmentFieldType)
segmentFieldType
- - the IDoc Segment Field Type.public static int segmentOccurrences(long longValue)
public static void readReferences(org.eclipse.emf.ecore.EObject eobject, Set<org.eclipse.emf.ecore.EObject> preventCycles, List<org.eclipse.emf.ecore.EObject> rootList)
eobject
. The objects which do not have an econtainer are
added to the rootList
. The resulting rootList can be added
to the contents of a resource.eobject
- - object to read references of.preventCycles
- - set to track sub-objects already read.rootList
- - all referenced root objects.public static String bytesToHex(byte[] bytes)
public static byte[] hexToBytes(String hexString)
public static String segmentIdentifierString(org.fusesource.camel.component.sap.model.idoc.Segment segment)
Apache Camel