Package org.openstreetmap.josm.io
Class AbstractParser
- java.lang.Object
-
- org.xml.sax.helpers.DefaultHandler
-
- org.openstreetmap.josm.io.AbstractParser
-
- All Implemented Interfaces:
org.xml.sax.ContentHandler
,org.xml.sax.DTDHandler
,org.xml.sax.EntityResolver
,org.xml.sax.ErrorHandler
- Direct Known Subclasses:
OsmChangesetContentParser.Parser
,OsmHistoryReader.Parser
public abstract class AbstractParser extends org.xml.sax.helpers.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 org.xml.sax.Locator
locator
private java.util.Map<RelationMemberData,RelationMemberData>
memberCache
protected boolean
useAnonymousUser
if true, replace user information in input by anonymous user
-
Constructor Summary
Constructors Constructor Description AbstractParser()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected HistoryOsmPrimitive
createPrimitive(org.xml.sax.Attributes atts, OsmPrimitiveType type)
protected boolean
doStartElement(java.lang.String qName, org.xml.sax.Attributes atts)
protected java.lang.Double
getAttributeDouble(org.xml.sax.Attributes attr, java.lang.String name)
protected java.lang.Long
getAttributeLong(org.xml.sax.Attributes attr, java.lang.String name)
protected boolean
getMandatoryAttributeBoolean(org.xml.sax.Attributes attr, java.lang.String name)
protected long
getMandatoryAttributeLong(org.xml.sax.Attributes attr, java.lang.String name)
protected java.lang.String
getMandatoryAttributeString(org.xml.sax.Attributes attr, java.lang.String name)
protected void
handleMember(org.xml.sax.Attributes atts)
protected void
handleNodeReference(org.xml.sax.Attributes atts)
protected void
handleTag(org.xml.sax.Attributes atts)
void
setDocumentLocator(org.xml.sax.Locator locator)
protected void
startNode(org.xml.sax.Attributes atts)
protected void
startRelation(org.xml.sax.Attributes atts)
protected void
startWay(org.xml.sax.Attributes atts)
protected abstract void
throwException(java.lang.String message)
protected abstract void
throwException(java.lang.String message, java.lang.Exception e)
-
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
-
locator
protected org.xml.sax.Locator locator
-
useAnonymousUser
protected boolean useAnonymousUser
if true, replace user information in input by anonymous user
-
memberCache
private java.util.Map<RelationMemberData,RelationMemberData> memberCache
-
-
Constructor Detail
-
AbstractParser
public AbstractParser()
-
-
Method Detail
-
setDocumentLocator
public void setDocumentLocator(org.xml.sax.Locator locator)
- Specified by:
setDocumentLocator
in interfaceorg.xml.sax.ContentHandler
- Overrides:
setDocumentLocator
in classorg.xml.sax.helpers.DefaultHandler
-
throwException
protected abstract void throwException(java.lang.String message) throws org.xml.sax.SAXException
- Throws:
org.xml.sax.SAXException
-
throwException
protected abstract void throwException(java.lang.String message, java.lang.Exception e) throws org.xml.sax.SAXException
- Throws:
org.xml.sax.SAXException
-
getMandatoryAttributeLong
protected final long getMandatoryAttributeLong(org.xml.sax.Attributes attr, java.lang.String name) throws org.xml.sax.SAXException
- Throws:
org.xml.sax.SAXException
-
getAttributeLong
protected final java.lang.Long getAttributeLong(org.xml.sax.Attributes attr, java.lang.String name) throws org.xml.sax.SAXException
- Throws:
org.xml.sax.SAXException
-
getAttributeDouble
protected final java.lang.Double getAttributeDouble(org.xml.sax.Attributes attr, java.lang.String name) throws org.xml.sax.SAXException
- Throws:
org.xml.sax.SAXException
-
getMandatoryAttributeString
protected final java.lang.String getMandatoryAttributeString(org.xml.sax.Attributes attr, java.lang.String name) throws org.xml.sax.SAXException
- Throws:
org.xml.sax.SAXException
-
getMandatoryAttributeBoolean
protected boolean getMandatoryAttributeBoolean(org.xml.sax.Attributes attr, java.lang.String name) throws org.xml.sax.SAXException
- Throws:
org.xml.sax.SAXException
-
createPrimitive
protected final HistoryOsmPrimitive createPrimitive(org.xml.sax.Attributes atts, OsmPrimitiveType type) throws org.xml.sax.SAXException
- Throws:
org.xml.sax.SAXException
-
startNode
protected final void startNode(org.xml.sax.Attributes atts) throws org.xml.sax.SAXException
- Throws:
org.xml.sax.SAXException
-
startWay
protected final void startWay(org.xml.sax.Attributes atts) throws org.xml.sax.SAXException
- Throws:
org.xml.sax.SAXException
-
startRelation
protected final void startRelation(org.xml.sax.Attributes atts) throws org.xml.sax.SAXException
- Throws:
org.xml.sax.SAXException
-
handleTag
protected final void handleTag(org.xml.sax.Attributes atts) throws org.xml.sax.SAXException
- Throws:
org.xml.sax.SAXException
-
handleNodeReference
protected final void handleNodeReference(org.xml.sax.Attributes atts) throws org.xml.sax.SAXException
- Throws:
org.xml.sax.SAXException
-
handleMember
protected void handleMember(org.xml.sax.Attributes atts) throws org.xml.sax.SAXException
- Throws:
org.xml.sax.SAXException
-
doStartElement
protected final boolean doStartElement(java.lang.String qName, org.xml.sax.Attributes atts) throws org.xml.sax.SAXException
- Throws:
org.xml.sax.SAXException
-
-