class PreferencesParser extends org.xml.sax.helpers.DefaultHandler implements PreferencesFileConstants
Modifier and Type | Field and Description |
---|---|
private boolean |
mainMarkup
Indicates if we wait first main markup
|
private java.util.HashMap<java.lang.String,Pair<PreferenceType,java.lang.Object>> |
preferences
Preference to fill
|
MARKUP_PREFERENCE, MARKUP_PREFERENCES, PARAMETER_NAME, PARAMETER_TYPE, PARAMETER_VALUE
Constructor and Description |
---|
PreferencesParser(java.io.File preferencesFile,
java.util.HashMap<java.lang.String,Pair<PreferenceType,java.lang.Object>> preferences)
Create a new instance of PreferencesParser and fill preferences from file
|
Modifier and Type | Method and Description |
---|---|
void |
error(org.xml.sax.SAXParseException e)
Call by parser when error happen
Parent documentation: |
void |
fatalError(org.xml.sax.SAXParseException e)
Call by parser when fatal error happen
Parent documentation: |
private java.lang.String |
getParameter(java.lang.String parameter,
org.xml.sax.Attributes attributes)
Get a parameter value
|
void |
startElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qName,
org.xml.sax.Attributes attributes)
Call by parser when a markup open
Parent documentation: |
void |
warning(org.xml.sax.SAXParseException e)
Call by parser when warning happen
Parent documentation: |
private boolean mainMarkup
private final java.util.HashMap<java.lang.String,Pair<PreferenceType,java.lang.Object>> preferences
PreferencesParser(java.io.File preferencesFile, java.util.HashMap<java.lang.String,Pair<PreferenceType,java.lang.Object>> preferences)
preferencesFile
- Preference file to parsepreferences
- Preferences to fillprivate java.lang.String getParameter(java.lang.String parameter, org.xml.sax.Attributes attributes) throws org.xml.sax.SAXException
parameter
- Parameter nameattributes
- Attributes where extract the valueorg.xml.sax.SAXException
- If parameter ask dosen't existspublic void error(org.xml.sax.SAXParseException e) throws org.xml.sax.SAXException
error
in interface org.xml.sax.ErrorHandler
error
in class org.xml.sax.helpers.DefaultHandler
e
- Error happenorg.xml.sax.SAXException
- Not throwDefaultHandler.error(org.xml.sax.SAXParseException)
public void fatalError(org.xml.sax.SAXParseException e) throws org.xml.sax.SAXException
fatalError
in interface org.xml.sax.ErrorHandler
fatalError
in class org.xml.sax.helpers.DefaultHandler
e
- Fatal errororg.xml.sax.SAXException
- Not throwDefaultHandler.fatalError(org.xml.sax.SAXParseException)
public void startElement(java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes attributes) throws org.xml.sax.SAXException
startElement
in interface org.xml.sax.ContentHandler
startElement
in class org.xml.sax.helpers.DefaultHandler
uri
- URIlocalName
- Local nameqName
- Q nameattributes
- Attributes with parameters and corresponding valueorg.xml.sax.SAXException
- If markup not valid or a parameter missingDefaultHandler.startElement(java.lang.String, java.lang.String, java.lang.String,
org.xml.sax.Attributes)
public void warning(org.xml.sax.SAXParseException e) throws org.xml.sax.SAXException
warning
in interface org.xml.sax.ErrorHandler
warning
in class org.xml.sax.helpers.DefaultHandler
e
- Warningorg.xml.sax.SAXException
- Not throwDefaultHandler.warning(org.xml.sax.SAXParseException)