Package org.openstreetmap.josm.io
Class AbstractParser
- java.lang.Object
-
- org.xml.sax.helpers.DefaultHandler
-
- org.openstreetmap.josm.io.AbstractParser
-
- All Implemented Interfaces:
ContentHandler
,DTDHandler
,EntityResolver
,ErrorHandler
- Direct Known Subclasses:
OsmChangesetContentParser.Parser
,OsmHistoryReader.Parser
public abstract class AbstractParser extends DefaultHandler
Base class ofOsmChangesetContentParser
andOsmHistoryReader
internal parsers.- Since:
- 6201
-
-
Field Summary
Fields Modifier and Type Field Description protected HistoryOsmPrimitive
currentPrimitive
the current primitive to be readprotected Locator
locator
protected boolean
useAnonymousUser
if true, replace user information in input by anonymous user
-
Constructor Summary
Constructors Constructor Description AbstractParser()
-
Method Summary
-
Methods inherited from class org.xml.sax.helpers.DefaultHandler
characters, endDocument, endElement, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, skippedEntity, startDocument, startElement, startPrefixMapping, unparsedEntityDecl, warning
-
-
-
-
Field Detail
-
currentPrimitive
protected HistoryOsmPrimitive currentPrimitive
the current primitive to be read
-
useAnonymousUser
protected boolean useAnonymousUser
if true, replace user information in input by anonymous user
-
-
Constructor Detail
-
AbstractParser
public AbstractParser()
-
-
Method Detail
-
setDocumentLocator
public void setDocumentLocator(Locator locator)
- Specified by:
setDocumentLocator
in interfaceContentHandler
- Overrides:
setDocumentLocator
in classDefaultHandler
-
throwException
protected abstract void throwException(String message) throws SAXException
- Throws:
SAXException
-
throwException
protected abstract void throwException(String message, Exception e) throws SAXException
- Throws:
SAXException
-
getMandatoryAttributeLong
protected final long getMandatoryAttributeLong(Attributes attr, String name) throws SAXException
- Throws:
SAXException
-
getAttributeLong
protected final Long getAttributeLong(Attributes attr, String name) throws SAXException
- Throws:
SAXException
-
getAttributeDouble
protected final Double getAttributeDouble(Attributes attr, String name) throws SAXException
- Throws:
SAXException
-
getMandatoryAttributeString
protected final String getMandatoryAttributeString(Attributes attr, String name) throws SAXException
- Throws:
SAXException
-
getMandatoryAttributeBoolean
protected boolean getMandatoryAttributeBoolean(Attributes attr, String name) throws SAXException
- Throws:
SAXException
-
createPrimitive
protected final HistoryOsmPrimitive createPrimitive(Attributes atts, OsmPrimitiveType type) throws SAXException
- Throws:
SAXException
-
startNode
protected final void startNode(Attributes atts) throws SAXException
- Throws:
SAXException
-
startWay
protected final void startWay(Attributes atts) throws SAXException
- Throws:
SAXException
-
startRelation
protected final void startRelation(Attributes atts) throws SAXException
- Throws:
SAXException
-
handleTag
protected final void handleTag(Attributes atts) throws SAXException
- Throws:
SAXException
-
handleNodeReference
protected final void handleNodeReference(Attributes atts) throws SAXException
- Throws:
SAXException
-
handleMember
protected void handleMember(Attributes atts) throws SAXException
- Throws:
SAXException
-
doStartElement
protected final boolean doStartElement(String qName, Attributes atts) throws SAXException
- Throws:
SAXException
-
-