|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.berryworks.edireader.PluginController
public class PluginController
Determines and maintains state transitions for the segment looping structure within a particular EDI document.
An EDI parser delegates the job of detecting segment loop boundaries to a PluginController. This allows the EDI parsers for ANSI and EDIFACT to be fully consistent with their use of plugins and focus on the specifics of the particular EDI standard. This base implementation of PluginController provides the normal segment loop support based on LoopDescriptors in Plugins. It is possible, however, to extend this behavior by subclassing PluginController and Plugin. A ValidatingPlugin is one example, which provides for certain EDI validation rules, beyond those applied by normal EDIReader parsing, to be applied while a document is being parsed. Another example is a FilteringPlugin, which allows a plugin to provide custom logic to filter out certain LoopDescriptors based on run-time decisions.
Plugin
,
LoopDescriptor
,
com.berryworks.edireader.validator.FilteringPluginController
,
com.berryworks.edireader.validator.ValidatingPluginController
Constructor Summary | |
---|---|
PluginController()
|
Method Summary | |
---|---|
int |
closedCount()
Get the number of loops that were closed as the result of the most recent state transition. |
static PluginController |
create(java.lang.String standard,
java.lang.String docType,
java.lang.String docVersion,
java.lang.String docRelease,
com.berryworks.edireader.tokenizer.Tokenizer tokenizer)
Creates a new instance of a PluginController, selecting a plugin based on the standard, the type of document, and the version and release characteristics. |
static PluginController |
create(java.lang.String standard,
java.lang.String docType,
com.berryworks.edireader.tokenizer.Tokenizer tokenizer)
Creates a new instance of a PluginController, selecting a plugin based on the standard and type of document. |
java.lang.String |
getDocumentName()
Returns the document name associated with the plugin. |
java.lang.String |
getLoopEntered()
Return the name of a loop that was entered as the result of the most recent transition. |
int |
getNestingLevel()
Get the nesting level of the current loop. |
Plugin |
getPlugin()
Returns the Plugin used by this PluginController. |
boolean |
isEnabled()
Returns true if this controller is currently enabled. |
boolean |
isResumed()
Returns true if the most recent loop transition was to resume an outer loop. |
java.lang.String |
lastPluginLoaded()
Returns the class name of the most recently loaded plugin. |
static void |
setDebug(boolean d)
Sets debugging on or off. |
boolean |
transition(java.lang.String segmentName)
Compute a state transition that may have occurred as the result of the presence of a particular segment type at this point in parsing the document. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PluginController()
Method Detail |
---|
public static PluginController create(java.lang.String standard, java.lang.String docType, com.berryworks.edireader.tokenizer.Tokenizer tokenizer)
standard
- docType
- tokenizer
-
public static PluginController create(java.lang.String standard, java.lang.String docType, java.lang.String docVersion, java.lang.String docRelease, com.berryworks.edireader.tokenizer.Tokenizer tokenizer)
standard
- docType
- docVersion
- docRelease
- tokenizer
-
public boolean transition(java.lang.String segmentName) throws EDISyntaxException
segmentName
- type of segment encountered, for example: 837
EDISyntaxException
- Description of the Exceptionpublic java.lang.String getLoopEntered()
public int closedCount()
public int getNestingLevel()
public boolean isEnabled()
public java.lang.String getDocumentName()
public Plugin getPlugin()
public boolean isResumed()
public java.lang.String lastPluginLoaded()
public static void setDebug(boolean d)
d
-
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |