X-Git-Url: http://jaekl.net/gitweb/?p=cfb.git;a=blobdiff_plain;f=prod%2Fnet%2Fjaekl%2Fcfb%2Fxml%2FSourceLine.java;h=c719529e2d9231c1a396253174571c932767ca0b;hp=627667a161ac4e3902c6170412e5f32badf2c6b8;hb=5bc9bbe3fd54b9fc7aa3b92d2d37e95c41b9645a;hpb=a938b67bf3d3bd86f8dd7b1f958e81007bf6f2fe diff --git a/prod/net/jaekl/cfb/xml/SourceLine.java b/prod/net/jaekl/cfb/xml/SourceLine.java index 627667a..c719529 100644 --- a/prod/net/jaekl/cfb/xml/SourceLine.java +++ b/prod/net/jaekl/cfb/xml/SourceLine.java @@ -1,5 +1,8 @@ package net.jaekl.cfb.xml; +import java.io.PrintWriter; + +import net.jaekl.qd.xml.MissingAttributeException; import net.jaekl.qd.xml.ParseResult; import net.jaekl.qd.xml.XmlParseException; @@ -26,24 +29,38 @@ public class SourceLine extends ParseResult { } @Override - public void endContents(String uri, String localName, String qName, String chars, Attributes attr) - throws XmlParseException - { + public void handleMainAttributes(Attributes attr) throws MissingAttributeException { String scratch; - m_className = getRequiredAttr(localName, attr, ATTR_CLASS_NAME); + m_className = getRequiredAttr(TAG, attr, ATTR_CLASS_NAME); - scratch = getRequiredAttr(localName, attr, ATTR_START); + scratch = getRequiredAttr(TAG, attr, ATTR_START); m_start = Integer.parseInt(scratch); - scratch = getRequiredAttr(localName, attr, ATTR_END); + scratch = getRequiredAttr(TAG, attr, ATTR_END); m_end = Integer.parseInt(scratch); } + @Override + public void endContents(String uri, String localName, String qName, String chars) + throws XmlParseException + { + // no-op + } + @Override public void endExternal(String uri, String localName, String qName) throws XmlParseException { // no-op } + + @Override + public void dump(PrintWriter pw, int indent) + { + super.dump(pw, indent); + String tab = String.format("%" + (indent + 2) + "s", ""); + + pw.println(tab + m_className + " (" + m_start + " .. " + m_end + ")"); + } }