Package com.adaptris.edi.container
Class Segment
java.lang.Object
com.adaptris.edi.container.Segment
- All Implemented Interfaces:
ContainerPart,SearchableListItem
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddChild(ContainerPart child) adds a child ContainerPart to this one.voiddoAction(String queryString, Action action, ContainerPart output) Method to perform an XPATH style query on the ContainerPart heirarchy.voiddocument(StringBuffer sb, int indent) write out an XML representation of this ContainerPart and all sub-partsgetChild(int index) gets a child ContainerPart.intgets the number of child elementsArrayList<?>getChildList(String type, String id) Method to retrieve child elements keyed by Type and ID valuesgetId()returns the ID of this container partreturns the parent ContainerPart to this ContainerPart.getRoot()returns the root ContainerPart in this tree structuregetType()returns the ID of this ContainerPart.protected StringreplaceEntity(String input) voidsets the ID of this ContainerPart.voidsetParent(ContainerPart parent) sets the parent ContainerPart of this ContainerPart.voidsetRoot(ContainerPart root) sets the root ContainerPart of this ContainerPart tree.voidwriteXML(OutputStream out, int indent) write out an XML representation of this ContainerPart and all sub-partsvoidwrite out an XML representation of this ContainerPart and all sub-parts
-
Field Details
-
log
protected transient org.slf4j.Logger log
-
-
Constructor Details
-
Segment
public Segment()Creates a new instance of Segment
-
-
Method Details
-
addChild
adds a child ContainerPart to this one. Parts are added in list order and cannot be re-ordered at this time.- Specified by:
addChildin interfaceContainerPart- Parameters:
child- the child ContainerPart
-
getChild
gets a child ContainerPart.- Specified by:
getChildin interfaceContainerPart- Parameters:
index- the index of the child ContainerPart (starting from 0 and up to getChildCount() - 1)- Returns:
- the ContainerPart referenced
- See Also:
-
getChildCount
public int getChildCount()gets the number of child elements- Specified by:
getChildCountin interfaceContainerPart- Returns:
- the number of child elements held by this ContainerPart
-
getId
returns the ID of this container part- Specified by:
getIdin interfaceContainerPart- Specified by:
getIdin interfaceSearchableListItem- Returns:
- the ID String
-
getParent
returns the parent ContainerPart to this ContainerPart. An exception may be thrown by this method if overridden- Specified by:
getParentin interfaceContainerPart- Returns:
- parent ContainerPart
- Throws:
ExceptionContainerException
-
getRoot
returns the root ContainerPart in this tree structure- Specified by:
getRootin interfaceContainerPart- Returns:
- root ContainerPart
-
getType
returns the ID of this ContainerPart. Will correspond to the static types array in com.adaptris.edi.model.DataModelPart- Specified by:
getTypein interfaceContainerPart- Specified by:
getTypein interfaceSearchableListItem- Returns:
- String type
- See Also:
-
setId
sets the ID of this ContainerPart. Should correspond to static types array in com.adaptris.edi.model.DataModelPart.- Specified by:
setIdin interfaceContainerPart- Parameters:
id-- See Also:
-
setParent
sets the parent ContainerPart of this ContainerPart. May be overridden to throw an exception in certain circumstances.- Specified by:
setParentin interfaceContainerPart- Parameters:
parent-- Throws:
ExceptionContainerException
-
setRoot
sets the root ContainerPart of this ContainerPart tree. Will recursively set the root ContainerPart through all child Parts. Thus only needs to be called once per tree structure and always ensures that all ContainerParts reference the same root Part.- Specified by:
setRootin interfaceContainerPart- Parameters:
root-
-
document
Description copied from interface:ContainerPartwrite out an XML representation of this ContainerPart and all sub-parts- Specified by:
documentin interfaceContainerPart- See Also:
-
writeXML
Description copied from interface:ContainerPartwrite out an XML representation of this ContainerPart and all sub-parts- Specified by:
writeXMLin interfaceContainerPart- Throws:
EdiException- wrapping other exceptionsIOException
-
writeXML
Description copied from interface:ContainerPartwrite out an XML representation of this ContainerPart and all sub-parts- Specified by:
writeXMLin interfaceContainerPart- Throws:
EdiException- wrapping other exceptionsIOException- See Also:
-
getChildList
Method to retrieve child elements keyed by Type and ID values- Specified by:
getChildListin interfaceContainerPart- Parameters:
type- the type of element to retrieveid- the id of the element to retrieve- Returns:
- ArrayList containing the retrieved elements
- Throws:
ContainerException
-
doAction
Method to perform an XPATH style query on the ContainerPart heirarchy. Syntax rules to follow...- Specified by:
doActionin interfaceContainerPart- Parameters:
queryString- the string containing the query to be processedaction- the action to runoutput- the ContainerPart which will be the parent of the result- Throws:
EdiException- wrapping other exceptions.
-
replaceEntity
-