public class PluginBase extends java.lang.Object implements IPluginInfo, IInit
IPluginInfo.IPluginInfoContext
IInit.IDestroyContext, IInit.IInitContext
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
itsKeyId
The Key ID for this plugin.
|
protected org.w3c.dom.Element |
itsSettingRoot
The root element of the XML document containing configurations for
this plugin.
|
static java.lang.String |
SOAP_URI |
Constructor and Description |
---|
PluginBase() |
Modifier and Type | Method and Description |
---|---|
protected org.w3c.dom.Element |
buildDom(java.lang.String doc)
Given a String, build a DOM out of it and return the root element.
|
static IXPathEvaluator |
buildXPath(org.w3c.dom.Element root,
java.lang.String name)
Given an
Element , build an XPath out of the string value of the element with the specified name. |
static IXPathEvaluator |
buildXPath(java.lang.String path,
org.w3c.dom.Node nsContext)
Build an XPath for the specified string.
|
void |
destroy(IInit.IDestroyContext ctx)
This method is called by the host application when the instance of the plug-in is released
|
static org.w3c.dom.Element |
getFirstElement(IXpathResult match)
If the IXpathResult contains a Node set whose first child is an Element, return it.
|
void |
getPluginInfo(IPluginInfo.IPluginInfoContext ctx)
Return PluginInfo with key.
|
static java.lang.String |
getStringValue(org.w3c.dom.Element elm)
Given an
Element , extract the text value that is stored in this element. |
static java.lang.String |
getStringValue(org.w3c.dom.Element root,
java.lang.String name)
Given an
Element , extract the text value that is stored in the specified child element. |
void |
init(IInit.IInitContext ctx)
After the constructor is called, this method is called to initialize the
plug in and passed any settings that are needed.
|
static boolean |
isBlank(java.lang.String s)
Returns TRUE if the given String is "blank"; otherwise FALSE.
|
protected void |
loadSettings(ISettings settings) |
protected void |
loadSettings(java.lang.String settingsStr) |
protected static double |
parseDoubleSetting(java.lang.String val,
java.lang.String settingName)
Convert the specified string to a double.
|
protected static int |
parseIntSetting(java.lang.String val,
java.lang.String settingName)
Convert the specified string to an integer.
|
static int |
size(java.util.Collection c)
Compute the size of a collection.
|
static int |
size(java.util.Map m)
Compute the size of a
Map . |
static int |
size(org.w3c.dom.NodeList nl)
Compute the size of a
NodeList . |
static int |
size(java.lang.Object[] c)
Compute the size of an array.
|
public static final java.lang.String SOAP_URI
protected java.lang.String itsKeyId
protected org.w3c.dom.Element itsSettingRoot
public void init(IInit.IInitContext ctx) throws java.lang.Exception
public void destroy(IInit.IDestroyContext ctx) throws java.lang.Exception
IInit
public void getPluginInfo(IPluginInfo.IPluginInfoContext ctx) throws java.lang.Exception
getPluginInfo
in interface IPluginInfo
java.lang.Exception
protected void loadSettings(ISettings settings) throws java.lang.Exception
java.lang.Exception
protected org.w3c.dom.Element buildDom(java.lang.String doc) throws java.lang.Exception
java.lang.Exception
protected void loadSettings(java.lang.String settingsStr) throws java.lang.Exception
java.lang.Exception
public static IXPathEvaluator buildXPath(org.w3c.dom.Element root, java.lang.String name) throws java.lang.Exception
Element
, build an XPath out of the string value of the element with the specified name.root
- The element where the XPath is found.name
- The name of the element under root.java.lang.Exception
public static IXPathEvaluator buildXPath(java.lang.String path, org.w3c.dom.Node nsContext) throws java.lang.Exception
path
- The XPath String.nsContext
- The namespace context for the XPath.java.lang.Exception
public static java.lang.String getStringValue(org.w3c.dom.Element root, java.lang.String name) throws java.lang.Exception
Element
, extract the text value that is stored in the specified child element.root
- The root element of the settings.name
- The name of the child element to extract the string value from.java.lang.Exception
public static java.lang.String getStringValue(org.w3c.dom.Element elm)
Element
, extract the text value that is stored in this element.elm
- The element to extract the string value from.public static org.w3c.dom.Element getFirstElement(IXpathResult match) throws java.lang.Exception
match
- the Element containing a nodeset whose first Node may be an Elementjava.lang.Exception
public static final int size(java.lang.Object[] c)
c
- Object arraypublic static final int size(java.util.Collection c)
c
- Collectionpublic static final int size(java.util.Map m)
Map
. Handles null.
lastrev fix36438 - new method
public static final int size(org.w3c.dom.NodeList nl)
NodeList
. Handles null.
lastrev fix36438 - new method
public static boolean isBlank(java.lang.String s)
s
- The object to test.protected static int parseIntSetting(java.lang.String val, java.lang.String settingName) throws java.lang.Exception
val
- Stringified value of the integer settingsettingName
- Name of the setting (used if an exception needs to be thrown)java.lang.Exception
protected static double parseDoubleSetting(java.lang.String val, java.lang.String settingName) throws java.lang.Exception
val
- Stringified value of the double settingsettingName
- Name of the setting (used if an exception needs to be thrown)java.lang.Exception