Class IDocSegment
java.lang.Object
com.onenetwork.platform.integ.sap.IDocElement
com.onenetwork.platform.integ.sap.IDocSegment
public class IDocSegment extends IDocElement
A segment within an IDoc.
-
Field Summary
Fields Modifier and Type Field Description protected java.util.List<IDocSegment>
childSegments
protected java.util.List<IDocField>
fields
protected IDocSegmentDef
segmentDef
-
Constructor Summary
Constructors Constructor Description IDocSegment()
-
Method Summary
Modifier and Type Method Description IDocSegment
addChildSegment(IDocSegment segment)
Added a IDocSegment to the List of IDocSegments.IDocSegment
addChildSegment(java.lang.String segmentName)
Creates a segment with given name, adds it to the IDocSegment and returns it.IDocField
addField(IDocField idocField)
Adds an IDocField to this SegmentIDocField
addField(IDocField idocField, int position)
Add an IDocField to "this" Segment at the specified positionIDocField
addField(java.lang.String fieldName, java.lang.Object value)
Creates an IDocField with the name and value specified and adds the same to the list of fields within "this" segment.IDocField
addField(java.lang.String fieldName, java.lang.Object value, IDocFieldDef idocFieldDef)
Creates an IDocField and adds it to the specified position within "this" segment.Field Indexing is zero based and should start with zerojava.util.List<IDocSegment>
getChildSegments()
Returns the child segments within this segment.java.util.List<IDocSegment>
getChildSegments(java.lang.String segmentName)
Returns a new List containing the child segments matching the given name.IDocField
getField(int position)
Returns the field at the position specifiedIDocField
getField(java.lang.String fieldName)
Returns the first IDocField matching the given namejava.util.List<IDocField>
getFields()
Returns all the fields within the IDocSegment.IDocSegment
getFirstChildSegment(java.lang.String segmentName)
Returns the first occurrence of the child segment matching the given name.IDocSegmentDef
getIDocSegmentDef()
void
setIDocSegmentDef(IDocSegmentDef segmentDef)
Sets the IDocSegmentDef which describes the structure of this IDocSegment
-
Field Details
-
Constructor Details
-
IDocSegment
public IDocSegment()
-
-
Method Details
-
setIDocSegmentDef
Sets the IDocSegmentDef which describes the structure of this IDocSegment- Parameters:
iDocSegmentDef
- IDocSegmentDef which describes the structure of this IDocSegment
-
getIDocSegmentDef
- Returns:
- IDocSegmentDef which describes the structure of this IDocSegment
-
getFields
Returns all the fields within the IDocSegment. Mutating this list will alter the IDocSegment.- Returns:
- all the fields within the IDocSegment
-
getField
Returns the first IDocField matching the given name- Parameters:
fieldName
- name of the field to find- Returns:
- first field matching the given name
-
getField
Returns the field at the position specified- Parameters:
position
- position at which to select the field- Returns:
- field at the position specified
-
addField
Creates an IDocField with the name and value specified and adds the same to the list of fields within "this" segment.- Parameters:
fieldName
-value
- field value- Returns:
- field that was created and/or updated
-
addField
Adds an IDocField to this Segment- Parameters:
idocField
- field to add- Returns:
- field added
-
addField
Add an IDocField to "this" Segment at the specified position- Parameters:
idocField
-position
-- Returns:
- field added
-
addField
public IDocField addField(java.lang.String fieldName, java.lang.Object value, IDocFieldDef idocFieldDef)Creates an IDocField and adds it to the specified position within "this" segment.Field Indexing is zero based and should start with zero- Parameters:
fieldName
-value
-idocFieldDef
- - the idocFieldDef that defines the metadata for the field to be added- Returns:
- field that was added
-
getChildSegments
Returns the child segments within this segment. Mutating this list will alter this IDocSegment.- Returns:
- child segments within this segment
-
getChildSegments
Returns a new List containing the child segments matching the given name.- Parameters:
segmentName
- segment name to search for- Returns:
- child segments matching the given name, or an empty list
-
getFirstChildSegment
Returns the first occurrence of the child segment matching the given name.- Parameters:
name
- of the segment- Returns:
- first occurrence of the child segment matching the given name, or null
-
addChildSegment
Creates a segment with given name, adds it to the IDocSegment and returns it.- Parameters:
segmentName
- name for the new segment- Returns:
- child IDocSegment that was created and added
-
addChildSegment
Added a IDocSegment to the List of IDocSegments.- Parameters:
segment
-- Returns:
- child Segment that was added
-