Class EdiElement
java.lang.Object
com.adaptris.adapter.edistream.model.EdiElement
- All Implemented Interfaces:
Serializable
,TreeNode
- Direct Known Subclasses:
Composite
,ElementCode
,Field
,LoopSegment
,Message
,Segment
,StandardCodes
Abstract Parent class of all Elements that are used to represent Edi Data
internally as a tree structure.
The following asci image shows the structure of an EDI document, and this class aims to be the base node for all other nodes that will represent it internally.
The diagram shows a Msg which has four child nodes, the third of which is a Group node that itself has two segment nodes. Segment nodes themselves can be made up of composite and element nodes, that are not shown in the diagram. +--------+ | MSG | | | +----+---+ | v +-------------+--------------+---------------+ v v v v +-----+ +-----+ +-----+ +-----+ | REF | | QTY | |GROUP| | LDD | | M1 | | C5 | | C99 | | M1 | +-----+ +-----+ +-----+ +-----+ + | v +-------------+ v v +-----+ +-----+ | FFF | | TXT | | M1 | | M1 | +-----+ +-----+
The following asci image shows the structure of an EDI document, and this class aims to be the base node for all other nodes that will represent it internally.
The diagram shows a Msg which has four child nodes, the third of which is a Group node that itself has two segment nodes. Segment nodes themselves can be made up of composite and element nodes, that are not shown in the diagram. +--------+ | MSG | | | +----+---+ | v +-------------+--------------+---------------+ v v v v +-----+ +-----+ +-----+ +-----+ | REF | | QTY | |GROUP| | LDD | | M1 | | C5 | | C99 | | M1 | +-----+ +-----+ +-----+ +-----+ + | v +-------------+ v v +-----+ +-----+ | FFF | | TXT | | M1 | | M1 | +-----+ +-----+
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addChild
(EdiElement child) children()
protected boolean
childrenEquals
(EdiElement compareItem) Returns true if the children of the given object match this instance's.boolean
boolean
boolean
getChild
(int position) getChildAt
(int childIndex) int
protected String
int
int
getName()
int
boolean
int
hashCode()
boolean
isLeaf()
boolean
void
setChildren
(List<EdiElement> children) void
setMandatory
(boolean mandatory) void
setMaxRepetitions
(int maxRepetitions) void
void
setParent
(EdiElement parent) void
setRepetitions
(int repetitions) static void
setSegmentReps
(EdiElement elementRule, String repsStr) Sets the repetition value for an Element.toString()
-
Constructor Details
-
EdiElement
public EdiElement() -
EdiElement
-
-
Method Details
-
getName
-
setName
-
isMandatory
public boolean isMandatory() -
setMandatory
public void setMandatory(boolean mandatory) -
getRepetitions
public int getRepetitions() -
setRepetitions
public void setRepetitions(int repetitions) -
getMaxRepetitions
public int getMaxRepetitions() -
setMaxRepetitions
public void setMaxRepetitions(int maxRepetitions) -
setSegmentReps
Sets the repetition value for an Element. It is possible for the value to be ">1" So we need to set this appropriately.- Parameters:
elementRule
-repsStr
- - original string value from the gxml file
-
getChildren
-
children
-
getChild
-
getIndex
-
getChildAt
- Specified by:
getChildAt
in interfaceTreeNode
-
setChildren
-
addChild
-
hasChildren
public boolean hasChildren() -
getChildCount
public int getChildCount()- Specified by:
getChildCount
in interfaceTreeNode
-
getAllowsChildren
public boolean getAllowsChildren()- Specified by:
getAllowsChildren
in interfaceTreeNode
-
isLeaf
public boolean isLeaf() -
getParent
-
setParent
-
hashCode
public int hashCode() -
equals
-
equalsStr
-
childrenEquals
Returns true if the children of the given object match this instance's.- Parameters:
compareItem
-- Returns:
- true if both sets of children are equal
-
toString
-
getChildrenAsString
-