org.eclipse.tptp.platform.agentcontroller.config
Class ConfigFile
java.lang.Object
org.xml.sax.helpers.DefaultHandler
org.eclipse.tptp.platform.agentcontroller.config.ConfigFile
- All Implemented Interfaces:
- org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler
- public class ConfigFile
- extends org.xml.sax.helpers.DefaultHandler
|
Field Summary |
protected org.w3c.dom.Element |
acConfig
|
protected org.w3c.dom.Document |
doc
|
protected javax.xml.parsers.DocumentBuilder |
docBuild
|
protected javax.xml.parsers.DocumentBuilderFactory |
docBuildFactory
|
protected org.w3c.dom.Element |
holder
|
protected static java.lang.String |
TAG
|
|
Constructor Summary |
ConfigFile(java.lang.String name)
|
|
Method Summary |
void |
characters(char[] chs,
int start,
int length)
|
void |
createNewDocument()
|
void |
endElement(java.lang.String uri,
java.lang.String local,
java.lang.String raw)
|
void |
generateConfiguration()
|
void |
generateHyadesConfiguration()
Generate the basic Hyades Data Collection Engine configuration |
org.w3c.dom.Element |
getAcConfig()
|
org.w3c.dom.Document |
getDoc()
|
org.w3c.dom.Element |
getHolder()
|
java.lang.String |
getValue(java.lang.String tag)
|
void |
init(java.util.Hashtable hash)
|
boolean |
isExist(java.lang.String tag)
|
void |
loadExistingDocument(java.lang.String file)
|
void |
removeKey(java.lang.String tag)
|
void |
saveToFile()
|
void |
saveToFile(java.lang.String fileName)
|
void |
setFileName(java.lang.String filename)
|
void |
setValue(java.lang.String tag,
java.lang.String value)
|
void |
startElement(java.lang.String uri,
java.lang.String local,
java.lang.String raw,
org.xml.sax.Attributes attrs)
|
java.lang.String |
toString()
|
void |
validate(java.lang.Boolean showAll)
Detects values that are file paths, resolves them to a path with
variables replaced with concrete values and then validate that the paths
are indeed existing paths (or files as appropriate)
This is the place to put other validation checks if required as well,
such as variable assignments that are required by missing, conflicting
variable values, etc |
| Methods inherited from class org.xml.sax.helpers.DefaultHandler |
endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
TAG
protected static java.lang.String TAG
docBuildFactory
protected javax.xml.parsers.DocumentBuilderFactory docBuildFactory
docBuild
protected javax.xml.parsers.DocumentBuilder docBuild
doc
protected org.w3c.dom.Document doc
acConfig
protected org.w3c.dom.Element acConfig
holder
protected org.w3c.dom.Element holder
ConfigFile
public ConfigFile(java.lang.String name)
saveToFile
public void saveToFile()
saveToFile
public void saveToFile(java.lang.String fileName)
toString
public java.lang.String toString()
generateConfiguration
public void generateConfiguration()
generateHyadesConfiguration
public void generateHyadesConfiguration()
- Generate the basic Hyades Data Collection Engine configuration
init
public void init(java.util.Hashtable hash)
createNewDocument
public void createNewDocument()
loadExistingDocument
public void loadExistingDocument(java.lang.String file)
startElement
public void startElement(java.lang.String uri,
java.lang.String local,
java.lang.String raw,
org.xml.sax.Attributes attrs)
throws org.xml.sax.SAXException
- Throws:
org.xml.sax.SAXException
endElement
public void endElement(java.lang.String uri,
java.lang.String local,
java.lang.String raw)
characters
public void characters(char[] chs,
int start,
int length)
getAcConfig
public org.w3c.dom.Element getAcConfig()
- Returns:
- Returns the acConfig.
getValue
public java.lang.String getValue(java.lang.String tag)
setValue
public void setValue(java.lang.String tag,
java.lang.String value)
removeKey
public void removeKey(java.lang.String tag)
isExist
public boolean isExist(java.lang.String tag)
getHolder
public org.w3c.dom.Element getHolder()
- Returns:
- Returns the holder.
getDoc
public org.w3c.dom.Document getDoc()
- Returns:
- Returns the doc.
setFileName
public void setFileName(java.lang.String filename)
validate
public void validate(java.lang.Boolean showAll)
- Detects values that are file paths, resolves them to a path with
variables replaced with concrete values and then validate that the paths
are indeed existing paths (or files as appropriate)
This is the place to put other validation checks if required as well,
such as variable assignments that are required by missing, conflicting
variable values, etc
- Parameters:
showAll - indicates if all is rpeorted on just invalid entries