Class AbstractXMLConfiguration
java.lang.Object
net.simplace.ui.customize.AbstractXMLConfiguration
Abstract config file with important functions for parsing and writing Data to XML Configfiles
- Author:
- Andreas Enders
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.jdom2.Elementthe XML configuration of this fileprotected org.jdom2.Documentthe XML document of the file,nullif the file does not existprotected Filethe configuration file -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCreates an empty configuration (for subclasses).AbstractXMLConfiguration(File aConfigFile, org.jdom2.Element aConfiguration) Reads the file without parameters, seeAbstractXMLConfiguration(File, Element, Map).AbstractXMLConfiguration(File aConfigFile, org.jdom2.Element aConfiguration, Map<String, Object> aParameterMap) Reads the file, if it exists (errors are logged), and initializes the values. -
Method Summary
Modifier and TypeMethodDescriptionvoidcommit()if is setModified() new Values will be written to config file.protected abstract voidWrites the values into the document; has to be implemented by FileFields.protected abstract voidReads the values from the document; has to be implemented by FileFields.protected StringvoidreplaceParametersFromMap(Map<String, Object> aParamMap) Not supported for XML files (does nothing).voidMarks the document as modified; only thencommit()writes it.voidMarks the document as unmodified, socommit()does not write it.toString()protected voidwriteValue(String aValue, int aLineNumber, int aBeginColumnNumber, int aEndColumnNumber) Not supported for XML files (does nothing).
-
Field Details
-
iDocument
protected org.jdom2.Document iDocumentthe XML document of the file,nullif the file does not exist -
iFile
the configuration file -
iConfiguration
protected org.jdom2.Element iConfigurationthe XML configuration of this file
-
-
Constructor Details
-
AbstractXMLConfiguration
Reads the file without parameters, seeAbstractXMLConfiguration(File, Element, Map).- Parameters:
aConfigFile- the XML configuration fileaConfiguration- the XML configuration of this file
-
AbstractXMLConfiguration
public AbstractXMLConfiguration(File aConfigFile, org.jdom2.Element aConfiguration, Map<String, Object> aParameterMap) Reads the file, if it exists (errors are logged), and initializes the values.Note: the result of replacing the parameters is not used, so tokens stay in the document.
- Parameters:
aConfigFile- the XML configuration fileaConfiguration- the XML configuration of this fileaParameterMap- parameters for the tokens in the file
-
AbstractXMLConfiguration
protected AbstractXMLConfiguration()Creates an empty configuration (for subclasses).
-
-
Method Details
-
initializeFileValues
protected abstract void initializeFileValues()Reads the values from the document; has to be implemented by FileFields. -
commitValues
protected abstract void commitValues()Writes the values into the document; has to be implemented by FileFields. -
commit
public void commit()if is setModified() new Values will be written to config file. -
readValue
-
writeValue
protected void writeValue(String aValue, int aLineNumber, int aBeginColumnNumber, int aEndColumnNumber) Not supported for XML files (does nothing).- Parameters:
aValue- not usedaLineNumber- not usedaBeginColumnNumber- not usedaEndColumnNumber- not used
-
replaceParametersFromMap
-
getConfigurationParmeterValue
-
setModified
public void setModified()Marks the document as modified; only thencommit()writes it. -
setUnModified
public void setUnModified()Marks the document as unmodified, socommit()does not write it. -
toString
-