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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddChild(EdiElement child) children()protected booleanchildrenEquals(EdiElement compareItem) Returns true if the children of the given object match this instance's.booleanbooleanbooleangetChild(int position) getChildAt(int childIndex) intprotected StringintintgetName()intbooleaninthashCode()booleanisLeaf()booleanvoidsetChildren(List<EdiElement> children) voidsetMandatory(boolean mandatory) voidsetMaxRepetitions(int maxRepetitions) voidvoidsetParent(EdiElement parent) voidsetRepetitions(int repetitions) static voidsetSegmentReps(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:
getChildAtin interfaceTreeNode
-
setChildren
-
addChild
-
hasChildren
public boolean hasChildren() -
getChildCount
public int getChildCount()- Specified by:
getChildCountin interfaceTreeNode
-
getAllowsChildren
public boolean getAllowsChildren()- Specified by:
getAllowsChildrenin 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
-