public final class XMLPreferencesManager extends Object
| Modifier and Type | Field and Description |
|---|---|
private static XMLPreferencesManager |
currentPrefManager |
private String |
fileName |
private static org.apache.log4j.Logger |
logger |
private Marshaller |
marshaller |
private String |
pathName |
private IqmOperatorTemplates |
propertyXML |
private Unmarshaller |
unmarshaller |
| Constructor and Description |
|---|
XMLPreferencesManager(String pathName)
Constructs a new JAIXMLParameterBlocks and a new IQMOperatorTemplates.xml
if necessary.
|
| Modifier and Type | Method and Description |
|---|---|
void |
deleteTemplateByName(String parameterblockname,
String templatename)
Deletes a template from IQMOperatorTemplates.xml.
|
static XMLPreferencesManager |
getInstance() |
IqmOperatorTemplates.ParameterBlock |
getParameterBlockByName(String parameterblockname)
Returns a List of JaiOperationDescriptor-template from the XML by the
given name.
|
ParameterBlockIQM |
getTemplate(String operatorName,
String templateName)
De-serializes an operator's parameter block into a Java object.
|
IqmOperatorDescriptor |
getTemplateByName(String parameterblockname,
String templatename)
Returns a JaiOperationDescriptor from the XML by the given name.
|
private IqmOperatorTemplates |
getXMLDoc()
Returns an object of the DOM-representation of the XML-file currently
written.
|
ParameterBlockIQM |
loadParameterBlockFromTemplate(ParameterBlockIQM block,
IqmOperatorDescriptor template)
Changes values in a ParameterBlockIQM to the settings in the
IQMOperatorTemplates.xml.
|
void |
readXML(File xmlFile)
Reads the specified XML-file.
|
void |
setTemplate(String parameterblockname,
String templatename,
ParameterBlockIQM block)
Sets a new template in IQMOperatorTemplates.xml with the values of a
ParameterBlockIQM.
Currently supported parameter-types: Integer, Boolean, Character, Double, Float. This function is synchronized. |
private void |
validate()
Validates the preferences file against a defined schema.
|
void |
writeXML()
Writes the IQMOperatorTemplates.xml to the "IQM"-user-folder of the
application.
|
private static final org.apache.log4j.Logger logger
private Marshaller marshaller
private Unmarshaller unmarshaller
private IqmOperatorTemplates propertyXML
private static XMLPreferencesManager currentPrefManager
private String pathName
private String fileName
public XMLPreferencesManager(String pathName)
private IqmOperatorTemplates getXMLDoc()
public void writeXML()
public void readXML(File xmlFile) throws JAXBException, NullPointerException
xmlFile - XML-file to read in.JAXBExceptionNullPointerExceptionprivate void validate()
public IqmOperatorTemplates.ParameterBlock getParameterBlockByName(String parameterblockname)
parameterblockname - ParameterBlock-name (GUI-name) to find in the
IQMOperatorTemplates.xmlpublic IqmOperatorDescriptor getTemplateByName(String parameterblockname, String templatename)
parameterblockname - ParameterBlock-name (GUI-name) to find in the
IQMOperatorTemplates.xmltemplatename - Template-name to find in the IQMOperatorTemplates.xmlpublic ParameterBlockIQM getTemplate(String operatorName, String templateName)
operatorName - the unique name of the operatortemplateName - the unique name of the template for an operatorParameterBlockIQM objectpublic void deleteTemplateByName(String parameterblockname, String templatename)
parameterblockname - ParameterBlock-name (GUI-name) of the template to be deleted.templatename - Template-name to be deleted.public ParameterBlockIQM loadParameterBlockFromTemplate(ParameterBlockIQM block, IqmOperatorDescriptor template) throws Exception
block - ParameterBlockIQM used as basis for the setting (Use the
hard-coded default ParameterBlock if unsure).template - JaiOperationDescriptor template to fit into the
ParameterBlockIQM.ExceptionFor a convenient way to get the correct
{@link IOperatorDescriptor} for parameter template.public void setTemplate(String parameterblockname, String templatename, ParameterBlockIQM block)
parameterblockname - operator name of the new entry to IQMOperatorTemplates.xml.templatename - Template-name of the new entry to IQMOperatorTemplates.xml.block - Values of this ParameterBlockIQM are saved to
IQMOperatorTemplates.xml.public static XMLPreferencesManager getInstance()
Copyright © 2009–2017 Helmut Ahammer, Philipp Kainz. All rights reserved.