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 ofOsmChangesetContentParserandOsmHistoryReaderinternal parsers.- Since:
- 6201
-
-
Field Summary
Fields Modifier and Type Field Description protected HistoryOsmPrimitivecurrentPrimitivethe current primitive to be readprotected org.xml.sax.Locatorlocatorprivate java.util.Map<RelationMemberData,RelationMemberData>memberCacheprotected booleanuseAnonymousUserif 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 HistoryOsmPrimitivecreatePrimitive(org.xml.sax.Attributes atts, OsmPrimitiveType type)protected booleandoStartElement(java.lang.String qName, org.xml.sax.Attributes atts)protected java.lang.DoublegetAttributeDouble(org.xml.sax.Attributes attr, java.lang.String name)protected java.lang.LonggetAttributeLong(org.xml.sax.Attributes attr, java.lang.String name)protected booleangetMandatoryAttributeBoolean(org.xml.sax.Attributes attr, java.lang.String name)protected longgetMandatoryAttributeLong(org.xml.sax.Attributes attr, java.lang.String name)protected java.lang.StringgetMandatoryAttributeString(org.xml.sax.Attributes attr, java.lang.String name)protected voidhandleMember(org.xml.sax.Attributes atts)protected voidhandleNodeReference(org.xml.sax.Attributes atts)protected voidhandleTag(org.xml.sax.Attributes atts)voidsetDocumentLocator(org.xml.sax.Locator locator)protected voidstartNode(org.xml.sax.Attributes atts)protected voidstartRelation(org.xml.sax.Attributes atts)protected voidstartWay(org.xml.sax.Attributes atts)protected abstract voidthrowException(java.lang.String message)protected abstract voidthrowException(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:
setDocumentLocatorin interfaceorg.xml.sax.ContentHandler- Overrides:
setDocumentLocatorin 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
-
-