|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.ow2.clif.scenario.isac.egui.wizards.plugin.XMLManipulator
public class XMLManipulator
This class permits to manipulate XML model with the JDOM API in order to construct valid gui, plugin and build XML files.
Constructor Summary | |
---|---|
XMLManipulator()
Constructor. |
Method Summary | |
---|---|
void |
addAction(java.lang.String action,
java.lang.String name,
int number)
This method adds action element in gui and plugin XML file. |
void |
addGroup(java.lang.String action,
java.lang.String actionName,
java.lang.String parentPath,
java.lang.String groupName)
This method adds group element in gui XML file. |
void |
addParameter(java.lang.String action,
java.lang.String actionName,
java.lang.String guiPath,
java.lang.String pluginPath,
java.lang.String paramName)
This method adds parameter element in gui XML file. |
void |
addParameterElement(java.lang.String action,
java.lang.String actionName,
java.lang.String guiPath,
java.lang.String type,
java.lang.String elementName)
This method adds parameter element in gui XML file. |
void |
deleteAction(java.lang.String action,
java.lang.String name)
This method deletes action element in gui and plugin XML file. |
void |
deleteElement(java.lang.String action,
java.lang.String actionName,
java.lang.String guiParentPath,
java.lang.String pluginParentPath,
java.lang.String guiElementPath,
java.lang.String pluginElementPath)
This method deletes group or parameter element in gui and plugin XML file. |
void |
deleteParameterElement(java.lang.String action,
java.lang.String actionName,
java.lang.String guiPath,
java.lang.String type,
java.lang.String elementName)
This method deletes parameter element in gui XML file. |
int |
getActionNumber(java.lang.String action,
java.lang.String name)
Returns an int representing action number. |
java.util.ArrayList<java.lang.String> |
getActions(java.lang.String action)
Returns a ArrayList representing string actions. |
java.io.InputStream |
getBuildContent()
Returns a InputStream representing the build XML file. |
java.lang.String |
getClassName()
|
java.io.InputStream |
getGuiContent()
Returns a InputStream representing the gui XML file. |
java.lang.String |
getHelp(java.lang.String action,
java.lang.String name)
Returns a String representing action help. |
int |
getMaxNumber()
Returns a int representing the maximum number attribute in plugin XML file. |
java.lang.String |
getPackageName()
|
java.lang.String |
getParameterElementDefault(java.lang.String action,
java.lang.String actionName,
java.lang.String guiPath,
java.lang.String type,
java.lang.String elementName)
Returns default parameter element value from gui XML file. |
java.util.ArrayList<java.lang.String> |
getParameterElements(java.lang.String action,
java.lang.String actionName,
java.lang.String guiPath,
java.lang.String type)
Returns parameter element list in gui XML file. |
java.lang.String |
getParameterFieldSize(java.lang.String action,
java.lang.String actionName,
java.lang.String guiElementPath)
This method returns parameter field size from gui file. |
java.lang.String |
getParameterFieldText(java.lang.String action,
java.lang.String actionName,
java.lang.String guiElementPath)
This method returns parameter field text from gui file. |
java.lang.String |
getParameterLabel(java.lang.String action,
java.lang.String actionName,
java.lang.String guiElementPath)
This method returns parameter label from gui file. |
java.lang.String |
getParameterType(java.lang.String action,
java.lang.String actionName,
java.lang.String guiElementPath)
This method returns parameter represention from gui file. |
org.jdom.Element |
getParams(java.lang.String action,
java.lang.String name)
Returns a Element representing action params element. |
java.io.InputStream |
getPluginContent()
Returns a InputStream representing the plugin XML file. |
java.lang.String[] |
getStringParams(java.lang.String action,
java.lang.String name)
Returns String [] contening all parameter name |
boolean |
isParameterExist(java.lang.String action,
java.lang.String name,
java.lang.String elementPath)
Returns true if element exists |
void |
loadBuild(java.io.InputStream arg0)
This method loads build file in memory. |
void |
loadGui(java.io.InputStream arg0)
This method loads gui file in memory. |
void |
loadPlugin(java.io.InputStream arg0)
This method loads plugin file in memory. |
void |
moveDownAction(java.lang.String action,
java.lang.String name)
This method move down action element in gui and plugin XML file. |
void |
moveDownParameter(java.lang.String action,
java.lang.String actionName,
java.lang.String guiParentPath,
java.lang.String guiElementPath)
This method moves down parameter in gui XML file. |
void |
moveDownParameterElement(java.lang.String action,
java.lang.String actionName,
java.lang.String guiPath,
java.lang.String type,
java.lang.String elementName)
This method moves down parameter element in gui XML file. |
void |
moveUpAction(java.lang.String action,
java.lang.String name)
This method move up action element in gui and plugin XML file. |
void |
moveUpParameter(java.lang.String action,
java.lang.String actionName,
java.lang.String guiParentPath,
java.lang.String guiElementPath)
This method moves up parameter in gui XML file. |
void |
moveUpParameterElement(java.lang.String action,
java.lang.String actionName,
java.lang.String guiPath,
java.lang.String type,
java.lang.String elementName)
This method moves up parameter element in gui XML file. |
void |
reset()
This method resets memory. |
void |
setGuiObjectName(java.lang.String name)
This method sets object name in gui XML file. |
void |
setHelp(java.lang.String action,
java.lang.String name,
java.lang.String help)
Set action help in plugin XML file |
void |
setParameterElementDefault(java.lang.String action,
java.lang.String actionName,
java.lang.String guiPath,
java.lang.String type,
java.lang.String elementName,
java.lang.String value)
This method sets default parameter element value to true or false in gui XML file. |
void |
setParameterFieldSize(java.lang.String action,
java.lang.String actionName,
java.lang.String guiElementPath,
java.lang.String size)
This method updates parameter field size in gui file. |
void |
setParameterFieldText(java.lang.String action,
java.lang.String actionName,
java.lang.String guiElementPath,
java.lang.String text)
This method updates parameter field text in gui file. |
void |
setParameterLabel(java.lang.String action,
java.lang.String actionName,
java.lang.String guiElementPath,
java.lang.String label)
This method updates parameter label in gui file. |
void |
setParameterType(java.lang.String action,
java.lang.String actionName,
java.lang.String guiElementPath,
java.lang.String type)
This method updates parameter represention in gui file. |
void |
setPluginClassName(java.lang.String name)
This method sets class name in plugin XML file. |
void |
setPluginName(java.lang.String name)
This method sets plugin name in plugin and build XML files. |
void |
setSourceDir(java.lang.String dirname)
This method sets the source directory in the build XML file. |
void |
setXMLFiles(java.lang.String pluginFile,
java.lang.String guiFile)
Sets the names of plugin and gui XML files associated to the plug-in |
void |
updateAction(java.lang.String action,
java.lang.String oldName,
java.lang.String newName)
This method update action element in gui and plugin XML file. |
void |
updateElementName(java.lang.String action,
java.lang.String actionName,
java.lang.String guiElementPath,
java.lang.String pluginElementPath,
java.lang.String newName)
This method updates group or parameter element name in gui and plugin XML file. |
void |
updateParameterElement(java.lang.String action,
java.lang.String actionName,
java.lang.String guiPath,
java.lang.String type,
java.lang.String oldElementName,
java.lang.String newElementName)
This method updates parameter element in gui XML file. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public XMLManipulator()
Method Detail |
---|
public void loadGui(java.io.InputStream arg0) throws java.lang.Exception
arg0
- InputStream representing the gui file
java.lang.Exception
public void loadPlugin(java.io.InputStream arg0) throws java.lang.Exception
arg0
- InputStream representing the plugin file
java.lang.Exception
public void loadBuild(java.io.InputStream arg0) throws java.lang.Exception
arg0
- InputStream representing the build file
java.lang.Exception
public void reset()
public java.io.InputStream getGuiContent()
public java.io.InputStream getPluginContent()
public java.io.InputStream getBuildContent()
public void setPluginName(java.lang.String name) throws java.lang.Exception
name
- String representing plugin name.
java.lang.Exception
public void setPluginClassName(java.lang.String name) throws java.lang.Exception
name
- String representing class name.
java.lang.Exception
public void setGuiObjectName(java.lang.String name) throws java.lang.Exception
name
- String representing object name.
java.lang.Exception
public void setSourceDir(java.lang.String dirname) throws org.jdom.JDOMException
dirname
- the directory name
org.jdom.JDOMException
public void setXMLFiles(java.lang.String pluginFile, java.lang.String guiFile) throws org.jdom.JDOMException
pluginFile
- name of the plugin XML fileguiFile
- name of the GUI XML file
org.jdom.JDOMException
public void addAction(java.lang.String action, java.lang.String name, int number) throws java.lang.Exception
action
- String representing the action to add (sample, timer, test, control)name
- String representing action namenumber
- int representing action number (generated)
java.lang.Exception
- if there is an errorpublic void deleteAction(java.lang.String action, java.lang.String name) throws java.lang.Exception
action
- String representing the action to delete (sample, timer, test, control)name
- String representing action name
java.lang.Exception
- if there is an errorpublic void updateAction(java.lang.String action, java.lang.String oldName, java.lang.String newName) throws java.lang.Exception
action
- String representing the action to update (sample, timer, test, control)oldName
- String representing old action namenewName
- String representing new action name
java.lang.Exception
- if there is an errorpublic void moveUpAction(java.lang.String action, java.lang.String name) throws java.lang.Exception
action
- String representing the action to move (sample, timer, test, control)name
- String representing action name
java.lang.Exception
- if there is an errorpublic void moveDownAction(java.lang.String action, java.lang.String name) throws java.lang.Exception
action
- String representing the action to move (sample, timer, test, control)name
- String representing action name
java.lang.Exception
- if there is an errorpublic java.util.ArrayList<java.lang.String> getActions(java.lang.String action) throws java.lang.Exception
action
- String representing the action to get (sample, timer, test, control)
java.lang.Exception
- if there is an errorpublic java.lang.String getHelp(java.lang.String action, java.lang.String name) throws java.lang.Exception
action
- String representing an action (sample, timer, test, control, object)name
- String representing action name
java.lang.Exception
- if there is an errorpublic void setHelp(java.lang.String action, java.lang.String name, java.lang.String help) throws java.lang.Exception
action
- String representing an action (sample, timer, test, control, object)name
- String representing action namehelp
- String representing action help
java.lang.Exception
- if there is an errorpublic void addGroup(java.lang.String action, java.lang.String actionName, java.lang.String parentPath, java.lang.String groupName) throws java.lang.Exception
action
- String representing an action (sample, timer, test, control, object)actionName
- String representing action nameparentPath
- String representing XPath parent expressiongroupName
- String representing group name
java.lang.Exception
- if there is an errorpublic void addParameter(java.lang.String action, java.lang.String actionName, java.lang.String guiPath, java.lang.String pluginPath, java.lang.String paramName) throws java.lang.Exception
action
- String representing an action (sample, timer, test, control, object)actionName
- String representing action nameguiPath
- String representing XPath parent expression in gui filepluginPath
- String representing XPath parent expression in plugin fileparamName
- String representing parameter name
java.lang.Exception
- if there is an errorpublic void deleteElement(java.lang.String action, java.lang.String actionName, java.lang.String guiParentPath, java.lang.String pluginParentPath, java.lang.String guiElementPath, java.lang.String pluginElementPath) throws java.lang.Exception
action
- String representing an action (sample, timer, test, control, object)actionName
- String representing action nameguiParentPath
- String representing XPath parent expression in gui filepluginParentPath
- String representing XPath parent expression in plugin fileguiElementPath
- String representing XPath element expression in gui filepluginElementPath
- String representing XPath element expression in plugin file
java.lang.Exception
- if there is an errorpublic void updateElementName(java.lang.String action, java.lang.String actionName, java.lang.String guiElementPath, java.lang.String pluginElementPath, java.lang.String newName) throws java.lang.Exception
action
- String representing an action (sample, timer, test, control, object)actionName
- String representing action nameguiElementPath
- String representing XPath element expression in gui filepluginElementPath
- String representing XPath element expression in plugin filenewName
- String representing the new element name
java.lang.Exception
- if there is an errorpublic void moveUpParameter(java.lang.String action, java.lang.String actionName, java.lang.String guiParentPath, java.lang.String guiElementPath) throws java.lang.Exception
action
- String representing an action (sample, timer, test, control, object)actionName
- String representing action nameguiParentPath
- String representing XPath parent element expression in gui fileguiElementPath
- String representing XPath element expression in gui file
java.lang.Exception
- if there is an errorpublic void moveDownParameter(java.lang.String action, java.lang.String actionName, java.lang.String guiParentPath, java.lang.String guiElementPath) throws java.lang.Exception
action
- String representing an action (sample, timer, test, control, object)actionName
- String representing action nameguiParentPath
- String representing XPath parent element expression in gui fileguiElementPath
- String representing XPath element expression in gui file
java.lang.Exception
- if there is an errorpublic void setParameterLabel(java.lang.String action, java.lang.String actionName, java.lang.String guiElementPath, java.lang.String label) throws java.lang.Exception
action
- String representing an action (sample, timer, test, control, object)actionName
- String representing action nameguiElementPath
- String representing XPath element expression in gui filelabel
- String representing the new parameter label
java.lang.Exception
- if there is an errorpublic java.lang.String getParameterLabel(java.lang.String action, java.lang.String actionName, java.lang.String guiElementPath) throws java.lang.Exception
action
- String representing an action (sample, timer, test, control, object)actionName
- String representing action nameguiElementPath
- String representing XPath element expression in gui file
java.lang.Exception
- if there is an errorpublic void setParameterType(java.lang.String action, java.lang.String actionName, java.lang.String guiElementPath, java.lang.String type) throws java.lang.Exception
action
- String representing an action (sample, timer, test, control, object)actionName
- String representing action nameguiElementPath
- String representing XPath element expression in gui filetype
- String representing the new parameter representation
java.lang.Exception
- if there is an errorpublic java.lang.String getParameterType(java.lang.String action, java.lang.String actionName, java.lang.String guiElementPath) throws java.lang.Exception
action
- String representing an action (sample, timer, test, control, object)actionName
- String representing action nameguiElementPath
- String representing XPath element expression in gui file
java.lang.Exception
- if there is an errorpublic void setParameterFieldText(java.lang.String action, java.lang.String actionName, java.lang.String guiElementPath, java.lang.String text) throws java.lang.Exception
action
- String representing an action (sample, timer, test, control, object)actionName
- String representing action nameguiElementPath
- String representing XPath element expression in gui filetext
- String representing the new parameter field text
java.lang.Exception
- if there is an errorpublic java.lang.String getParameterFieldText(java.lang.String action, java.lang.String actionName, java.lang.String guiElementPath) throws java.lang.Exception
action
- String representing an action (sample, timer, test, control, object)actionName
- String representing action nameguiElementPath
- String representing XPath element expression in gui file
java.lang.Exception
- if there is an errorpublic void setParameterFieldSize(java.lang.String action, java.lang.String actionName, java.lang.String guiElementPath, java.lang.String size) throws java.lang.Exception
action
- String representing an action (sample, timer, test, control, object)actionName
- String representing action nameguiElementPath
- String representing XPath element expression in gui filesize
- String representing the new parameter field size
java.lang.Exception
- if there is an errorpublic java.lang.String getParameterFieldSize(java.lang.String action, java.lang.String actionName, java.lang.String guiElementPath) throws java.lang.Exception
action
- String representing an action (sample, timer, test, control, object)actionName
- String representing action nameguiElementPath
- String representing XPath element expression in gui file
java.lang.Exception
- if there is an errorpublic void addParameterElement(java.lang.String action, java.lang.String actionName, java.lang.String guiPath, java.lang.String type, java.lang.String elementName) throws java.lang.Exception
action
- String representing an action (sample, timer, test, control, object)actionName
- String representing action nameguiPath
- String representing XPath parent expression in gui filetype
- String representing representation of elementelementName
- String representing parameter element name
java.lang.Exception
- if there is an errorpublic void deleteParameterElement(java.lang.String action, java.lang.String actionName, java.lang.String guiPath, java.lang.String type, java.lang.String elementName) throws java.lang.Exception
action
- String representing an action (sample, timer, test, control, object)actionName
- String representing action nameguiPath
- String representing XPath parent expression in gui filetype
- String representing representation of elementelementName
- String representing parameter element name
java.lang.Exception
- if there is an errorpublic void updateParameterElement(java.lang.String action, java.lang.String actionName, java.lang.String guiPath, java.lang.String type, java.lang.String oldElementName, java.lang.String newElementName) throws java.lang.Exception
action
- String representing an action (sample, timer, test, control, object)actionName
- String representing action nameguiPath
- String representing XPath parent expression in gui filetype
- String representing representation of elementoldElementName
- String representing old parameter element namenewElementName
- String representing new parameter element name
java.lang.Exception
- if there is an errorpublic void moveUpParameterElement(java.lang.String action, java.lang.String actionName, java.lang.String guiPath, java.lang.String type, java.lang.String elementName) throws java.lang.Exception
action
- String representing an action (sample, timer, test, control, object)actionName
- String representing action nameguiPath
- String representing XPath parent expression in gui filetype
- String representing representation of elementelementName
- String representing parameter element name
java.lang.Exception
- if there is an errorpublic void moveDownParameterElement(java.lang.String action, java.lang.String actionName, java.lang.String guiPath, java.lang.String type, java.lang.String elementName) throws java.lang.Exception
action
- String representing an action (sample, timer, test, control, object)actionName
- String representing action nameguiPath
- String representing XPath parent expression in gui filetype
- String representing representation of elementelementName
- String representing parameter element name
java.lang.Exception
- if there is an errorpublic java.util.ArrayList<java.lang.String> getParameterElements(java.lang.String action, java.lang.String actionName, java.lang.String guiPath, java.lang.String type) throws java.lang.Exception
action
- String representing an action (sample, timer, test, control, object)actionName
- String representing action nameguiPath
- String representing XPath parent expression in gui filetype
- String representing representation of element
java.lang.Exception
- if there is an errorpublic void setParameterElementDefault(java.lang.String action, java.lang.String actionName, java.lang.String guiPath, java.lang.String type, java.lang.String elementName, java.lang.String value) throws java.lang.Exception
action
- String representing an action (sample, timer, test, control, object)actionName
- String representing action nameguiPath
- String representing XPath parent expression in gui filetype
- String representing representation of elementelementName
- String representing parameter element namevalue
- String representing the value to set
java.lang.Exception
- if there is an errorpublic java.lang.String getParameterElementDefault(java.lang.String action, java.lang.String actionName, java.lang.String guiPath, java.lang.String type, java.lang.String elementName) throws java.lang.Exception
action
- String representing an action (sample, timer, test, control, object)actionName
- String representing action nameguiPath
- String representing XPath parent expression in gui filetype
- String representing representation of elementelementName
- String representing parameter element name
java.lang.Exception
- if there is an errorpublic org.jdom.Element getParams(java.lang.String action, java.lang.String name) throws java.lang.Exception
action
- String representing an action (sample, timer, test, control, object)name
- String representing action name
java.lang.Exception
- if there is an errorpublic java.lang.String[] getStringParams(java.lang.String action, java.lang.String name) throws java.lang.Exception
action
- String representing an action (sample, timer, test, control, object)name
- String representing action name
java.lang.Exception
- if there is an errorpublic int getMaxNumber() throws java.lang.Exception
java.lang.Exception
- if there is an error.public boolean isParameterExist(java.lang.String action, java.lang.String name, java.lang.String elementPath) throws java.lang.Exception
action
- String representing the action (sample, timer, test, control, object)name
- String representing action nameelementPath
- String representing XPath expression of element
java.lang.Exception
- if there is an error.public java.lang.String getClassName() throws java.lang.Exception
java.lang.Exception
- if there is an error.public int getActionNumber(java.lang.String action, java.lang.String name) throws java.lang.Exception
action
- String representing the action (sample, timer, test, control)name
- String representing action name
java.lang.Exception
- if there is an error.public java.lang.String getPackageName() throws java.lang.Exception
java.lang.Exception
- if there is an error.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |