|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.xml.sax.helpers.DefaultHandler
ex1.DefnFileParser
This is the parser for the DEFN config files. This holds all the parameter meta-information.
Constructor Summary | |
DefnFileParser(java.lang.String defnFile,
boolean isCrop)
Creates a new instance of DefnFileParser |
Method Summary | |
void |
characters(char[] buf,
int offset,
int len)
Part of SAX processing that gets called to get the contents inside an xml tag. |
void |
endDocument()
Part of SAX processing... |
void |
endElement(java.lang.String namespaceURI,
java.lang.String sName,
java.lang.String qName)
Part of SAX processing that gets called when an ending xml tag is encountered. |
int |
findChoiceVal(ParamDef p,
java.lang.String ch)
From a choice string find the value that is linked to it. |
ex1.OpAction |
findOpAction(java.lang.String code,
int id)
Get the process structure that matches the specified code and numeric identifier. |
ex1.OpAction |
findOpAction(java.lang.String code,
java.lang.String id)
Get the process structure that matches the specified code and String numeric identifier. |
ex1.OpAction |
getAction(int ind)
Get the process structure at the specified index. |
java.lang.String |
getActionCode(int ind)
Get the single character code O,G,P for the process at the specified index. |
int |
getActionId(int ind)
Get the numeric part of the process at the specified index |
java.lang.String |
getActionName(int ind)
Get the name of a process at a specific location. |
int |
getActionNameCount()
Get the number of unique process names. |
java.util.Collection |
getAllParms()
|
java.lang.String |
getChoice(int col,
int ch)
This function returns one choice string from the list of choices for a parameter. |
int |
getChoiceCount(int col)
This gets the number of choices for a parameter that is a choice list |
java.lang.Class |
getClass(int col)
Return the Class of this parameter for crop data (either a string or combobox) |
ParamDef |
getColumn(int col)
Get the parameter meta information for a specific column in a crop table |
java.lang.String |
getFullActionName(int ind)
Get the name of the process with the the id and code tacked on the front. |
java.lang.String |
getFullActionName(java.lang.String code,
java.lang.String id)
Get the name of the process with the the id and code tacked on the front. |
java.lang.String |
getOpChoice(int ind,
int pind,
int ch)
Get a specific dropdown choice within a process. |
int |
getOpChoiceCount(int ind,
int pind)
Get the number of choices that a dropdown list in process contains |
int |
getOpParmCode(int ind)
Get the numeric part of the process at this location |
char |
getOpParmCodeType(int ind)
Get the character part of the process at this location. |
int |
getOpParmCount(int ind)
Get number of parameters for a process. |
java.lang.String |
getOpParmPrompt(int ind,
int pind,
boolean altUnits)
Get the prompt(header) for an operation parameter. |
int |
getOpParmType(int ind,
int pind)
Get the type of a specific parameter in a process. |
ParamDef |
getParamDef(java.lang.String name)
Given a parameter name finds the structure holding its information. |
int |
getParmCount()
Get the number of parameters defined in the DEFN file |
java.lang.String |
getParmPrompt(int col,
boolean altUnits)
This gets the |
int |
getType(int col)
|
void |
setAddEnd(java.lang.String name,
float adder)
As part of the alternate (metric to english) conversion this may be added after the factor is applied. |
void |
setAltUnit(java.lang.String name,
java.lang.String altUnit)
Set string to display when alternate units are dispalyed. |
void |
setChoice(java.lang.String name,
int val,
java.lang.String choice)
Add a choice to this parameter. |
void |
setFactor(java.lang.String name,
float factor)
Sets the factor that is used to go from regular to alternate units. |
void |
setPromptName(java.lang.String name,
java.lang.String prompt)
Sets the user prompt that should be displayed with this parameter. |
void |
startDocument()
Part of SAX XML processing... |
void |
startElement(java.lang.String namespaceURI,
java.lang.String lName,
java.lang.String qName,
org.xml.sax.Attributes attrs)
Part of SAX processing that gets called at the when an opening xml tag is encountered. |
Methods inherited from class org.xml.sax.helpers.DefaultHandler |
endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startPrefixMapping, unparsedEntityDecl, warning |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public DefnFileParser(java.lang.String defnFile, boolean isCrop)
defnFile
- the XML config file to loadisCrop
- true if this is for CROP data parser.Method Detail |
public int getParmCount()
public java.util.Collection getAllParms()
public java.lang.String getParmPrompt(int col, boolean altUnits)
col
- - column (index of parameter) to get prompt foraltUnits
- - true if English version, false for metric
public void startDocument() throws org.xml.sax.SAXException
org.xml.sax.SAXException
public void endDocument() throws org.xml.sax.SAXException
org.xml.sax.SAXException
public void startElement(java.lang.String namespaceURI, java.lang.String lName, java.lang.String qName, org.xml.sax.Attributes attrs) throws org.xml.sax.SAXException
org.xml.sax.SAXException
public void endElement(java.lang.String namespaceURI, java.lang.String sName, java.lang.String qName) throws org.xml.sax.SAXException
org.xml.sax.SAXException
public void characters(char[] buf, int offset, int len) throws org.xml.sax.SAXException
org.xml.sax.SAXException
public ParamDef getParamDef(java.lang.String name)
name
- name of the parameter to find
public void setPromptName(java.lang.String name, java.lang.String prompt)
name
- name of the parameterprompt
- prompt string to attach to itpublic void setAltUnit(java.lang.String name, java.lang.String altUnit)
name
- name of the parameteraltUnit
- string to attach to alternate unitspublic void setFactor(java.lang.String name, float factor)
name
- parameter namefactor
- value to multiply base value by to get alt value (generally mettric to english)public void setAddEnd(java.lang.String name, float adder)
name
- name of the parameteradder
- value to add at the endpublic void setChoice(java.lang.String name, int val, java.lang.String choice)
name
- name of the parameterval
- value of the particular choicechoice
- name of string to display with this val in a choice listpublic int getChoiceCount(int col)
col
- column in crop table
public java.lang.String getChoice(int col, int ch)
col
- column in crop datach
- index of choice string to get
public int getType(int col)
public java.lang.Class getClass(int col)
col
- column in crop data
public int findChoiceVal(ParamDef p, java.lang.String ch)
p
- parameter definitionch
- choice string to search for
public int getActionNameCount()
public int getOpParmCode(int ind)
ind
- index in action/process name list
public char getOpParmCodeType(int ind)
ind
- index in action/process name list
public int getOpParmCount(int ind)
ind
- index in action/process name list
public int getOpParmType(int ind, int pind)
ind
- index in action/process name listpind
- index of parameter within the process
public int getOpChoiceCount(int ind, int pind)
ind
- index in action/process name listpind
- index of parameter within the process
public java.lang.String getOpChoice(int ind, int pind, int ch)
ind
- index in action/process name listpind
- index of parameter within the processch
- choice list element to get
public java.lang.String getOpParmPrompt(int ind, int pind, boolean altUnits)
ind
- index in action/process name listpind
- index of parameter within the processaltUnits
- true if alternate(english) units are to be used
public java.lang.String getActionName(int ind)
ind
- index in action/process name list
public ex1.OpAction getAction(int ind)
ind
- index in action/process name list
public java.lang.String getFullActionName(int ind)
ind
- index in action/process name list
public java.lang.String getFullActionName(java.lang.String code, java.lang.String id)
code
- single character code to matchid
- numeric id to match.
public ex1.OpAction findOpAction(java.lang.String code, java.lang.String id)
code
- single charcter code to matchid
- numeric (as String) id to match
public ex1.OpAction findOpAction(java.lang.String code, int id)
code
- single charcter code to matchid
- numeric id to match
public java.lang.String getActionCode(int ind)
ind
- index in action/process name list
public int getActionId(int ind)
ind
- index in action/process name list
public ParamDef getColumn(int col)
col
- column information to get
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |